diff --git a/Cargo.toml b/Cargo.toml index 219bf2777..aba95f4aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,8 @@ [workspace] members = [ "async-stripe", - "stripe_types" + "stripe_types", + "stripe_webhook" ] resolver = "2" # Makes dependency management simpler to allow codegen crate to use whichever dep versions diff --git a/async-stripe/src/lib.rs b/async-stripe/src/lib.rs index 15f1f240b..60c9915f0 100644 --- a/async-stripe/src/lib.rs +++ b/async-stripe/src/lib.rs @@ -53,14 +53,9 @@ //! Otherwise, we are open to turning this into an open trait so that you can implement your own strategy. #![allow(clippy::map_clone, clippy::large_enum_variant)] -#![warn(clippy::unwrap_used, clippy::missing_errors_doc, clippy::missing_panics_doc)] +#![warn(clippy::unwrap_used, clippy::missing_errors_doc)] #![forbid(unsafe_code)] -// Give a clear error when a required runtime error is not present. Would be better for this -// to be a fatal error preventing emission of further compile errors relating to lack of -// a runtime feature, but that does not seem currently possible: -// https://github.com/rust-lang/rust/issues/68838 - mod client; mod error; mod pagination; diff --git a/generated/stripe_billing/Cargo.toml b/generated/stripe_billing/Cargo.toml new file mode 100644 index 000000000..e2ef59917 --- /dev/null +++ b/generated/stripe_billing/Cargo.toml @@ -0,0 +1,71 @@ +[package] +name = "stripe_billing" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + +[dependencies] +serde.workspace = true +http-types.workspace = true +smol_str.workspace = true +serde_json.workspace = true +async-stripe = {path = "../../async-stripe"} + +stripe_types = {path = "../../stripe_types"} + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +credit_note = [] +credit_note_line_item = [] +invoice = [] +invoice_item = [] +invoice_line_item = [] +plan = [] +portal_configuration = [] +portal_session = [] +quote = [] +subscription = [] +subscription_item = [] +subscription_schedule = [] +tax_id = [] +test_clock = [] +usage_record = [] +usage_record_summary = [] + +full = ["credit_note", +"credit_note_line_item", +"invoice", +"invoice_item", +"invoice_line_item", +"plan", +"portal_configuration", +"portal_session", +"quote", +"subscription", +"subscription_item", +"subscription_schedule", +"tax_id", +"test_clock", +"usage_record", +"usage_record_summary"] + diff --git a/generated/stripe_billing/src/automatic_tax/mod.rs b/generated/stripe_billing/src/automatic_tax/mod.rs new file mode 100644 index 000000000..4989d2bd6 --- /dev/null +++ b/generated/stripe_billing/src/automatic_tax/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::automatic_tax::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/cancellation_details/mod.rs b/generated/stripe_billing/src/cancellation_details/mod.rs new file mode 100644 index 000000000..3ea9e9cca --- /dev/null +++ b/generated/stripe_billing/src/cancellation_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::cancellation_details::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/credit_note/mod.rs b/generated/stripe_billing/src/credit_note/mod.rs new file mode 100644 index 000000000..c841eb7b1 --- /dev/null +++ b/generated/stripe_billing/src/credit_note/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::credit_note::*; +#[cfg(feature = "credit_note")] +mod requests; +#[cfg(feature = "credit_note")] +pub use requests::*; diff --git a/generated/stripe_billing/src/credit_note/requests.rs b/generated/stripe_billing/src/credit_note/requests.rs new file mode 100644 index 000000000..7876aeba5 --- /dev/null +++ b/generated/stripe_billing/src/credit_note/requests.rs @@ -0,0 +1,981 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCreditNote<'a> { + /// The integer amount in cents (or local equivalent) representing the total amount of the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub credit_amount: Option, + /// The date when this credit note is in effect. + /// + /// Same as `created` unless overwritten. + /// When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_at: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// ID of the invoice. + pub invoice: &'a str, + /// Line items that make up the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub lines: Option<&'a [CreateCreditNoteLines<'a>]>, + /// The credit note's memo appears on the credit note PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub memo: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. + #[serde(skip_serializing_if = "Option::is_none")] + pub out_of_band_amount: Option, + /// Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// ID of an existing refund to link this credit note to. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund: Option<&'a str>, + /// The integer amount in cents (or local equivalent) representing the amount to refund. + /// + /// If set, a refund will be created for the charge associated with the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_amount: Option, + /// When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_cost: Option>, +} +impl<'a> CreateCreditNote<'a> { + pub fn new(invoice: &'a str) -> Self { + Self { + amount: Default::default(), + credit_amount: Default::default(), + effective_at: Default::default(), + expand: Default::default(), + invoice, + lines: Default::default(), + memo: Default::default(), + metadata: Default::default(), + out_of_band_amount: Default::default(), + reason: Default::default(), + refund: Default::default(), + refund_amount: Default::default(), + shipping_cost: Default::default(), + } + } +} +/// Line items that make up the credit note. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCreditNoteLines<'a> { + /// The line item amount to credit. + /// + /// Only valid when `type` is `invoice_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The description of the credit note line item. + /// + /// Only valid when the `type` is `custom_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The invoice line item to credit. + /// + /// Only valid when the `type` is `invoice_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_line_item: Option<&'a str>, + /// The line item quantity to credit. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of up to 10 tax amounts for the credit note line item. + /// + /// Cannot be mixed with `tax_rates`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_amounts: Option<&'a [CreateCreditNoteLinesTaxAmounts<'a>]>, + /// The tax rates which apply to the credit note line item. + /// + /// Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, + /// Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. + #[serde(rename = "type")] + pub type_: CreateCreditNoteLinesType, + /// The integer unit amount in cents (or local equivalent) of the credit note line item. + /// + /// This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. + /// Only valid when `type` is `custom_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateCreditNoteLines<'a> { + pub fn new(type_: CreateCreditNoteLinesType) -> Self { + Self { + amount: Default::default(), + description: Default::default(), + invoice_line_item: Default::default(), + quantity: Default::default(), + tax_amounts: Default::default(), + tax_rates: Default::default(), + type_, + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// A list of up to 10 tax amounts for the credit note line item. +/// +/// Cannot be mixed with `tax_rates`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCreditNoteLinesTaxAmounts<'a> { + /// The amount, in cents (or local equivalent), of the tax. + pub amount: i64, + /// The id of the tax rate for this tax amount. + /// + /// The tax rate must have been automatically created by Stripe. + pub tax_rate: &'a str, + /// The amount on which tax is calculated, in cents (or local equivalent). + pub taxable_amount: i64, +} +impl<'a> CreateCreditNoteLinesTaxAmounts<'a> { + pub fn new(amount: i64, tax_rate: &'a str, taxable_amount: i64) -> Self { + Self { amount, tax_rate, taxable_amount } + } +} +/// Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCreditNoteLinesType { + CustomLineItem, + InvoiceLineItem, +} +impl CreateCreditNoteLinesType { + pub fn as_str(self) -> &'static str { + use CreateCreditNoteLinesType::*; + match self { + CustomLineItem => "custom_line_item", + InvoiceLineItem => "invoice_line_item", + } + } +} + +impl std::str::FromStr for CreateCreditNoteLinesType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCreditNoteLinesType::*; + match s { + "custom_line_item" => Ok(CustomLineItem), + "invoice_line_item" => Ok(InvoiceLineItem), + _ => Err(()), + } + } +} +impl AsRef for CreateCreditNoteLinesType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateCreditNoteLinesType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCreditNoteLinesType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCreditNoteLinesType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCreditNoteReason { + Duplicate, + Fraudulent, + OrderChange, + ProductUnsatisfactory, +} +impl CreateCreditNoteReason { + pub fn as_str(self) -> &'static str { + use CreateCreditNoteReason::*; + match self { + Duplicate => "duplicate", + Fraudulent => "fraudulent", + OrderChange => "order_change", + ProductUnsatisfactory => "product_unsatisfactory", + } + } +} + +impl std::str::FromStr for CreateCreditNoteReason { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCreditNoteReason::*; + match s { + "duplicate" => Ok(Duplicate), + "fraudulent" => Ok(Fraudulent), + "order_change" => Ok(OrderChange), + "product_unsatisfactory" => Ok(ProductUnsatisfactory), + _ => Err(()), + } + } +} +impl AsRef for CreateCreditNoteReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateCreditNoteReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCreditNoteReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCreditNoteReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCreditNoteShippingCost<'a> { + /// The ID of the shipping rate to use for this order. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option<&'a str>, +} +impl<'a> CreateCreditNoteShippingCost<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateCreditNote<'a> { + /// Issue a credit note to adjust the amount of a finalized invoice. + /// + /// For a `status=open` invoice, a credit note reduces its `amount_due`. + /// For a `status=paid` invoice, a credit note does not affect its `amount_due`. + /// Instead, it can result in any combination of the following:
  • Refund: create a new refund (using `refund_amount`) or link an existing refund (using `refund`).
  • Customer balance credit: credit the customer’s balance (using `credit_amount`) which will be automatically applied to their next invoice when it’s finalized.
  • Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using `out_of_band_amount`).
For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total. You may issue multiple credit notes for an invoice. + /// Each credit note will increment the invoice’s `pre_payment_credit_notes_amount` or `post_payment_credit_notes_amount` depending on its `status` at the time of credit note creation. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/credit_notes", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct PreviewCreditNote<'a> { + /// The integer amount in cents (or local equivalent) representing the total amount of the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub credit_amount: Option, + /// The date when this credit note is in effect. + /// + /// Same as `created` unless overwritten. + /// When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_at: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// ID of the invoice. + pub invoice: &'a str, + /// Line items that make up the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub lines: Option<&'a [PreviewCreditNoteLines<'a>]>, + /// The credit note's memo appears on the credit note PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub memo: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. + #[serde(skip_serializing_if = "Option::is_none")] + pub out_of_band_amount: Option, + /// Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// ID of an existing refund to link this credit note to. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund: Option<&'a str>, + /// The integer amount in cents (or local equivalent) representing the amount to refund. + /// + /// If set, a refund will be created for the charge associated with the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_amount: Option, + /// When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_cost: Option>, +} +impl<'a> PreviewCreditNote<'a> { + pub fn new(invoice: &'a str) -> Self { + Self { + amount: Default::default(), + credit_amount: Default::default(), + effective_at: Default::default(), + expand: Default::default(), + invoice, + lines: Default::default(), + memo: Default::default(), + metadata: Default::default(), + out_of_band_amount: Default::default(), + reason: Default::default(), + refund: Default::default(), + refund_amount: Default::default(), + shipping_cost: Default::default(), + } + } +} +/// Line items that make up the credit note. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct PreviewCreditNoteLines<'a> { + /// The line item amount to credit. + /// + /// Only valid when `type` is `invoice_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The description of the credit note line item. + /// + /// Only valid when the `type` is `custom_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The invoice line item to credit. + /// + /// Only valid when the `type` is `invoice_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_line_item: Option<&'a str>, + /// The line item quantity to credit. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of up to 10 tax amounts for the credit note line item. + /// + /// Cannot be mixed with `tax_rates`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_amounts: Option<&'a [PreviewCreditNoteLinesTaxAmounts<'a>]>, + /// The tax rates which apply to the credit note line item. + /// + /// Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, + /// Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. + #[serde(rename = "type")] + pub type_: PreviewCreditNoteLinesType, + /// The integer unit amount in cents (or local equivalent) of the credit note line item. + /// + /// This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. + /// Only valid when `type` is `custom_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> PreviewCreditNoteLines<'a> { + pub fn new(type_: PreviewCreditNoteLinesType) -> Self { + Self { + amount: Default::default(), + description: Default::default(), + invoice_line_item: Default::default(), + quantity: Default::default(), + tax_amounts: Default::default(), + tax_rates: Default::default(), + type_, + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// A list of up to 10 tax amounts for the credit note line item. +/// +/// Cannot be mixed with `tax_rates`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct PreviewCreditNoteLinesTaxAmounts<'a> { + /// The amount, in cents (or local equivalent), of the tax. + pub amount: i64, + /// The id of the tax rate for this tax amount. + /// + /// The tax rate must have been automatically created by Stripe. + pub tax_rate: &'a str, + /// The amount on which tax is calculated, in cents (or local equivalent). + pub taxable_amount: i64, +} +impl<'a> PreviewCreditNoteLinesTaxAmounts<'a> { + pub fn new(amount: i64, tax_rate: &'a str, taxable_amount: i64) -> Self { + Self { amount, tax_rate, taxable_amount } + } +} +/// Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PreviewCreditNoteLinesType { + CustomLineItem, + InvoiceLineItem, +} +impl PreviewCreditNoteLinesType { + pub fn as_str(self) -> &'static str { + use PreviewCreditNoteLinesType::*; + match self { + CustomLineItem => "custom_line_item", + InvoiceLineItem => "invoice_line_item", + } + } +} + +impl std::str::FromStr for PreviewCreditNoteLinesType { + type Err = (); + fn from_str(s: &str) -> Result { + use PreviewCreditNoteLinesType::*; + match s { + "custom_line_item" => Ok(CustomLineItem), + "invoice_line_item" => Ok(InvoiceLineItem), + _ => Err(()), + } + } +} +impl AsRef for PreviewCreditNoteLinesType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PreviewCreditNoteLinesType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PreviewCreditNoteLinesType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PreviewCreditNoteLinesType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PreviewCreditNoteReason { + Duplicate, + Fraudulent, + OrderChange, + ProductUnsatisfactory, +} +impl PreviewCreditNoteReason { + pub fn as_str(self) -> &'static str { + use PreviewCreditNoteReason::*; + match self { + Duplicate => "duplicate", + Fraudulent => "fraudulent", + OrderChange => "order_change", + ProductUnsatisfactory => "product_unsatisfactory", + } + } +} + +impl std::str::FromStr for PreviewCreditNoteReason { + type Err = (); + fn from_str(s: &str) -> Result { + use PreviewCreditNoteReason::*; + match s { + "duplicate" => Ok(Duplicate), + "fraudulent" => Ok(Fraudulent), + "order_change" => Ok(OrderChange), + "product_unsatisfactory" => Ok(ProductUnsatisfactory), + _ => Err(()), + } + } +} +impl AsRef for PreviewCreditNoteReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PreviewCreditNoteReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PreviewCreditNoteReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PreviewCreditNoteReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PreviewCreditNoteShippingCost<'a> { + /// The ID of the shipping rate to use for this order. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option<&'a str>, +} +impl<'a> PreviewCreditNoteShippingCost<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> PreviewCreditNote<'a> { + /// Get a preview of a credit note without creating it. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.get_query("/credit_notes/preview", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCreditNote<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCreditNote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCreditNote<'a> { + /// Retrieves the credit note object with the given identifier. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_types::credit_note::CreditNoteId, + ) -> stripe::Response { + client.get_query(&format!("/credit_notes/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCreditNote<'a> { + /// Only return credit notes for the customer specified by this customer ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Only return credit notes for the invoice specified by this invoice ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice: Option<&'a str>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListCreditNote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCreditNote<'a> { + /// Returns a list of credit notes. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/credit_notes", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/credit_notes", self) + } +} +impl<'a> stripe::PaginationParams for ListCreditNote<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCreditNote<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Credit note memo. + #[serde(skip_serializing_if = "Option::is_none")] + pub memo: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateCreditNote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateCreditNote<'a> { + /// Updates an existing credit note. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_types::credit_note::CreditNoteId, + ) -> stripe::Response { + client.send_form(&format!("/credit_notes/{id}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct VoidCreditNoteCreditNote<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> VoidCreditNoteCreditNote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> VoidCreditNoteCreditNote<'a> { + /// Marks a credit note as void. + /// + /// Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_types::credit_note::CreditNoteId, + ) -> stripe::Response { + client.send_form(&format!("/credit_notes/{id}/void"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct PreviewLinesCreditNote<'a> { + /// The integer amount in cents (or local equivalent) representing the total amount of the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub credit_amount: Option, + /// The date when this credit note is in effect. + /// + /// Same as `created` unless overwritten. + /// When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_at: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// ID of the invoice. + pub invoice: &'a str, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Line items that make up the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub lines: Option<&'a [PreviewLinesCreditNoteLines<'a>]>, + /// The credit note's memo appears on the credit note PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub memo: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. + #[serde(skip_serializing_if = "Option::is_none")] + pub out_of_band_amount: Option, + /// Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// ID of an existing refund to link this credit note to. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund: Option<&'a str>, + /// The integer amount in cents (or local equivalent) representing the amount to refund. + /// + /// If set, a refund will be created for the charge associated with the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_amount: Option, + /// When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_cost: Option>, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> PreviewLinesCreditNote<'a> { + pub fn new(invoice: &'a str) -> Self { + Self { + amount: Default::default(), + credit_amount: Default::default(), + effective_at: Default::default(), + ending_before: Default::default(), + expand: Default::default(), + invoice, + limit: Default::default(), + lines: Default::default(), + memo: Default::default(), + metadata: Default::default(), + out_of_band_amount: Default::default(), + reason: Default::default(), + refund: Default::default(), + refund_amount: Default::default(), + shipping_cost: Default::default(), + starting_after: Default::default(), + } + } +} +/// Line items that make up the credit note. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct PreviewLinesCreditNoteLines<'a> { + /// The line item amount to credit. + /// + /// Only valid when `type` is `invoice_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The description of the credit note line item. + /// + /// Only valid when the `type` is `custom_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The invoice line item to credit. + /// + /// Only valid when the `type` is `invoice_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_line_item: Option<&'a str>, + /// The line item quantity to credit. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of up to 10 tax amounts for the credit note line item. + /// + /// Cannot be mixed with `tax_rates`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_amounts: Option<&'a [PreviewLinesCreditNoteLinesTaxAmounts<'a>]>, + /// The tax rates which apply to the credit note line item. + /// + /// Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, + /// Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. + #[serde(rename = "type")] + pub type_: PreviewLinesCreditNoteLinesType, + /// The integer unit amount in cents (or local equivalent) of the credit note line item. + /// + /// This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. + /// Only valid when `type` is `custom_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> PreviewLinesCreditNoteLines<'a> { + pub fn new(type_: PreviewLinesCreditNoteLinesType) -> Self { + Self { + amount: Default::default(), + description: Default::default(), + invoice_line_item: Default::default(), + quantity: Default::default(), + tax_amounts: Default::default(), + tax_rates: Default::default(), + type_, + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// A list of up to 10 tax amounts for the credit note line item. +/// +/// Cannot be mixed with `tax_rates`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct PreviewLinesCreditNoteLinesTaxAmounts<'a> { + /// The amount, in cents (or local equivalent), of the tax. + pub amount: i64, + /// The id of the tax rate for this tax amount. + /// + /// The tax rate must have been automatically created by Stripe. + pub tax_rate: &'a str, + /// The amount on which tax is calculated, in cents (or local equivalent). + pub taxable_amount: i64, +} +impl<'a> PreviewLinesCreditNoteLinesTaxAmounts<'a> { + pub fn new(amount: i64, tax_rate: &'a str, taxable_amount: i64) -> Self { + Self { amount, tax_rate, taxable_amount } + } +} +/// Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PreviewLinesCreditNoteLinesType { + CustomLineItem, + InvoiceLineItem, +} +impl PreviewLinesCreditNoteLinesType { + pub fn as_str(self) -> &'static str { + use PreviewLinesCreditNoteLinesType::*; + match self { + CustomLineItem => "custom_line_item", + InvoiceLineItem => "invoice_line_item", + } + } +} + +impl std::str::FromStr for PreviewLinesCreditNoteLinesType { + type Err = (); + fn from_str(s: &str) -> Result { + use PreviewLinesCreditNoteLinesType::*; + match s { + "custom_line_item" => Ok(CustomLineItem), + "invoice_line_item" => Ok(InvoiceLineItem), + _ => Err(()), + } + } +} +impl AsRef for PreviewLinesCreditNoteLinesType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PreviewLinesCreditNoteLinesType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PreviewLinesCreditNoteLinesType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PreviewLinesCreditNoteLinesType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PreviewLinesCreditNoteReason { + Duplicate, + Fraudulent, + OrderChange, + ProductUnsatisfactory, +} +impl PreviewLinesCreditNoteReason { + pub fn as_str(self) -> &'static str { + use PreviewLinesCreditNoteReason::*; + match self { + Duplicate => "duplicate", + Fraudulent => "fraudulent", + OrderChange => "order_change", + ProductUnsatisfactory => "product_unsatisfactory", + } + } +} + +impl std::str::FromStr for PreviewLinesCreditNoteReason { + type Err = (); + fn from_str(s: &str) -> Result { + use PreviewLinesCreditNoteReason::*; + match s { + "duplicate" => Ok(Duplicate), + "fraudulent" => Ok(Fraudulent), + "order_change" => Ok(OrderChange), + "product_unsatisfactory" => Ok(ProductUnsatisfactory), + _ => Err(()), + } + } +} +impl AsRef for PreviewLinesCreditNoteReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PreviewLinesCreditNoteReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PreviewLinesCreditNoteReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PreviewLinesCreditNoteReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PreviewLinesCreditNoteShippingCost<'a> { + /// The ID of the shipping rate to use for this order. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option<&'a str>, +} +impl<'a> PreviewLinesCreditNoteShippingCost<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> PreviewLinesCreditNote<'a> { + /// When retrieving a credit note preview, you’ll get a **lines** property containing the first handful of those items. + /// + /// This URL you can retrieve the full (paginated) list of line items. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/credit_notes/preview/lines", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/credit_notes/preview/lines", self) + } +} +impl<'a> stripe::PaginationParams for PreviewLinesCreditNote<'a> {} diff --git a/generated/stripe_billing/src/credit_note_line_item/mod.rs b/generated/stripe_billing/src/credit_note_line_item/mod.rs new file mode 100644 index 000000000..1dd648d2e --- /dev/null +++ b/generated/stripe_billing/src/credit_note_line_item/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::credit_note_line_item::*; +#[cfg(feature = "credit_note_line_item")] +mod requests; +#[cfg(feature = "credit_note_line_item")] +pub use requests::*; diff --git a/generated/stripe_billing/src/credit_note_line_item/requests.rs b/generated/stripe_billing/src/credit_note_line_item/requests.rs new file mode 100644 index 000000000..8cedb2517 --- /dev/null +++ b/generated/stripe_billing/src/credit_note_line_item/requests.rs @@ -0,0 +1,47 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCreditNoteLineItem<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListCreditNoteLineItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCreditNoteLineItem<'a> { + /// When retrieving a credit note, you’ll get a **lines** property containing the the first handful of those items. + /// + /// There is also a URL where you can retrieve the full (paginated) list of line items. + pub fn send( + &self, + client: &stripe::Client, + credit_note: &stripe_types::credit_note::CreditNoteId, + ) -> stripe::Response> { + client.get_query(&format!("/credit_notes/{credit_note}/lines"), self) + } + pub fn paginate( + self, + credit_note: &stripe_types::credit_note::CreditNoteId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params(&format!("/credit_notes/{credit_note}/lines"), self) + } +} +impl<'a> stripe::PaginationParams for ListCreditNoteLineItem<'a> {} diff --git a/generated/stripe_billing/src/credit_note_tax_amount/mod.rs b/generated/stripe_billing/src/credit_note_tax_amount/mod.rs new file mode 100644 index 000000000..dde35b43d --- /dev/null +++ b/generated/stripe_billing/src/credit_note_tax_amount/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::credit_note_tax_amount::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/deleted_invoice/mod.rs b/generated/stripe_billing/src/deleted_invoice/mod.rs new file mode 100644 index 000000000..2f52bfaaf --- /dev/null +++ b/generated/stripe_billing/src/deleted_invoice/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::deleted_invoice::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/deleted_invoice_item/mod.rs b/generated/stripe_billing/src/deleted_invoice_item/mod.rs new file mode 100644 index 000000000..fcb1c997f --- /dev/null +++ b/generated/stripe_billing/src/deleted_invoice_item/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::deleted_invoice_item::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/deleted_plan/mod.rs b/generated/stripe_billing/src/deleted_plan/mod.rs new file mode 100644 index 000000000..936946ff9 --- /dev/null +++ b/generated/stripe_billing/src/deleted_plan/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::deleted_plan::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/deleted_subscription_item/mod.rs b/generated/stripe_billing/src/deleted_subscription_item/mod.rs new file mode 100644 index 000000000..2db031820 --- /dev/null +++ b/generated/stripe_billing/src/deleted_subscription_item/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::deleted_subscription_item::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/deleted_tax_id/mod.rs b/generated/stripe_billing/src/deleted_tax_id/mod.rs new file mode 100644 index 000000000..34e36c785 --- /dev/null +++ b/generated/stripe_billing/src/deleted_tax_id/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::deleted_tax_id::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/deleted_test_clock/mod.rs b/generated/stripe_billing/src/deleted_test_clock/mod.rs new file mode 100644 index 000000000..af0514ad2 --- /dev/null +++ b/generated/stripe_billing/src/deleted_test_clock/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::deleted_test_clock::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/discounts_resource_discount_amount/mod.rs b/generated/stripe_billing/src/discounts_resource_discount_amount/mod.rs new file mode 100644 index 000000000..a45ae575d --- /dev/null +++ b/generated/stripe_billing/src/discounts_resource_discount_amount/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::discounts_resource_discount_amount::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice/mod.rs b/generated/stripe_billing/src/invoice/mod.rs new file mode 100644 index 000000000..7dea175fe --- /dev/null +++ b/generated/stripe_billing/src/invoice/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::invoice::*; +#[cfg(feature = "invoice")] +mod requests; +#[cfg(feature = "invoice")] +pub use requests::*; diff --git a/generated/stripe_billing/src/invoice/requests.rs b/generated/stripe_billing/src/invoice/requests.rs new file mode 100644 index 000000000..371176e8a --- /dev/null +++ b/generated/stripe_billing/src/invoice/requests.rs @@ -0,0 +1,6950 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SearchInvoice<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for pagination across multiple pages of results. + /// + /// Don't include this parameter on the first call. + /// Use the next_page value returned in a previous response to request subsequent results. + #[serde(skip_serializing_if = "Option::is_none")] + pub page: Option<&'a str>, + /// The search query string. + /// + /// See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for invoices](https://stripe.com/docs/search#query-fields-for-invoices). + pub query: &'a str, +} +impl<'a> SearchInvoice<'a> { + pub fn new(query: &'a str) -> Self { + Self { + expand: Default::default(), + limit: Default::default(), + page: Default::default(), + query, + } + } +} +impl<'a> SearchInvoice<'a> { + /// Search for invoices you’ve previously created using Stripe’s [Search Query Language](https://stripe.com/docs/search#search-query-language). + /// Don’t use search in read-after-write flows where strict consistency is necessary. + /// + /// Under normal operating conditions, data is searchable in less than a minute. + /// Occasionally, propagation of new or updated data can be up to an hour behind during outages. + /// Search functionality is not available to merchants in India. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.get_query("/invoices/search", self) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SearchReturned { + pub data: Vec, + pub has_more: bool, + pub next_page: Option, + /// String representing the object's type. + /// + /// Objects of the same type share the same value. + pub object: SearchReturnedObject, + /// The total number of objects that match the query, only accurate up to 10,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub total_count: Option, + pub url: String, +} +/// String representing the object's type. +/// +/// Objects of the same type share the same value. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SearchReturnedObject { + SearchResult, +} +impl SearchReturnedObject { + pub fn as_str(self) -> &'static str { + use SearchReturnedObject::*; + match self { + SearchResult => "search_result", + } + } +} + +impl std::str::FromStr for SearchReturnedObject { + type Err = (); + fn from_str(s: &str) -> Result { + use SearchReturnedObject::*; + match s { + "search_result" => Ok(SearchResult), + _ => Err(()), + } + } +} +impl AsRef for SearchReturnedObject { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SearchReturnedObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SearchReturnedObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SearchReturnedObject { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SearchReturnedObject { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SearchReturnedObject")) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingInvoice<'a> { + /// Settings for automatic tax lookup for this invoice preview. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// The code of the coupon to apply. + /// + /// If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. + /// Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. + /// The invoice can be previewed without a coupon by passing this value as an empty string. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// The currency to preview this invoice in. + /// + /// Defaults to that of `customer` if not specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The identifier of the customer whose upcoming invoice you'd like to retrieve. + /// + /// If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Details about the customer you want to invoice or overrides for an existing customer. + /// + /// If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_details: Option>, + /// The coupons to redeem into discounts for the invoice preview. + /// + /// If not specified, inherits the discount from the customer or subscription. + /// This only works for coupons directly applied to the invoice. + /// To apply a coupon to a subscription, you must use the `coupon` parameter instead. + /// Pass an empty string to avoid inheriting any discounts. + /// To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [UpcomingInvoiceDiscounts<'a>]>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// List of invoice items to add or update in the upcoming invoice preview. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_items: Option<&'a [UpcomingInvoiceInvoiceItems<'a>]>, + /// The identifier of the schedule whose upcoming invoice you'd like to retrieve. + /// + /// Cannot be used with subscription or subscription fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub schedule: Option<&'a str>, + /// The identifier of the subscription for which you'd like to retrieve the upcoming invoice. + /// + /// If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. + /// If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription: Option<&'a str>, + /// For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). + /// + /// This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. + /// For existing subscriptions, the value can only be set to `now` or `unchanged`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_billing_cycle_anchor: Option, + /// Timestamp indicating when the subscription should be scheduled to cancel. + /// + /// Will prorate if within the current period and prorations have been enabled using `proration_behavior`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel_at: Option, + /// Boolean indicating whether this subscription should cancel at the end of the current period. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel_at_period_end: Option, + /// This simulates the subscription being canceled or expired immediately. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel_now: Option, + /// If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. + /// + /// The default tax rates will apply to any line item that does not have `tax_rates` set. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_default_tax_rates: Option<&'a [&'a str]>, + /// A list of up to 20 subscription items, each with an attached price. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_items: Option<&'a [UpcomingInvoiceSubscriptionItems<'a>]>, + /// 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. + /// + /// The default value is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_proration_behavior: Option, + /// If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. + /// + /// The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. + /// If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. + /// Also, `subscription_proration_behavior` cannot be set to 'none'. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_proration_date: Option, + /// For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_resume_at: Option, + /// Date a subscription is intended to start (can be future or past). + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_start_date: Option, + /// If provided, the invoice returned will preview updating or creating a subscription with that trial end. + /// + /// If set, one of `subscription_items` or `subscription` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_trial_end: Option, + /// Indicates if a plan's `trial_period_days` should be applied to the subscription. + /// + /// Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. + /// Setting this flag to `true` together with `subscription_trial_end` is not allowed. + /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_trial_from_plan: Option, +} +impl<'a> UpcomingInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings for automatic tax lookup for this invoice preview. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingInvoiceAutomaticTax { + /// Whether Stripe automatically computes tax on this invoice. + /// + /// Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + pub enabled: bool, +} +impl UpcomingInvoiceAutomaticTax { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Details about the customer you want to invoice or overrides for an existing customer. +/// +/// If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingInvoiceCustomerDetails<'a> { + /// The customer's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The customer's shipping information. + /// + /// Appears on invoices emailed to this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// Tax details about the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax: Option>, + /// The customer's tax exemption. + /// + /// One of `none`, `exempt`, or `reverse`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_exempt: Option, + /// The customer's tax IDs. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_ids: Option<&'a [UpcomingInvoiceCustomerDetailsTaxIds<'a>]>, +} +impl<'a> UpcomingInvoiceCustomerDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingInvoiceCustomerDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpcomingInvoiceCustomerDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's shipping information. +/// +/// Appears on invoices emailed to this customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingInvoiceCustomerDetailsShipping<'a> { + /// Customer shipping address. + pub address: UpcomingInvoiceCustomerDetailsShippingAddress<'a>, + /// Customer name. + pub name: &'a str, + /// Customer phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> UpcomingInvoiceCustomerDetailsShipping<'a> { + pub fn new(address: UpcomingInvoiceCustomerDetailsShippingAddress<'a>, name: &'a str) -> Self { + Self { address, name, phone: Default::default() } + } +} +/// Customer shipping address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingInvoiceCustomerDetailsShippingAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpcomingInvoiceCustomerDetailsShippingAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tax details about the customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingInvoiceCustomerDetailsTax<'a> { + /// A recent IP address of the customer used for tax reporting and tax location inference. + /// + /// Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. + /// We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_address: Option<&'a str>, +} +impl<'a> UpcomingInvoiceCustomerDetailsTax<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's tax exemption. +/// +/// One of `none`, `exempt`, or `reverse`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingInvoiceCustomerDetailsTaxExempt { + Exempt, + None, + Reverse, +} +impl UpcomingInvoiceCustomerDetailsTaxExempt { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceCustomerDetailsTaxExempt::*; + match self { + Exempt => "exempt", + None => "none", + Reverse => "reverse", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceCustomerDetailsTaxExempt { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceCustomerDetailsTaxExempt::*; + match s { + "exempt" => Ok(Exempt), + "none" => Ok(None), + "reverse" => Ok(Reverse), + _ => Err(()), + } + } +} +impl AsRef for UpcomingInvoiceCustomerDetailsTaxExempt { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpcomingInvoiceCustomerDetailsTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceCustomerDetailsTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceCustomerDetailsTaxExempt { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's tax IDs. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingInvoiceCustomerDetailsTaxIds<'a> { + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. + #[serde(rename = "type")] + pub type_: UpcomingInvoiceCustomerDetailsTaxIdsType, + /// Value of the tax ID. + pub value: &'a str, +} +impl<'a> UpcomingInvoiceCustomerDetailsTaxIds<'a> { + pub fn new(type_: UpcomingInvoiceCustomerDetailsTaxIdsType, value: &'a str) -> Self { + Self { type_, value } + } +} +/// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpcomingInvoiceCustomerDetailsTaxIdsType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpcomingInvoiceCustomerDetailsTaxIdsType { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceCustomerDetailsTaxIdsType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceCustomerDetailsTaxIdsType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceCustomerDetailsTaxIdsType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl AsRef for UpcomingInvoiceCustomerDetailsTaxIdsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpcomingInvoiceCustomerDetailsTaxIdsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceCustomerDetailsTaxIdsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceCustomerDetailsTaxIdsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The coupons to redeem into discounts for the invoice preview. +/// +/// If not specified, inherits the discount from the customer or subscription. +/// This only works for coupons directly applied to the invoice. +/// To apply a coupon to a subscription, you must use the `coupon` parameter instead. +/// Pass an empty string to avoid inheriting any discounts. +/// To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingInvoiceDiscounts<'a> { + /// ID of the coupon to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option<&'a str>, +} +impl<'a> UpcomingInvoiceDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// List of invoice items to add or update in the upcoming invoice preview. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingInvoiceInvoiceItems<'a> { + /// The integer amount in cents (or local equivalent) of previewed invoice item. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + /// Only applicable to new invoice items. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// An arbitrary string which you can attach to the invoice item. + /// + /// The description is displayed in the invoice for easy tracking. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Explicitly controls whether discounts apply to this invoice item. + /// + /// Defaults to true, except for negative invoice items. + #[serde(skip_serializing_if = "Option::is_none")] + pub discountable: Option, + /// The coupons to redeem into discounts for the invoice item in the preview. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [UpcomingInvoiceInvoiceItemsDiscounts<'a>]>, + /// The ID of the invoice item to update in preview. + /// + /// If not specified, a new invoice item will be added to the preview of the upcoming invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoiceitem: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The period associated with this invoice item. + /// + /// When set to different values, the period will be rendered on the invoice. + /// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. + /// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub period: Option, + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Non-negative integer. + /// + /// The quantity of units for the invoice item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// The tax rates that apply to the item. + /// + /// When set, any `default_tax_rates` do not apply to this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, + /// The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. + /// + /// This unit_amount will be multiplied by the quantity to get the full amount. + /// If you want to apply a credit to the customer's account, pass a negative unit_amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpcomingInvoiceInvoiceItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The coupons to redeem into discounts for the invoice item in the preview. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingInvoiceInvoiceItemsDiscounts<'a> { + /// ID of the coupon to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option<&'a str>, +} +impl<'a> UpcomingInvoiceInvoiceItemsDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The period associated with this invoice item. +/// +/// When set to different values, the period will be rendered on the invoice. +/// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. +/// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingInvoiceInvoiceItemsPeriod { + /// The end of the period, which must be greater than or equal to the start. + /// + /// This value is inclusive. + pub end: stripe_types::Timestamp, + /// The start of the period. + /// + /// This value is inclusive. + pub start: stripe_types::Timestamp, +} +impl UpcomingInvoiceInvoiceItemsPeriod { + pub fn new(end: stripe_types::Timestamp, start: stripe_types::Timestamp) -> Self { + Self { end, start } + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingInvoiceInvoiceItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpcomingInvoiceInvoiceItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { + currency, + product, + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingInvoiceInvoiceItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpcomingInvoiceInvoiceItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceInvoiceItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceInvoiceItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceInvoiceItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpcomingInvoiceInvoiceItemsPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpcomingInvoiceInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceInvoiceItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingInvoiceInvoiceItemsTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpcomingInvoiceInvoiceItemsTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceInvoiceItemsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceInvoiceItemsTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceInvoiceItemsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpcomingInvoiceInvoiceItemsTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpcomingInvoiceInvoiceItemsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceInvoiceItemsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceInvoiceItemsTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). +/// +/// This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. +/// For existing subscriptions, the value can only be set to `now` or `unchanged`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpcomingInvoiceSubscriptionBillingCycleAnchor { + Now, + Unchanged, + Timestamp(stripe_types::Timestamp), +} +/// A list of up to 20 subscription items, each with an attached price. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingInvoiceSubscriptionItems<'a> { + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// + /// When updating, pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Delete all usage for a given subscription item. + /// + /// Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + #[serde(skip_serializing_if = "Option::is_none")] + pub clear_usage: Option, + /// A flag that, if set to `true`, will delete the specified item. + #[serde(skip_serializing_if = "Option::is_none")] + pub deleted: Option, + /// Subscription item to update. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Plan ID for this item, as a string. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// The ID of the price object. + /// + /// When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// + /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. + /// When updating, pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpcomingInvoiceSubscriptionItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. +/// +/// When updating, pass an empty string to remove previously-defined thresholds. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingInvoiceSubscriptionItemsBillingThresholds { + /// 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)). + pub usage_gte: i64, +} +impl UpcomingInvoiceSubscriptionItemsBillingThresholds { + pub fn new(usage_gte: i64) -> Self { + Self { usage_gte } + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingInvoiceSubscriptionItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + pub recurring: UpcomingInvoiceSubscriptionItemsPriceDataRecurring, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpcomingInvoiceSubscriptionItemsPriceData<'a> { + pub fn new( + currency: stripe_types::Currency, + product: &'a str, + recurring: UpcomingInvoiceSubscriptionItemsPriceDataRecurring, + ) -> Self { + Self { + currency, + product, + recurring, + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingInvoiceSubscriptionItemsPriceDataRecurring { + /// Specifies billing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + pub interval: UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl UpcomingInvoiceSubscriptionItemsPriceDataRecurring { + pub fn new(interval: UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: Default::default() } + } +} +/// Specifies billing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingInvoiceSubscriptionItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpcomingInvoiceSubscriptionItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceSubscriptionItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceSubscriptionItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceSubscriptionItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpcomingInvoiceSubscriptionItemsPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpcomingInvoiceSubscriptionItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceSubscriptionItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceSubscriptionItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// The default value is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingInvoiceSubscriptionProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl UpcomingInvoiceSubscriptionProrationBehavior { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceSubscriptionProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceSubscriptionProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceSubscriptionProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpcomingInvoiceSubscriptionProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpcomingInvoiceSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceSubscriptionProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingInvoiceSubscriptionResumeAt { + Now, +} +impl UpcomingInvoiceSubscriptionResumeAt { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceSubscriptionResumeAt::*; + match self { + Now => "now", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceSubscriptionResumeAt { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceSubscriptionResumeAt::*; + match s { + "now" => Ok(Now), + _ => Err(()), + } + } +} +impl AsRef for UpcomingInvoiceSubscriptionResumeAt { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpcomingInvoiceSubscriptionResumeAt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceSubscriptionResumeAt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceSubscriptionResumeAt { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If provided, the invoice returned will preview updating or creating a subscription with that trial end. +/// +/// If set, one of `subscription_items` or `subscription` is required. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpcomingInvoiceSubscriptionTrialEnd { + Now, + Timestamp(stripe_types::Timestamp), +} +impl<'a> UpcomingInvoice<'a> { + /// At any time, you can preview the upcoming invoice for a customer. + /// + /// This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. + /// It will also show you any discounts that are applicable to the invoice. Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. + /// As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. + /// If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount. You can preview the effects of updating a subscription, including a preview of what proration will take place. + /// To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a `proration_date` parameter when doing the actual subscription update. + /// The value passed in should be the same as the `subscription_proration_date` returned on the upcoming invoice resource. + /// The recommended way to get only the prorations being previewed is to consider only proration line items where `period[start]` is equal to the `subscription_proration_date` on the upcoming invoice resource. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.get_query("/invoices/upcoming", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoice<'a> { + /// The account tax IDs associated with the invoice. + /// + /// Only editable when the invoice is a draft. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option<&'a [&'a str]>, + /// A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. + /// + /// The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. + /// For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_advance: Option, + /// Settings for automatic tax lookup for this invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// Either `charge_automatically` or `send_invoice`. + /// + /// This field can be updated only on `draft` invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// A list of up to 4 custom fields to be displayed on the invoice. + /// + /// If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. + /// Pass an empty string to remove previously-defined fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [UpdateInvoiceCustomFields<'a>]>, + /// The number of days from which the invoice is created until it is due. + /// + /// Only valid for invoices where `collection_method=send_invoice`. + /// This field can only be updated on `draft` invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, + /// ID of the default payment method for the invoice. + /// + /// It must belong to the customer associated with the invoice. + /// If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// ID of the default payment source for the invoice. + /// + /// It must belong to the customer associated with the invoice and be in a chargeable state. + /// If not set, defaults to the subscription's default source, if any, or to the customer's default source. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_source: Option<&'a str>, + /// The tax rates that will apply to any line item that does not have `tax_rates` set. + /// + /// Pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + /// Referenced as 'memo' in the Dashboard. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The discounts that will apply to the invoice. + /// + /// Pass an empty string to remove previously-defined discounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [UpdateInvoiceDiscounts<'a>]>, + /// The date on which payment for this invoice is due. + /// + /// Only valid for invoices where `collection_method=send_invoice`. + /// This field can only be updated on `draft` invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub due_date: Option, + /// The date when this invoice is in effect. + /// + /// Same as `finalized_at` unless overwritten. + /// When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_at: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Footer to be displayed on the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The account (if any) for which the funds of the invoice payment are intended. + /// + /// If set, the invoice will be presented with the branding and support information of the specified account. + /// See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// Configuration settings for the PaymentIntent that is generated when the invoice is finalized. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_settings: Option>, + /// The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering: Option, + /// This is a legacy field that will be removed soon. + /// + /// For details about `rendering_options`, refer to `rendering` instead. + /// Options for invoice PDF rendering. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering_options: Option, + /// Settings for the cost of shipping for this invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_cost: Option>, + /// Shipping details for the invoice. + /// + /// The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_details: Option>, + /// Extra information about a charge for the customer's credit card statement. + /// + /// It must contain at least one letter. + /// If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. + /// + /// This will be unset if you POST an empty value. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, +} +impl<'a> UpdateInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings for automatic tax lookup for this invoice. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceAutomaticTax { + /// Whether Stripe automatically computes tax on this invoice. + /// + /// Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + pub enabled: bool, +} +impl UpdateInvoiceAutomaticTax { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Either `charge_automatically` or `send_invoice`. +/// +/// This field can be updated only on `draft` invoices. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl UpdateInvoiceCollectionMethod { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for UpdateInvoiceCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoiceCollectionMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateInvoiceCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A list of up to 4 custom fields to be displayed on the invoice. +/// +/// If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. +/// Pass an empty string to remove previously-defined fields. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceCustomFields<'a> { + /// The name of the custom field. + /// + /// This may be up to 30 characters. + pub name: &'a str, + /// The value of the custom field. + /// + /// This may be up to 30 characters. + pub value: &'a str, +} +impl<'a> UpdateInvoiceCustomFields<'a> { + pub fn new(name: &'a str, value: &'a str) -> Self { + Self { name, value } + } +} +/// The discounts that will apply to the invoice. +/// +/// Pass an empty string to remove previously-defined discounts. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceDiscounts<'a> { + /// ID of the coupon to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option<&'a str>, +} +impl<'a> UpdateInvoiceDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration settings for the PaymentIntent that is generated when the invoice is finalized. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettings<'a> { + /// ID of the mandate to be used for this invoice. + /// + /// It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_mandate: Option<&'a str>, + /// Payment-method-specific configuration to provide to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The list of payment method types (e.g. + /// + /// card) to provide to the invoice’s PaymentIntent. + /// 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). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [UpdateInvoicePaymentSettingsPaymentMethodTypes]>, +} +impl<'a> UpdateInvoicePaymentSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Payment-method-specific configuration to provide to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptions<'a> { + /// If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + /// If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + /// If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: + Option>, + /// If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, +} +impl<'a> UpdateInvoicePaymentSettingsPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebit { + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Mandate creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: Option< + UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType, + >, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { + pub fn new() -> Self { + Self::default() + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl AsRef + for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr + for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: + Option, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr + for UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsCard { + /// Installment configuration for payments attempted on this invoice (Mexico Only). + /// + /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + #[serde(skip_serializing_if = "Option::is_none")] + pub installments: Option, + /// 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). + /// + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsCard { + pub fn new() -> Self { + Self::default() + } +} +/// Installment configuration for payments attempted on this invoice (Mexico Only). +/// +/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallments { + /// Setting to true enables installments for this invoice. + /// Setting to false will prevent any selected plan from applying to a payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// The selected installment plan to use for this invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallments { + pub fn new() -> Self { + Self::default() + } +} +/// The selected installment plan to use for this invoice. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan { + /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + pub count: u64, + /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + /// One of `month`. + pub interval: UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval, + /// Type of installment plan, one of `fixed_count`. + #[serde(rename = "type")] + pub type_: UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan { + pub fn new( + count: u64, + interval: UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval, + type_: UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType, + ) -> Self { + Self { count, interval, type_ } + } +} +/// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. +/// One of `month`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval { + Month, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match self { + Month => "month", + } + } +} + +impl std::str::FromStr + for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match s { + "month" => Ok(Month), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of installment plan, one of `fixed_count`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + FixedCount, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType::*; + match self { + FixedCount => "fixed_count", + } + } +} + +impl std::str::FromStr + for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType::*; + match s { + "fixed_count" => Ok(FixedCount), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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). +/// +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// 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. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + } + } +} + +impl std::str::FromStr for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalance<'a> { + /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: + Option>, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// + /// Permitted values include: `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub funding_type: Option<&'a str>, +} +impl<'a> UpdateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + /// Configuration for eu_bank_transfer funding type. + #[serde(skip_serializing_if = "Option::is_none")] + pub eu_bank_transfer: Option< + UpdateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer< + 'a, + >, + >, + /// The bank transfer type that can be used for funding. + /// + /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option<&'a str>, +} +impl<'a> UpdateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for eu_bank_transfer funding type. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer< + 'a, +> { + /// The desired country code of the bank account information. + /// + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: &'a str, +} +impl<'a> + UpdateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer<'a> +{ + pub fn new(country: &'a str) -> Self { + Self { country } + } +} +/// If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: Option< + UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a>, + >, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[serde(skip_serializing_if = "Option::is_none")] +pub permissions: Option<&'a [UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions]>, + /// List of data features that you would like to retrieve upon account creation. +#[serde(skip_serializing_if = "Option::is_none")] +pub prefetch: Option<&'a [UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch]>, + +} +impl<'a> UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl AsRef + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + } + } +} + +impl std::str::FromStr + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + _ => Err(()), + } + } +} +impl AsRef + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of payment method types (e.g. +/// +/// card) to provide to the invoice’s PaymentIntent. +/// 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). +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateInvoicePaymentSettingsPaymentMethodTypes { + AchCreditTransfer, + AchDebit, + AcssDebit, + AuBecsDebit, + BacsDebit, + Bancontact, + Boleto, + Card, + Cashapp, + CustomerBalance, + Fpx, + Giropay, + Grabpay, + Ideal, + Konbini, + Link, + Paynow, + Paypal, + Promptpay, + SepaCreditTransfer, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateInvoicePaymentSettingsPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodTypes::*; + match self { + AchCreditTransfer => "ach_credit_transfer", + AchDebit => "ach_debit", + AcssDebit => "acss_debit", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Konbini => "konbini", + Link => "link", + Paynow => "paynow", + Paypal => "paypal", + Promptpay => "promptpay", + SepaCreditTransfer => "sepa_credit_transfer", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateInvoicePaymentSettingsPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodTypes::*; + match s { + "ach_credit_transfer" => Ok(AchCreditTransfer), + "ach_debit" => Ok(AchDebit), + "acss_debit" => Ok(AcssDebit), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "promptpay" => Ok(Promptpay), + "sepa_credit_transfer" => Ok(SepaCreditTransfer), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoicePaymentSettingsPaymentMethodTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateInvoicePaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoicePaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoicePaymentSettingsPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceRendering { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: Option, + /// Invoice pdf rendering options. + #[serde(skip_serializing_if = "Option::is_none")] + pub pdf: Option, +} +impl UpdateInvoiceRendering { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceRenderingAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl UpdateInvoiceRenderingAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceRenderingAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr for UpdateInvoiceRenderingAmountTaxDisplay { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceRenderingAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoiceRenderingAmountTaxDisplay { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateInvoiceRenderingAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceRenderingAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceRenderingAmountTaxDisplay { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Invoice pdf rendering options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceRenderingPdf { + /// Page size for invoice PDF. + /// + /// Can be set to `a4`, `letter`, or `auto`. If set to `auto`, invoice PDF page size defaults to `a4` for customers with Japanese locale and `letter` for customers with other locales. + #[serde(skip_serializing_if = "Option::is_none")] + pub page_size: Option, +} +impl UpdateInvoiceRenderingPdf { + pub fn new() -> Self { + Self::default() + } +} +/// Page size for invoice PDF. +/// +/// Can be set to `a4`, `letter`, or `auto`. If set to `auto`, invoice PDF page size defaults to `a4` for customers with Japanese locale and `letter` for customers with other locales. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceRenderingPdfPageSize { + A4, + Auto, + Letter, +} +impl UpdateInvoiceRenderingPdfPageSize { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceRenderingPdfPageSize::*; + match self { + A4 => "a4", + Auto => "auto", + Letter => "letter", + } + } +} + +impl std::str::FromStr for UpdateInvoiceRenderingPdfPageSize { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceRenderingPdfPageSize::*; + match s { + "a4" => Ok(A4), + "auto" => Ok(Auto), + "letter" => Ok(Letter), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoiceRenderingPdfPageSize { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateInvoiceRenderingPdfPageSize { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceRenderingPdfPageSize { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceRenderingPdfPageSize { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This is a legacy field that will be removed soon. +/// +/// For details about `rendering_options`, refer to `rendering` instead. +/// Options for invoice PDF rendering. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceRenderingOptions { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: Option, +} +impl UpdateInvoiceRenderingOptions { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceRenderingOptionsAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl UpdateInvoiceRenderingOptionsAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceRenderingOptionsAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr for UpdateInvoiceRenderingOptionsAmountTaxDisplay { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceRenderingOptionsAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoiceRenderingOptionsAmountTaxDisplay { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateInvoiceRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceRenderingOptionsAmountTaxDisplay { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Settings for the cost of shipping for this invoice. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceShippingCost<'a> { + /// The ID of the shipping rate to use for this order. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option<&'a str>, + /// Parameters to create a new ad-hoc shipping rate for this order. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate_data: Option>, +} +impl<'a> UpdateInvoiceShippingCost<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Parameters to create a new ad-hoc shipping rate for this order. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceShippingCostShippingRateData<'a> { + /// The estimated range for how long shipping will take, meant to be displayable to the customer. + /// + /// This will appear on CheckoutSessions. + #[serde(skip_serializing_if = "Option::is_none")] + pub delivery_estimate: Option, + /// The name of the shipping rate, meant to be displayable to the customer. + /// + /// This will appear on CheckoutSessions. + pub display_name: &'a str, + /// Describes a fixed amount to charge for shipping. + /// + /// Must be present if type is `fixed_amount`. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amount: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + /// + /// The Shipping tax code is `txcd_92010001`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// The type of calculation to use on the shipping rate. + /// + /// Can only be `fixed_amount` for now. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> UpdateInvoiceShippingCostShippingRateData<'a> { + pub fn new(display_name: &'a str) -> Self { + Self { + delivery_estimate: Default::default(), + display_name, + fixed_amount: Default::default(), + metadata: Default::default(), + tax_behavior: Default::default(), + tax_code: Default::default(), + type_: Default::default(), + } + } +} +/// The estimated range for how long shipping will take, meant to be displayable to the customer. +/// +/// This will appear on CheckoutSessions. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceShippingCostShippingRateDataDeliveryEstimate { + /// The upper bound of the estimated range. + /// + /// If empty, represents no upper bound i.e., infinite. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option, + /// The lower bound of the estimated range. + /// + /// If empty, represents no lower bound. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option, +} +impl UpdateInvoiceShippingCostShippingRateDataDeliveryEstimate { + pub fn new() -> Self { + Self::default() + } +} +/// The upper bound of the estimated range. +/// +/// If empty, represents no upper bound i.e., infinite. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximum { + /// A unit of time. + pub unit: UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit, + /// Must be greater than 0. + pub value: i64, +} +impl UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximum { + pub fn new( + unit: UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit, + value: i64, + ) -> Self { + Self { unit, value } + } +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The lower bound of the estimated range. +/// +/// If empty, represents no lower bound. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimum { + /// A unit of time. + pub unit: UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit, + /// Must be greater than 0. + pub value: i64, +} +impl UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimum { + pub fn new( + unit: UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit, + value: i64, + ) -> Self { + Self { unit, value } + } +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Describes a fixed amount to charge for shipping. +/// +/// Must be present if type is `fixed_amount`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceShippingCostShippingRateDataFixedAmount<'a> { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Shipping rates defined in each available currency option. + /// + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + &'a std::collections::HashMap< + stripe_types::Currency, + UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptions, + >, + >, +} +impl<'a> UpdateInvoiceShippingCostShippingRateDataFixedAmount<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { amount, currency, currency_options: Default::default() } + } +} +/// Shipping rates defined in each available currency option. +/// +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptions { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: + Option, +} +impl UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptions { + pub fn new(amount: i64) -> Self { + Self { amount, tax_behavior: Default::default() } + } +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr + for UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceShippingCostShippingRateDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateInvoiceShippingCostShippingRateDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceShippingCostShippingRateDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateInvoiceShippingCostShippingRateDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceShippingCostShippingRateDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoiceShippingCostShippingRateDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateInvoiceShippingCostShippingRateDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceShippingCostShippingRateDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceShippingCostShippingRateDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of calculation to use on the shipping rate. +/// +/// Can only be `fixed_amount` for now. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceShippingCostShippingRateDataType { + FixedAmount, +} +impl UpdateInvoiceShippingCostShippingRateDataType { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceShippingCostShippingRateDataType::*; + match self { + FixedAmount => "fixed_amount", + } + } +} + +impl std::str::FromStr for UpdateInvoiceShippingCostShippingRateDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceShippingCostShippingRateDataType::*; + match s { + "fixed_amount" => Ok(FixedAmount), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoiceShippingCostShippingRateDataType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateInvoiceShippingCostShippingRateDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceShippingCostShippingRateDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceShippingCostShippingRateDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Shipping details for the invoice. +/// +/// The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceShippingDetails<'a> { + /// Shipping address. + pub address: UpdateInvoiceShippingDetailsAddress<'a>, + /// Recipient name. + pub name: &'a str, + /// Recipient phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> UpdateInvoiceShippingDetails<'a> { + pub fn new(address: UpdateInvoiceShippingDetailsAddress<'a>, name: &'a str) -> Self { + Self { address, name, phone: Default::default() } + } +} +/// Shipping address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceShippingDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateInvoiceShippingDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. +/// +/// This will be unset if you POST an empty value. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceTransferData<'a> { + /// The amount that will be transferred automatically when the invoice is paid. + /// + /// If no amount is set, the full amount is transferred. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> UpdateInvoiceTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount: Default::default(), destination } + } +} +impl<'a> UpdateInvoice<'a> { + /// Draft invoices are fully editable. + /// + /// Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized), monetary values, as well as `collection_method`, become uneditable. If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass `auto_advance=false`. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_types::invoice::InvoiceId, + ) -> stripe::Response { + client.send_form(&format!("/invoices/{invoice}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PayInvoice<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. + /// + /// This effectively forgives the difference between the amount available on the source and the amount due. + /// Passing `forgive=false` will fail the charge if the source hasn't been pre-funded with the right amount. + /// An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. + /// Defaults to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub forgive: Option, + /// ID of the mandate to be used for this invoice. + /// + /// It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate: Option<&'a str>, + /// Indicates if a customer is on or off-session while an invoice payment is attempted. + /// + /// Defaults to `true` (off-session). + #[serde(skip_serializing_if = "Option::is_none")] + pub off_session: Option, + /// Boolean representing whether an invoice is paid outside of Stripe. + /// + /// This will result in no charge being made. + /// Defaults to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub paid_out_of_band: Option, + /// A PaymentMethod to be charged. + /// + /// The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// A payment source to be charged. + /// + /// The source must be the ID of a source belonging to the customer associated with the invoice being paid. + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option<&'a str>, +} +impl<'a> PayInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> PayInvoice<'a> { + /// Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). + /// + /// However, if you’d like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_types::invoice::InvoiceId, + ) -> stripe::Response { + client.send_form(&format!("/invoices/{invoice}/pay"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingLinesInvoice<'a> { + /// Settings for automatic tax lookup for this invoice preview. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// The code of the coupon to apply. + /// + /// If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. + /// Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. + /// The invoice can be previewed without a coupon by passing this value as an empty string. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// The currency to preview this invoice in. + /// + /// Defaults to that of `customer` if not specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The identifier of the customer whose upcoming invoice you'd like to retrieve. + /// + /// If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Details about the customer you want to invoice or overrides for an existing customer. + /// + /// If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_details: Option>, + /// The coupons to redeem into discounts for the invoice preview. + /// + /// If not specified, inherits the discount from the customer or subscription. + /// This only works for coupons directly applied to the invoice. + /// To apply a coupon to a subscription, you must use the `coupon` parameter instead. + /// Pass an empty string to avoid inheriting any discounts. + /// To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [UpcomingLinesInvoiceDiscounts<'a>]>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// List of invoice items to add or update in the upcoming invoice preview. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_items: Option<&'a [UpcomingLinesInvoiceInvoiceItems<'a>]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// The identifier of the schedule whose upcoming invoice you'd like to retrieve. + /// + /// Cannot be used with subscription or subscription fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub schedule: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// The identifier of the subscription for which you'd like to retrieve the upcoming invoice. + /// + /// If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. + /// If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription: Option<&'a str>, + /// For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). + /// + /// This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. + /// For existing subscriptions, the value can only be set to `now` or `unchanged`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_billing_cycle_anchor: + Option, + /// Timestamp indicating when the subscription should be scheduled to cancel. + /// + /// Will prorate if within the current period and prorations have been enabled using `proration_behavior`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel_at: Option, + /// Boolean indicating whether this subscription should cancel at the end of the current period. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel_at_period_end: Option, + /// This simulates the subscription being canceled or expired immediately. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel_now: Option, + /// If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. + /// + /// The default tax rates will apply to any line item that does not have `tax_rates` set. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_default_tax_rates: Option<&'a [&'a str]>, + /// A list of up to 20 subscription items, each with an attached price. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_items: Option<&'a [UpcomingLinesInvoiceSubscriptionItems<'a>]>, + /// 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. + /// + /// The default value is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_proration_behavior: Option, + /// If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. + /// + /// The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. + /// If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. + /// Also, `subscription_proration_behavior` cannot be set to 'none'. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_proration_date: Option, + /// For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_resume_at: Option, + /// Date a subscription is intended to start (can be future or past). + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_start_date: Option, + /// If provided, the invoice returned will preview updating or creating a subscription with that trial end. + /// + /// If set, one of `subscription_items` or `subscription` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_trial_end: Option, + /// Indicates if a plan's `trial_period_days` should be applied to the subscription. + /// + /// Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. + /// Setting this flag to `true` together with `subscription_trial_end` is not allowed. + /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_trial_from_plan: Option, +} +impl<'a> UpcomingLinesInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings for automatic tax lookup for this invoice preview. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingLinesInvoiceAutomaticTax { + /// Whether Stripe automatically computes tax on this invoice. + /// + /// Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + pub enabled: bool, +} +impl UpcomingLinesInvoiceAutomaticTax { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Details about the customer you want to invoice or overrides for an existing customer. +/// +/// If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingLinesInvoiceCustomerDetails<'a> { + /// The customer's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The customer's shipping information. + /// + /// Appears on invoices emailed to this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// Tax details about the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax: Option>, + /// The customer's tax exemption. + /// + /// One of `none`, `exempt`, or `reverse`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_exempt: Option, + /// The customer's tax IDs. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_ids: Option<&'a [UpcomingLinesInvoiceCustomerDetailsTaxIds<'a>]>, +} +impl<'a> UpcomingLinesInvoiceCustomerDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingLinesInvoiceCustomerDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpcomingLinesInvoiceCustomerDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's shipping information. +/// +/// Appears on invoices emailed to this customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingLinesInvoiceCustomerDetailsShipping<'a> { + /// Customer shipping address. + pub address: UpcomingLinesInvoiceCustomerDetailsShippingAddress<'a>, + /// Customer name. + pub name: &'a str, + /// Customer phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> UpcomingLinesInvoiceCustomerDetailsShipping<'a> { + pub fn new( + address: UpcomingLinesInvoiceCustomerDetailsShippingAddress<'a>, + name: &'a str, + ) -> Self { + Self { address, name, phone: Default::default() } + } +} +/// Customer shipping address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingLinesInvoiceCustomerDetailsShippingAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpcomingLinesInvoiceCustomerDetailsShippingAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tax details about the customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingLinesInvoiceCustomerDetailsTax<'a> { + /// A recent IP address of the customer used for tax reporting and tax location inference. + /// + /// Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. + /// We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_address: Option<&'a str>, +} +impl<'a> UpcomingLinesInvoiceCustomerDetailsTax<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's tax exemption. +/// +/// One of `none`, `exempt`, or `reverse`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingLinesInvoiceCustomerDetailsTaxExempt { + Exempt, + None, + Reverse, +} +impl UpcomingLinesInvoiceCustomerDetailsTaxExempt { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceCustomerDetailsTaxExempt::*; + match self { + Exempt => "exempt", + None => "none", + Reverse => "reverse", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceCustomerDetailsTaxExempt { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceCustomerDetailsTaxExempt::*; + match s { + "exempt" => Ok(Exempt), + "none" => Ok(None), + "reverse" => Ok(Reverse), + _ => Err(()), + } + } +} +impl AsRef for UpcomingLinesInvoiceCustomerDetailsTaxExempt { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpcomingLinesInvoiceCustomerDetailsTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceCustomerDetailsTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceCustomerDetailsTaxExempt { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's tax IDs. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingLinesInvoiceCustomerDetailsTaxIds<'a> { + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. + #[serde(rename = "type")] + pub type_: UpcomingLinesInvoiceCustomerDetailsTaxIdsType, + /// Value of the tax ID. + pub value: &'a str, +} +impl<'a> UpcomingLinesInvoiceCustomerDetailsTaxIds<'a> { + pub fn new(type_: UpcomingLinesInvoiceCustomerDetailsTaxIdsType, value: &'a str) -> Self { + Self { type_, value } + } +} +/// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpcomingLinesInvoiceCustomerDetailsTaxIdsType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpcomingLinesInvoiceCustomerDetailsTaxIdsType { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceCustomerDetailsTaxIdsType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceCustomerDetailsTaxIdsType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceCustomerDetailsTaxIdsType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl AsRef for UpcomingLinesInvoiceCustomerDetailsTaxIdsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpcomingLinesInvoiceCustomerDetailsTaxIdsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceCustomerDetailsTaxIdsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceCustomerDetailsTaxIdsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The coupons to redeem into discounts for the invoice preview. +/// +/// If not specified, inherits the discount from the customer or subscription. +/// This only works for coupons directly applied to the invoice. +/// To apply a coupon to a subscription, you must use the `coupon` parameter instead. +/// Pass an empty string to avoid inheriting any discounts. +/// To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingLinesInvoiceDiscounts<'a> { + /// ID of the coupon to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option<&'a str>, +} +impl<'a> UpcomingLinesInvoiceDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// List of invoice items to add or update in the upcoming invoice preview. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingLinesInvoiceInvoiceItems<'a> { + /// The integer amount in cents (or local equivalent) of previewed invoice item. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + /// Only applicable to new invoice items. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// An arbitrary string which you can attach to the invoice item. + /// + /// The description is displayed in the invoice for easy tracking. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Explicitly controls whether discounts apply to this invoice item. + /// + /// Defaults to true, except for negative invoice items. + #[serde(skip_serializing_if = "Option::is_none")] + pub discountable: Option, + /// The coupons to redeem into discounts for the invoice item in the preview. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [UpcomingLinesInvoiceInvoiceItemsDiscounts<'a>]>, + /// The ID of the invoice item to update in preview. + /// + /// If not specified, a new invoice item will be added to the preview of the upcoming invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoiceitem: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The period associated with this invoice item. + /// + /// When set to different values, the period will be rendered on the invoice. + /// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. + /// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub period: Option, + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Non-negative integer. + /// + /// The quantity of units for the invoice item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// The tax rates that apply to the item. + /// + /// When set, any `default_tax_rates` do not apply to this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, + /// The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. + /// + /// This unit_amount will be multiplied by the quantity to get the full amount. + /// If you want to apply a credit to the customer's account, pass a negative unit_amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpcomingLinesInvoiceInvoiceItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The coupons to redeem into discounts for the invoice item in the preview. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingLinesInvoiceInvoiceItemsDiscounts<'a> { + /// ID of the coupon to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option<&'a str>, +} +impl<'a> UpcomingLinesInvoiceInvoiceItemsDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The period associated with this invoice item. +/// +/// When set to different values, the period will be rendered on the invoice. +/// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. +/// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingLinesInvoiceInvoiceItemsPeriod { + /// The end of the period, which must be greater than or equal to the start. + /// + /// This value is inclusive. + pub end: stripe_types::Timestamp, + /// The start of the period. + /// + /// This value is inclusive. + pub start: stripe_types::Timestamp, +} +impl UpcomingLinesInvoiceInvoiceItemsPeriod { + pub fn new(end: stripe_types::Timestamp, start: stripe_types::Timestamp) -> Self { + Self { end, start } + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingLinesInvoiceInvoiceItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpcomingLinesInvoiceInvoiceItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { + currency, + product, + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingLinesInvoiceInvoiceItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpcomingLinesInvoiceInvoiceItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceInvoiceItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceInvoiceItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceInvoiceItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpcomingLinesInvoiceInvoiceItemsPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpcomingLinesInvoiceInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceInvoiceItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingLinesInvoiceInvoiceItemsTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpcomingLinesInvoiceInvoiceItemsTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceInvoiceItemsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceInvoiceItemsTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceInvoiceItemsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpcomingLinesInvoiceInvoiceItemsTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpcomingLinesInvoiceInvoiceItemsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceInvoiceItemsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceInvoiceItemsTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). +/// +/// This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. +/// For existing subscriptions, the value can only be set to `now` or `unchanged`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpcomingLinesInvoiceSubscriptionBillingCycleAnchor { + Now, + Unchanged, + Timestamp(stripe_types::Timestamp), +} +/// A list of up to 20 subscription items, each with an attached price. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingLinesInvoiceSubscriptionItems<'a> { + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// + /// When updating, pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Delete all usage for a given subscription item. + /// + /// Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + #[serde(skip_serializing_if = "Option::is_none")] + pub clear_usage: Option, + /// A flag that, if set to `true`, will delete the specified item. + #[serde(skip_serializing_if = "Option::is_none")] + pub deleted: Option, + /// Subscription item to update. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Plan ID for this item, as a string. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// The ID of the price object. + /// + /// When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// + /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. + /// When updating, pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpcomingLinesInvoiceSubscriptionItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. +/// +/// When updating, pass an empty string to remove previously-defined thresholds. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingLinesInvoiceSubscriptionItemsBillingThresholds { + /// 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)). + pub usage_gte: i64, +} +impl UpcomingLinesInvoiceSubscriptionItemsBillingThresholds { + pub fn new(usage_gte: i64) -> Self { + Self { usage_gte } + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingLinesInvoiceSubscriptionItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + pub recurring: UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurring, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpcomingLinesInvoiceSubscriptionItemsPriceData<'a> { + pub fn new( + currency: stripe_types::Currency, + product: &'a str, + recurring: UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurring, + ) -> Self { + Self { + currency, + product, + recurring, + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurring { + /// Specifies billing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + pub interval: UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurring { + pub fn new(interval: UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: Default::default() } + } +} +/// Specifies billing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingLinesInvoiceSubscriptionItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpcomingLinesInvoiceSubscriptionItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceSubscriptionItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceSubscriptionItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceSubscriptionItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpcomingLinesInvoiceSubscriptionItemsPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpcomingLinesInvoiceSubscriptionItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceSubscriptionItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceSubscriptionItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// The default value is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingLinesInvoiceSubscriptionProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl UpcomingLinesInvoiceSubscriptionProrationBehavior { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceSubscriptionProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceSubscriptionProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceSubscriptionProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpcomingLinesInvoiceSubscriptionProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpcomingLinesInvoiceSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceSubscriptionProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingLinesInvoiceSubscriptionResumeAt { + Now, +} +impl UpcomingLinesInvoiceSubscriptionResumeAt { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceSubscriptionResumeAt::*; + match self { + Now => "now", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceSubscriptionResumeAt { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceSubscriptionResumeAt::*; + match s { + "now" => Ok(Now), + _ => Err(()), + } + } +} +impl AsRef for UpcomingLinesInvoiceSubscriptionResumeAt { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpcomingLinesInvoiceSubscriptionResumeAt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceSubscriptionResumeAt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceSubscriptionResumeAt { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If provided, the invoice returned will preview updating or creating a subscription with that trial end. +/// +/// If set, one of `subscription_items` or `subscription` is required. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpcomingLinesInvoiceSubscriptionTrialEnd { + Now, + Timestamp(stripe_types::Timestamp), +} +impl<'a> UpcomingLinesInvoice<'a> { + /// When retrieving an upcoming invoice, you’ll get a **lines** property containing the total count of line items and the first handful of those items. + /// + /// There is also a URL where you can retrieve the full (paginated) list of line items. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/invoices/upcoming/lines", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/invoices/upcoming/lines", self) + } +} +impl<'a> stripe::PaginationParams for UpcomingLinesInvoice<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoice<'a> { + /// The account tax IDs associated with the invoice. + /// + /// Only editable when the invoice is a draft. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option<&'a [&'a str]>, + /// A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. + /// + /// The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. + /// For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. + /// + /// If `false`, the invoice's state doesn't automatically advance without an explicit action. + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_advance: Option, + /// Settings for automatic tax lookup for this invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// + /// When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. + /// When sending an invoice, Stripe will email this invoice to the customer with payment instructions. + /// Defaults to `charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// The currency to create this invoice in. + /// + /// Defaults to that of `customer` if not specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// A list of up to 4 custom fields to be displayed on the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [CreateInvoiceCustomFields<'a>]>, + /// The ID of the customer who will be billed. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// The number of days from when the invoice is created until it is due. + /// + /// Valid only for invoices where `collection_method=send_invoice`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, + /// ID of the default payment method for the invoice. + /// + /// It must belong to the customer associated with the invoice. + /// If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// ID of the default payment source for the invoice. + /// + /// It must belong to the customer associated with the invoice and be in a chargeable state. + /// If not set, defaults to the subscription's default source, if any, or to the customer's default source. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_source: Option<&'a str>, + /// The tax rates that will apply to any line item that does not have `tax_rates` set. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + /// Referenced as 'memo' in the Dashboard. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The coupons to redeem into discounts for the invoice. + /// + /// If not specified, inherits the discount from the invoice's customer. + /// Pass an empty string to avoid inheriting any discounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [CreateInvoiceDiscounts<'a>]>, + /// The date on which payment for this invoice is due. + /// + /// Valid only for invoices where `collection_method=send_invoice`. + #[serde(skip_serializing_if = "Option::is_none")] + pub due_date: Option, + /// The date when this invoice is in effect. + /// + /// Same as `finalized_at` unless overwritten. + /// When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_at: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Footer to be displayed on the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// Revise an existing invoice. + /// + /// The new invoice will be created in `status=draft`. + /// See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub from_invoice: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The account (if any) for which the funds of the invoice payment are intended. + /// + /// If set, the invoice will be presented with the branding and support information of the specified account. + /// See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// Configuration settings for the PaymentIntent that is generated when the invoice is finalized. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_settings: Option>, + /// How to handle pending invoice items on invoice creation. + /// + /// One of `include` or `exclude`. + /// `include` will include any pending invoice items, and will create an empty draft invoice if no pending invoice items exist. + /// `exclude` will always create an empty invoice draft regardless if there are pending invoice items or not. + /// Defaults to `exclude` if the parameter is omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub pending_invoice_items_behavior: Option, + /// The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering: Option, + /// This is a legacy field that will be removed soon. + /// + /// For details about `rendering_options`, refer to `rendering` instead. + /// Options for invoice PDF rendering. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering_options: Option, + /// Settings for the cost of shipping for this invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_cost: Option>, + /// Shipping details for the invoice. + /// + /// The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_details: Option>, + /// Extra information about a charge for the customer's credit card statement. + /// + /// It must contain at least one letter. + /// If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// The ID of the subscription to invoice, if any. + /// + /// If set, the created invoice will only include pending invoice items for that subscription. + /// The subscription's billing cycle and regular subscription events won't be affected. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription: Option<&'a str>, + /// If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, +} +impl<'a> CreateInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings for automatic tax lookup for this invoice. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceAutomaticTax { + /// Whether Stripe automatically computes tax on this invoice. + /// + /// Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + pub enabled: bool, +} +impl CreateInvoiceAutomaticTax { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// +/// When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. +/// When sending an invoice, Stripe will email this invoice to the customer with payment instructions. +/// Defaults to `charge_automatically`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl CreateInvoiceCollectionMethod { + pub fn as_str(self) -> &'static str { + use CreateInvoiceCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for CreateInvoiceCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoiceCollectionMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateInvoiceCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A list of up to 4 custom fields to be displayed on the invoice. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceCustomFields<'a> { + /// The name of the custom field. + /// + /// This may be up to 30 characters. + pub name: &'a str, + /// The value of the custom field. + /// + /// This may be up to 30 characters. + pub value: &'a str, +} +impl<'a> CreateInvoiceCustomFields<'a> { + pub fn new(name: &'a str, value: &'a str) -> Self { + Self { name, value } + } +} +/// The coupons to redeem into discounts for the invoice. +/// +/// If not specified, inherits the discount from the invoice's customer. +/// Pass an empty string to avoid inheriting any discounts. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoiceDiscounts<'a> { + /// ID of the coupon to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option<&'a str>, +} +impl<'a> CreateInvoiceDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Revise an existing invoice. +/// +/// The new invoice will be created in `status=draft`. +/// See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceFromInvoice<'a> { + /// The relation between the new invoice and the original invoice. + /// + /// Currently, only 'revision' is permitted. + pub action: CreateInvoiceFromInvoiceAction, + /// The `id` of the invoice that will be cloned. + pub invoice: &'a str, +} +impl<'a> CreateInvoiceFromInvoice<'a> { + pub fn new(action: CreateInvoiceFromInvoiceAction, invoice: &'a str) -> Self { + Self { action, invoice } + } +} +/// The relation between the new invoice and the original invoice. +/// +/// Currently, only 'revision' is permitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceFromInvoiceAction { + Revision, +} +impl CreateInvoiceFromInvoiceAction { + pub fn as_str(self) -> &'static str { + use CreateInvoiceFromInvoiceAction::*; + match self { + Revision => "revision", + } + } +} + +impl std::str::FromStr for CreateInvoiceFromInvoiceAction { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceFromInvoiceAction::*; + match s { + "revision" => Ok(Revision), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoiceFromInvoiceAction { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateInvoiceFromInvoiceAction { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceFromInvoiceAction { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceFromInvoiceAction { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration settings for the PaymentIntent that is generated when the invoice is finalized. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettings<'a> { + /// ID of the mandate to be used for this invoice. + /// + /// It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_mandate: Option<&'a str>, + /// Payment-method-specific configuration to provide to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The list of payment method types (e.g. + /// + /// card) to provide to the invoice’s PaymentIntent. + /// 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). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [CreateInvoicePaymentSettingsPaymentMethodTypes]>, +} +impl<'a> CreateInvoicePaymentSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Payment-method-specific configuration to provide to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptions<'a> { + /// If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + /// If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + /// If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: + Option>, + /// If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, +} +impl<'a> CreateInvoicePaymentSettingsPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebit { + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Mandate creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: Option< + CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType, + >, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { + pub fn new() -> Self { + Self::default() + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl AsRef + for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr + for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: + Option, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr + for CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCard { + /// Installment configuration for payments attempted on this invoice (Mexico Only). + /// + /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + #[serde(skip_serializing_if = "Option::is_none")] + pub installments: Option, + /// 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). + /// + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsCard { + pub fn new() -> Self { + Self::default() + } +} +/// Installment configuration for payments attempted on this invoice (Mexico Only). +/// +/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallments { + /// Setting to true enables installments for this invoice. + /// Setting to false will prevent any selected plan from applying to a payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// The selected installment plan to use for this invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallments { + pub fn new() -> Self { + Self::default() + } +} +/// The selected installment plan to use for this invoice. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan { + /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + pub count: u64, + /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + /// One of `month`. + pub interval: CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval, + /// Type of installment plan, one of `fixed_count`. + #[serde(rename = "type")] + pub type_: CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan { + pub fn new( + count: u64, + interval: CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval, + type_: CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType, + ) -> Self { + Self { count, interval, type_ } + } +} +/// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. +/// One of `month`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval { + Month, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match self { + Month => "month", + } + } +} + +impl std::str::FromStr + for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match s { + "month" => Ok(Month), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of installment plan, one of `fixed_count`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + FixedCount, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType::*; + match self { + FixedCount => "fixed_count", + } + } +} + +impl std::str::FromStr + for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType::*; + match s { + "fixed_count" => Ok(FixedCount), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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). +/// +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// 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. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + } + } +} + +impl std::str::FromStr for CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalance<'a> { + /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: + Option>, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// + /// Permitted values include: `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub funding_type: Option<&'a str>, +} +impl<'a> CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + /// Configuration for eu_bank_transfer funding type. + #[serde(skip_serializing_if = "Option::is_none")] + pub eu_bank_transfer: Option< + CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer< + 'a, + >, + >, + /// The bank transfer type that can be used for funding. + /// + /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option<&'a str>, +} +impl<'a> CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for eu_bank_transfer funding type. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer< + 'a, +> { + /// The desired country code of the bank account information. + /// + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: &'a str, +} +impl<'a> + CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer<'a> +{ + pub fn new(country: &'a str) -> Self { + Self { country } + } +} +/// If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: Option< + CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a>, + >, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[serde(skip_serializing_if = "Option::is_none")] +pub permissions: Option<&'a [CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions]>, + /// List of data features that you would like to retrieve upon account creation. +#[serde(skip_serializing_if = "Option::is_none")] +pub prefetch: Option<&'a [CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch]>, + +} +impl<'a> CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl AsRef + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + } + } +} + +impl std::str::FromStr + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + _ => Err(()), + } + } +} +impl AsRef + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of payment method types (e.g. +/// +/// card) to provide to the invoice’s PaymentIntent. +/// 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). +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateInvoicePaymentSettingsPaymentMethodTypes { + AchCreditTransfer, + AchDebit, + AcssDebit, + AuBecsDebit, + BacsDebit, + Bancontact, + Boleto, + Card, + Cashapp, + CustomerBalance, + Fpx, + Giropay, + Grabpay, + Ideal, + Konbini, + Link, + Paynow, + Paypal, + Promptpay, + SepaCreditTransfer, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateInvoicePaymentSettingsPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodTypes::*; + match self { + AchCreditTransfer => "ach_credit_transfer", + AchDebit => "ach_debit", + AcssDebit => "acss_debit", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Konbini => "konbini", + Link => "link", + Paynow => "paynow", + Paypal => "paypal", + Promptpay => "promptpay", + SepaCreditTransfer => "sepa_credit_transfer", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateInvoicePaymentSettingsPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodTypes::*; + match s { + "ach_credit_transfer" => Ok(AchCreditTransfer), + "ach_debit" => Ok(AchDebit), + "acss_debit" => Ok(AcssDebit), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "promptpay" => Ok(Promptpay), + "sepa_credit_transfer" => Ok(SepaCreditTransfer), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoicePaymentSettingsPaymentMethodTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateInvoicePaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoicePaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoicePaymentSettingsPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// How to handle pending invoice items on invoice creation. +/// +/// One of `include` or `exclude`. +/// `include` will include any pending invoice items, and will create an empty draft invoice if no pending invoice items exist. +/// `exclude` will always create an empty invoice draft regardless if there are pending invoice items or not. +/// Defaults to `exclude` if the parameter is omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePendingInvoiceItemsBehavior { + Exclude, + Include, + IncludeAndRequire, +} +impl CreateInvoicePendingInvoiceItemsBehavior { + pub fn as_str(self) -> &'static str { + use CreateInvoicePendingInvoiceItemsBehavior::*; + match self { + Exclude => "exclude", + Include => "include", + IncludeAndRequire => "include_and_require", + } + } +} + +impl std::str::FromStr for CreateInvoicePendingInvoiceItemsBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePendingInvoiceItemsBehavior::*; + match s { + "exclude" => Ok(Exclude), + "include" => Ok(Include), + "include_and_require" => Ok(IncludeAndRequire), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoicePendingInvoiceItemsBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateInvoicePendingInvoiceItemsBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoicePendingInvoiceItemsBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoicePendingInvoiceItemsBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoiceRendering { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: Option, + /// Invoice pdf rendering options. + #[serde(skip_serializing_if = "Option::is_none")] + pub pdf: Option, +} +impl CreateInvoiceRendering { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceRenderingAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl CreateInvoiceRenderingAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use CreateInvoiceRenderingAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr for CreateInvoiceRenderingAmountTaxDisplay { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceRenderingAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoiceRenderingAmountTaxDisplay { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateInvoiceRenderingAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceRenderingAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceRenderingAmountTaxDisplay { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Invoice pdf rendering options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoiceRenderingPdf { + /// Page size for invoice PDF. + /// + /// Can be set to `a4`, `letter`, or `auto`. If set to `auto`, invoice PDF page size defaults to `a4` for customers with Japanese locale and `letter` for customers with other locales. + #[serde(skip_serializing_if = "Option::is_none")] + pub page_size: Option, +} +impl CreateInvoiceRenderingPdf { + pub fn new() -> Self { + Self::default() + } +} +/// Page size for invoice PDF. +/// +/// Can be set to `a4`, `letter`, or `auto`. If set to `auto`, invoice PDF page size defaults to `a4` for customers with Japanese locale and `letter` for customers with other locales. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceRenderingPdfPageSize { + A4, + Auto, + Letter, +} +impl CreateInvoiceRenderingPdfPageSize { + pub fn as_str(self) -> &'static str { + use CreateInvoiceRenderingPdfPageSize::*; + match self { + A4 => "a4", + Auto => "auto", + Letter => "letter", + } + } +} + +impl std::str::FromStr for CreateInvoiceRenderingPdfPageSize { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceRenderingPdfPageSize::*; + match s { + "a4" => Ok(A4), + "auto" => Ok(Auto), + "letter" => Ok(Letter), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoiceRenderingPdfPageSize { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateInvoiceRenderingPdfPageSize { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceRenderingPdfPageSize { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceRenderingPdfPageSize { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This is a legacy field that will be removed soon. +/// +/// For details about `rendering_options`, refer to `rendering` instead. +/// Options for invoice PDF rendering. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoiceRenderingOptions { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: Option, +} +impl CreateInvoiceRenderingOptions { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceRenderingOptionsAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl CreateInvoiceRenderingOptionsAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use CreateInvoiceRenderingOptionsAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr for CreateInvoiceRenderingOptionsAmountTaxDisplay { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceRenderingOptionsAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoiceRenderingOptionsAmountTaxDisplay { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateInvoiceRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceRenderingOptionsAmountTaxDisplay { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Settings for the cost of shipping for this invoice. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoiceShippingCost<'a> { + /// The ID of the shipping rate to use for this order. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option<&'a str>, + /// Parameters to create a new ad-hoc shipping rate for this order. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate_data: Option>, +} +impl<'a> CreateInvoiceShippingCost<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Parameters to create a new ad-hoc shipping rate for this order. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceShippingCostShippingRateData<'a> { + /// The estimated range for how long shipping will take, meant to be displayable to the customer. + /// + /// This will appear on CheckoutSessions. + #[serde(skip_serializing_if = "Option::is_none")] + pub delivery_estimate: Option, + /// The name of the shipping rate, meant to be displayable to the customer. + /// + /// This will appear on CheckoutSessions. + pub display_name: &'a str, + /// Describes a fixed amount to charge for shipping. + /// + /// Must be present if type is `fixed_amount`. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amount: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + /// + /// The Shipping tax code is `txcd_92010001`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// The type of calculation to use on the shipping rate. + /// + /// Can only be `fixed_amount` for now. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> CreateInvoiceShippingCostShippingRateData<'a> { + pub fn new(display_name: &'a str) -> Self { + Self { + delivery_estimate: Default::default(), + display_name, + fixed_amount: Default::default(), + metadata: Default::default(), + tax_behavior: Default::default(), + tax_code: Default::default(), + type_: Default::default(), + } + } +} +/// The estimated range for how long shipping will take, meant to be displayable to the customer. +/// +/// This will appear on CheckoutSessions. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoiceShippingCostShippingRateDataDeliveryEstimate { + /// The upper bound of the estimated range. + /// + /// If empty, represents no upper bound i.e., infinite. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option, + /// The lower bound of the estimated range. + /// + /// If empty, represents no lower bound. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option, +} +impl CreateInvoiceShippingCostShippingRateDataDeliveryEstimate { + pub fn new() -> Self { + Self::default() + } +} +/// The upper bound of the estimated range. +/// +/// If empty, represents no upper bound i.e., infinite. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximum { + /// A unit of time. + pub unit: CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit, + /// Must be greater than 0. + pub value: i64, +} +impl CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximum { + pub fn new( + unit: CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit, + value: i64, + ) -> Self { + Self { unit, value } + } +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + pub fn as_str(self) -> &'static str { + use CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The lower bound of the estimated range. +/// +/// If empty, represents no lower bound. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimum { + /// A unit of time. + pub unit: CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit, + /// Must be greater than 0. + pub value: i64, +} +impl CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimum { + pub fn new( + unit: CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit, + value: i64, + ) -> Self { + Self { unit, value } + } +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + pub fn as_str(self) -> &'static str { + use CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Describes a fixed amount to charge for shipping. +/// +/// Must be present if type is `fixed_amount`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceShippingCostShippingRateDataFixedAmount<'a> { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Shipping rates defined in each available currency option. + /// + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + &'a std::collections::HashMap< + stripe_types::Currency, + CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptions, + >, + >, +} +impl<'a> CreateInvoiceShippingCostShippingRateDataFixedAmount<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { amount, currency, currency_options: Default::default() } + } +} +/// Shipping rates defined in each available currency option. +/// +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptions { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: + Option, +} +impl CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptions { + pub fn new(amount: i64) -> Self { + Self { amount, tax_behavior: Default::default() } + } +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr + for CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceShippingCostShippingRateDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateInvoiceShippingCostShippingRateDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateInvoiceShippingCostShippingRateDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateInvoiceShippingCostShippingRateDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceShippingCostShippingRateDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoiceShippingCostShippingRateDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateInvoiceShippingCostShippingRateDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceShippingCostShippingRateDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceShippingCostShippingRateDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of calculation to use on the shipping rate. +/// +/// Can only be `fixed_amount` for now. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceShippingCostShippingRateDataType { + FixedAmount, +} +impl CreateInvoiceShippingCostShippingRateDataType { + pub fn as_str(self) -> &'static str { + use CreateInvoiceShippingCostShippingRateDataType::*; + match self { + FixedAmount => "fixed_amount", + } + } +} + +impl std::str::FromStr for CreateInvoiceShippingCostShippingRateDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceShippingCostShippingRateDataType::*; + match s { + "fixed_amount" => Ok(FixedAmount), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoiceShippingCostShippingRateDataType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateInvoiceShippingCostShippingRateDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceShippingCostShippingRateDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceShippingCostShippingRateDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Shipping details for the invoice. +/// +/// The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceShippingDetails<'a> { + /// Shipping address. + pub address: CreateInvoiceShippingDetailsAddress<'a>, + /// Recipient name. + pub name: &'a str, + /// Recipient phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> CreateInvoiceShippingDetails<'a> { + pub fn new(address: CreateInvoiceShippingDetailsAddress<'a>, name: &'a str) -> Self { + Self { address, name, phone: Default::default() } + } +} +/// Shipping address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoiceShippingDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateInvoiceShippingDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceTransferData<'a> { + /// The amount that will be transferred automatically when the invoice is paid. + /// + /// If no amount is set, the full amount is transferred. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> CreateInvoiceTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount: Default::default(), destination } + } +} +impl<'a> CreateInvoice<'a> { + /// This endpoint creates a draft invoice for a given customer. + /// + /// The invoice remains a draft until you [finalize](https://stripe.com/docs/api#finalize_invoice) the invoice, which allows you to [pay](https://stripe.com/docs/api#pay_invoice) or [send](https://stripe.com/docs/api#send_invoice) the invoice to your customers. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/invoices", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListInvoice<'a> { + /// The collection method of the invoice to retrieve. + /// + /// Either `charge_automatically` or `send_invoice`. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return invoices for the customer specified by this customer ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub due_date: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. + /// + /// [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview). + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Only return invoices for the subscription specified by this subscription ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription: Option<&'a str>, +} +impl<'a> ListInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The collection method of the invoice to retrieve. +/// +/// Either `charge_automatically` or `send_invoice`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListInvoiceCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl ListInvoiceCollectionMethod { + pub fn as_str(self) -> &'static str { + use ListInvoiceCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for ListInvoiceCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ListInvoiceCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl AsRef for ListInvoiceCollectionMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListInvoiceCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListInvoiceCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListInvoiceCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. +/// +/// [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListInvoiceStatus { + Draft, + Open, + Paid, + Uncollectible, + Void, +} +impl ListInvoiceStatus { + pub fn as_str(self) -> &'static str { + use ListInvoiceStatus::*; + match self { + Draft => "draft", + Open => "open", + Paid => "paid", + Uncollectible => "uncollectible", + Void => "void", + } + } +} + +impl std::str::FromStr for ListInvoiceStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListInvoiceStatus::*; + match s { + "draft" => Ok(Draft), + "open" => Ok(Open), + "paid" => Ok(Paid), + "uncollectible" => Ok(Uncollectible), + "void" => Ok(Void), + _ => Err(()), + } + } +} +impl AsRef for ListInvoiceStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListInvoiceStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListInvoiceStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListInvoiceStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListInvoice<'a> { + /// You can list all invoices, or list the invoices for a specific customer. + /// + /// The invoices are returned sorted by creation date, with the most recently created invoices appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/invoices", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/invoices", self) + } +} +impl<'a> stripe::PaginationParams for ListInvoice<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveInvoice<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveInvoice<'a> { + /// Retrieves the invoice with the given ID. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_types::invoice::InvoiceId, + ) -> stripe::Response { + client.get_query(&format!("/invoices/{invoice}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteInvoice {} +impl DeleteInvoice { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteInvoice { + /// Permanently deletes a one-off invoice draft. + /// + /// This cannot be undone. + /// Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_types::invoice::InvoiceId, + ) -> stripe::Response { + client.send_form(&format!("/invoices/{invoice}"), self, http_types::Method::Delete) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct FinalizeInvoiceInvoice<'a> { + /// Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. + /// + /// If `false`, the invoice's state doesn't automatically advance without an explicit action. + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_advance: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> FinalizeInvoiceInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> FinalizeInvoiceInvoice<'a> { + /// Stripe automatically finalizes drafts before sending and attempting payment on invoices. + /// + /// However, if you’d like to finalize a draft invoice manually, you can do so using this method. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_types::invoice::InvoiceId, + ) -> stripe::Response { + client.send_form(&format!("/invoices/{invoice}/finalize"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct SendInvoiceInvoice<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> SendInvoiceInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> SendInvoiceInvoice<'a> { + /// Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). + /// + /// However, if you’d like to manually send an invoice to your customer out of the normal schedule, you can do so. + /// When sending invoices that have already been paid, there will be no reference to the payment in the email. Requests made in test-mode result in no emails being sent, despite sending an `invoice.sent` event. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_types::invoice::InvoiceId, + ) -> stripe::Response { + client.send_form(&format!("/invoices/{invoice}/send"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct MarkUncollectibleInvoice<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> MarkUncollectibleInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> MarkUncollectibleInvoice<'a> { + /// Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_types::invoice::InvoiceId, + ) -> stripe::Response { + client.send_form( + &format!("/invoices/{invoice}/mark_uncollectible"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct VoidInvoiceInvoice<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> VoidInvoiceInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> VoidInvoiceInvoice<'a> { + /// Mark a finalized invoice as void. + /// + /// This cannot be undone. + /// Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_types::invoice::InvoiceId, + ) -> stripe::Response { + client.send_form(&format!("/invoices/{invoice}/void"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_billing/src/invoice_installments_card/mod.rs b/generated/stripe_billing/src/invoice_installments_card/mod.rs new file mode 100644 index 000000000..d8d7c477a --- /dev/null +++ b/generated/stripe_billing/src/invoice_installments_card/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_installments_card::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_item/mod.rs b/generated/stripe_billing/src/invoice_item/mod.rs new file mode 100644 index 000000000..934d85d83 --- /dev/null +++ b/generated/stripe_billing/src/invoice_item/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::invoice_item::*; +#[cfg(feature = "invoice_item")] +mod requests; +#[cfg(feature = "invoice_item")] +pub use requests::*; diff --git a/generated/stripe_billing/src/invoice_item/requests.rs b/generated/stripe_billing/src/invoice_item/requests.rs new file mode 100644 index 000000000..6103ea994 --- /dev/null +++ b/generated/stripe_billing/src/invoice_item/requests.rs @@ -0,0 +1,707 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListInvoiceItem<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// The identifier of the customer whose invoice items to return. + /// + /// If none is provided, all invoice items will be returned. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Only return invoice items belonging to this invoice. + /// + /// If none is provided, all invoice items will be returned. + /// If specifying an invoice, no customer identifier is needed. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice: Option<&'a str>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Set to `true` to only show pending invoice items, which are not yet attached to any invoices. + /// + /// Set to `false` to only show invoice items already attached to invoices. + /// If unspecified, no filter is applied. + #[serde(skip_serializing_if = "Option::is_none")] + pub pending: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListInvoiceItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListInvoiceItem<'a> { + /// Returns a list of your invoice items. + /// + /// Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/invoiceitems", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/invoiceitems", self) + } +} +impl<'a> stripe::PaginationParams for ListInvoiceItem<'a> {} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceItem<'a> { + /// The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. + /// + /// Passing in a negative `amount` will reduce the `amount_due` on the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The ID of the customer who will be billed when this invoice item is billed. + pub customer: &'a str, + /// An arbitrary string which you can attach to the invoice item. + /// + /// The description is displayed in the invoice for easy tracking. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Controls whether discounts apply to this invoice item. + /// + /// Defaults to false for prorations or negative invoice items, and true for all other invoice items. + #[serde(skip_serializing_if = "Option::is_none")] + pub discountable: Option, + /// The coupons to redeem into discounts for the invoice item or invoice line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [CreateInvoiceItemDiscounts<'a>]>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The ID of an existing invoice to add this invoice item to. + /// + /// When left blank, the invoice item will be added to the next upcoming scheduled invoice. + /// This is useful when adding invoice items in response to an invoice.created webhook. + /// You can only add invoice items to draft invoices and there is a maximum of 250 items per invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The period associated with this invoice item. + /// + /// When set to different values, the period will be rendered on the invoice. + /// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. + /// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub period: Option, + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Non-negative integer. + /// + /// The quantity of units for the invoice item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The ID of a subscription to add this invoice item to. + /// + /// When left blank, the invoice item will be be added to the next upcoming scheduled invoice. + /// When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. + /// Use this when you want to express that an invoice item has been accrued within the context of a particular subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription: Option<&'a str>, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// The tax rates which apply to the invoice item. + /// + /// When set, the `default_tax_rates` on the invoice do not apply to this invoice item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, + /// The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. + /// + /// This `unit_amount` will be multiplied by the quantity to get the full amount. + /// Passing in a negative `unit_amount` will reduce the `amount_due` on the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateInvoiceItem<'a> { + pub fn new(customer: &'a str) -> Self { + Self { + amount: Default::default(), + currency: Default::default(), + customer, + description: Default::default(), + discountable: Default::default(), + discounts: Default::default(), + expand: Default::default(), + invoice: Default::default(), + metadata: Default::default(), + period: Default::default(), + price: Default::default(), + price_data: Default::default(), + quantity: Default::default(), + subscription: Default::default(), + tax_behavior: Default::default(), + tax_code: Default::default(), + tax_rates: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// The coupons to redeem into discounts for the invoice item or invoice line item. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoiceItemDiscounts<'a> { + /// ID of the coupon to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option<&'a str>, +} +impl<'a> CreateInvoiceItemDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The period associated with this invoice item. +/// +/// When set to different values, the period will be rendered on the invoice. +/// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. +/// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceItemPeriod { + /// The end of the period, which must be greater than or equal to the start. + /// + /// This value is inclusive. + pub end: stripe_types::Timestamp, + /// The start of the period. + /// + /// This value is inclusive. + pub start: stripe_types::Timestamp, +} +impl CreateInvoiceItemPeriod { + pub fn new(end: stripe_types::Timestamp, start: stripe_types::Timestamp) -> Self { + Self { end, start } + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceItemPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateInvoiceItemPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { + currency, + product, + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceItemPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateInvoiceItemPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateInvoiceItemPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateInvoiceItemPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceItemPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoiceItemPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateInvoiceItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceItemPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceItemTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateInvoiceItemTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateInvoiceItemTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateInvoiceItemTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceItemTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreateInvoiceItemTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateInvoiceItemTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceItemTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceItemTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateInvoiceItem<'a> { + /// Creates an item to be added to a draft invoice (up to 250 items per invoice). + /// + /// If no invoice is specified, the item will be on the next invoice created for the customer specified. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/invoiceitems", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveInvoiceItem<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveInvoiceItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveInvoiceItem<'a> { + /// Retrieves the invoice item with the given ID. + pub fn send( + &self, + client: &stripe::Client, + invoiceitem: &stripe_types::invoice_item::InvoiceitemId, + ) -> stripe::Response { + client.get_query(&format!("/invoiceitems/{invoiceitem}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceItem<'a> { + /// The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. + /// + /// If you want to apply a credit to the customer's account, pass a negative amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// An arbitrary string which you can attach to the invoice item. + /// + /// The description is displayed in the invoice for easy tracking. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Controls whether discounts apply to this invoice item. + /// + /// Defaults to false for prorations or negative invoice items, and true for all other invoice items. + /// Cannot be set to true for prorations. + #[serde(skip_serializing_if = "Option::is_none")] + pub discountable: Option, + /// The coupons & existing discounts which apply to the invoice item or invoice line item. + /// + /// Item discounts are applied before invoice discounts. + /// Pass an empty string to remove previously-defined discounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [UpdateInvoiceItemDiscounts<'a>]>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The period associated with this invoice item. + /// + /// When set to different values, the period will be rendered on the invoice. + /// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. + /// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub period: Option, + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Non-negative integer. + /// + /// The quantity of units for the invoice item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// The tax rates which apply to the invoice item. + /// + /// When set, the `default_tax_rates` on the invoice do not apply to this invoice item. + /// Pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, + /// The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. + /// + /// This unit_amount will be multiplied by the quantity to get the full amount. + /// If you want to apply a credit to the customer's account, pass a negative unit_amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpdateInvoiceItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The coupons & existing discounts which apply to the invoice item or invoice line item. +/// +/// Item discounts are applied before invoice discounts. +/// Pass an empty string to remove previously-defined discounts. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceItemDiscounts<'a> { + /// ID of the coupon to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option<&'a str>, +} +impl<'a> UpdateInvoiceItemDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The period associated with this invoice item. +/// +/// When set to different values, the period will be rendered on the invoice. +/// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. +/// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceItemPeriod { + /// The end of the period, which must be greater than or equal to the start. + /// + /// This value is inclusive. + pub end: stripe_types::Timestamp, + /// The start of the period. + /// + /// This value is inclusive. + pub start: stripe_types::Timestamp, +} +impl UpdateInvoiceItemPeriod { + pub fn new(end: stripe_types::Timestamp, start: stripe_types::Timestamp) -> Self { + Self { end, start } + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceItemPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpdateInvoiceItemPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { + currency, + product, + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceItemPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateInvoiceItemPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceItemPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateInvoiceItemPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceItemPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoiceItemPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateInvoiceItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceItemPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceItemTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateInvoiceItemTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceItemTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateInvoiceItemTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceItemTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoiceItemTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateInvoiceItemTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceItemTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceItemTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateInvoiceItem<'a> { + /// Updates the amount or description of an invoice item on an upcoming invoice. + /// + /// Updating an invoice item is only possible before the invoice it’s attached to is closed. + pub fn send( + &self, + client: &stripe::Client, + invoiceitem: &stripe_types::invoice_item::InvoiceitemId, + ) -> stripe::Response { + client.send_form(&format!("/invoiceitems/{invoiceitem}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteInvoiceItem {} +impl DeleteInvoiceItem { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteInvoiceItem { + /// Deletes an invoice item, removing it from an invoice. + /// + /// Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice. + pub fn send( + &self, + client: &stripe::Client, + invoiceitem: &stripe_types::invoice_item::InvoiceitemId, + ) -> stripe::Response { + client.send_form(&format!("/invoiceitems/{invoiceitem}"), self, http_types::Method::Delete) + } +} diff --git a/generated/stripe_billing/src/invoice_item_threshold_reason/mod.rs b/generated/stripe_billing/src/invoice_item_threshold_reason/mod.rs new file mode 100644 index 000000000..9bbe1ae5a --- /dev/null +++ b/generated/stripe_billing/src/invoice_item_threshold_reason/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_item_threshold_reason::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_line_item/mod.rs b/generated/stripe_billing/src/invoice_line_item/mod.rs new file mode 100644 index 000000000..328c5519a --- /dev/null +++ b/generated/stripe_billing/src/invoice_line_item/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::invoice_line_item::*; +#[cfg(feature = "invoice_line_item")] +mod requests; +#[cfg(feature = "invoice_line_item")] +pub use requests::*; diff --git a/generated/stripe_billing/src/invoice_line_item/requests.rs b/generated/stripe_billing/src/invoice_line_item/requests.rs new file mode 100644 index 000000000..b67b5d2e6 --- /dev/null +++ b/generated/stripe_billing/src/invoice_line_item/requests.rs @@ -0,0 +1,488 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListInvoiceLineItem<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListInvoiceLineItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListInvoiceLineItem<'a> { + /// When retrieving an invoice, you’ll get a **lines** property containing the total count of line items and the first handful of those items. + /// + /// There is also a URL where you can retrieve the full (paginated) list of line items. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_types::invoice::InvoiceId, + ) -> stripe::Response> { + client.get_query(&format!("/invoices/{invoice}/lines"), self) + } + pub fn paginate( + self, + invoice: &stripe_types::invoice::InvoiceId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params(&format!("/invoices/{invoice}/lines"), self) + } +} +impl<'a> stripe::PaginationParams for ListInvoiceLineItem<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceLineItem<'a> { + /// The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. + /// + /// If you want to apply a credit to the customer's account, pass a negative amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// An arbitrary string which you can attach to the invoice item. + /// + /// The description is displayed in the invoice for easy tracking. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Controls whether discounts apply to this line item. + /// + /// Defaults to false for prorations or negative line items, and true for all other line items. + /// Cannot be set to true for prorations. + #[serde(skip_serializing_if = "Option::is_none")] + pub discountable: Option, + /// The coupons & existing discounts which apply to the line item. + /// + /// Item discounts are applied before invoice discounts. + /// Pass an empty string to remove previously-defined discounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [UpdateInvoiceLineItemDiscounts<'a>]>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The period associated with this invoice item. + /// + /// When set to different values, the period will be rendered on the invoice. + /// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. + /// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub period: Option, + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Non-negative integer. + /// + /// The quantity of units for the line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of up to 10 tax amounts for this line item. + /// + /// This can be useful if you calculate taxes on your own or use a third-party to calculate them. + /// You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). + /// Pass an empty string to remove previously defined tax amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_amounts: Option<&'a [UpdateInvoiceLineItemTaxAmounts<'a>]>, + /// The tax rates which apply to the line item. + /// + /// When set, the `default_tax_rates` on the invoice do not apply to this line item. + /// Pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpdateInvoiceLineItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The coupons & existing discounts which apply to the line item. +/// +/// Item discounts are applied before invoice discounts. +/// Pass an empty string to remove previously-defined discounts. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceLineItemDiscounts<'a> { + /// ID of the coupon to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option<&'a str>, +} +impl<'a> UpdateInvoiceLineItemDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The period associated with this invoice item. +/// +/// When set to different values, the period will be rendered on the invoice. +/// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. +/// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceLineItemPeriod { + /// The end of the period, which must be greater than or equal to the start. + /// + /// This value is inclusive. + pub end: stripe_types::Timestamp, + /// The start of the period. + /// + /// This value is inclusive. + pub start: stripe_types::Timestamp, +} +impl UpdateInvoiceLineItemPeriod { + pub fn new(end: stripe_types::Timestamp, start: stripe_types::Timestamp) -> Self { + Self { end, start } + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceLineItemPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + /// + /// One of `product` or `product_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub product: Option<&'a str>, + /// Data used to generate a new product object inline. + /// + /// One of `product` or `product_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_data: Option>, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A non-negative integer in cents (or local equivalent) representing how much to charge. + /// + /// One of `unit_amount` or `unit_amount_decimal` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpdateInvoiceLineItemPriceData<'a> { + pub fn new(currency: stripe_types::Currency) -> Self { + Self { + currency, + product: Default::default(), + product_data: Default::default(), + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// Data used to generate a new product object inline. +/// +/// One of `product` or `product_data` is required. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceLineItemPriceDataProductData<'a> { + /// The product's description, meant to be displayable to the customer. + /// + /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub images: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The product's name, meant to be displayable to the customer. + pub name: &'a str, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, +} +impl<'a> UpdateInvoiceLineItemPriceDataProductData<'a> { + pub fn new(name: &'a str) -> Self { + Self { + description: Default::default(), + images: Default::default(), + metadata: Default::default(), + name, + tax_code: Default::default(), + } + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceLineItemPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateInvoiceLineItemPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceLineItemPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateInvoiceLineItemPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceLineItemPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoiceLineItemPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateInvoiceLineItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceLineItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceLineItemPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A list of up to 10 tax amounts for this line item. +/// +/// This can be useful if you calculate taxes on your own or use a third-party to calculate them. +/// You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). +/// Pass an empty string to remove previously defined tax amounts. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceLineItemTaxAmounts<'a> { + /// The amount, in cents (or local equivalent), of the tax. + pub amount: i64, + /// Data to find or create a TaxRate object. + /// + /// Stripe automatically creates or reuses a TaxRate object for each tax amount. + /// + /// If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. + /// TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item’s `tax_rates`, and cannot be directly added to invoices, payments, or line items. + pub tax_rate_data: UpdateInvoiceLineItemTaxAmountsTaxRateData<'a>, + /// The amount on which tax is calculated, in cents (or local equivalent). + pub taxable_amount: i64, +} +impl<'a> UpdateInvoiceLineItemTaxAmounts<'a> { + pub fn new( + amount: i64, + tax_rate_data: UpdateInvoiceLineItemTaxAmountsTaxRateData<'a>, + taxable_amount: i64, + ) -> Self { + Self { amount, tax_rate_data, taxable_amount } + } +} +/// Data to find or create a TaxRate object. +/// +/// Stripe automatically creates or reuses a TaxRate object for each tax amount. +/// +/// If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. +/// TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item’s `tax_rates`, and cannot be directly added to invoices, payments, or line items. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceLineItemTaxAmountsTaxRateData<'a> { + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// An arbitrary string attached to the tax rate for your internal use only. + /// + /// It will not be visible to your customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The display name of the tax rate, which will be shown to users. + pub display_name: &'a str, + /// This specifies if the tax rate is inclusive or exclusive. + pub inclusive: bool, + /// The jurisdiction for the tax rate. + /// + /// You can use this label field for tax reporting purposes. + /// It also appears on your customer’s invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub jurisdiction: Option<&'a str>, + /// The statutory tax rate percent. + /// + /// This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. + /// To accommodate fixed-amount taxes, set the percentage to zero. + /// Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. + pub percentage: f64, + /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. + /// + /// For example, "NY" for New York, United States. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// The high-level tax type, such as `vat` or `sales_tax`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_type: Option, +} +impl<'a> UpdateInvoiceLineItemTaxAmountsTaxRateData<'a> { + pub fn new(display_name: &'a str, inclusive: bool, percentage: f64) -> Self { + Self { + country: Default::default(), + description: Default::default(), + display_name, + inclusive, + jurisdiction: Default::default(), + percentage, + state: Default::default(), + tax_type: Default::default(), + } + } +} +/// The high-level tax type, such as `vat` or `sales_tax`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateInvoiceLineItemTaxAmountsTaxRateDataTaxType { + AmusementTax, + CommunicationsTax, + Gst, + Hst, + Igst, + Jct, + LeaseTax, + Pst, + Qst, + Rst, + SalesTax, + ServiceTax, + Vat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateInvoiceLineItemTaxAmountsTaxRateDataTaxType { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceLineItemTaxAmountsTaxRateDataTaxType::*; + match self { + AmusementTax => "amusement_tax", + CommunicationsTax => "communications_tax", + Gst => "gst", + Hst => "hst", + Igst => "igst", + Jct => "jct", + LeaseTax => "lease_tax", + Pst => "pst", + Qst => "qst", + Rst => "rst", + SalesTax => "sales_tax", + ServiceTax => "service_tax", + Vat => "vat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateInvoiceLineItemTaxAmountsTaxRateDataTaxType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceLineItemTaxAmountsTaxRateDataTaxType::*; + match s { + "amusement_tax" => Ok(AmusementTax), + "communications_tax" => Ok(CommunicationsTax), + "gst" => Ok(Gst), + "hst" => Ok(Hst), + "igst" => Ok(Igst), + "jct" => Ok(Jct), + "lease_tax" => Ok(LeaseTax), + "pst" => Ok(Pst), + "qst" => Ok(Qst), + "rst" => Ok(Rst), + "sales_tax" => Ok(SalesTax), + "service_tax" => Ok(ServiceTax), + "vat" => Ok(Vat), + _ => Err(()), + } + } +} +impl AsRef for UpdateInvoiceLineItemTaxAmountsTaxRateDataTaxType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateInvoiceLineItemTaxAmountsTaxRateDataTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceLineItemTaxAmountsTaxRateDataTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceLineItemTaxAmountsTaxRateDataTaxType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateInvoiceLineItem<'a> { + /// Updates an invoice’s line item. + /// + /// Some fields, such as `tax_amounts`, only live on the invoice line item, so they can only be updated through this endpoint. + /// Other fields, such as `amount`, live on both the invoice item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only possible before the invoice is finalized. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_types::invoice::InvoiceId, + line_item_id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/invoices/{invoice}/lines/{line_item_id}"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_billing/src/invoice_line_item_period/mod.rs b/generated/stripe_billing/src/invoice_line_item_period/mod.rs new file mode 100644 index 000000000..0c861dc08 --- /dev/null +++ b/generated/stripe_billing/src/invoice_line_item_period/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_line_item_period::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_mandate_options_card/mod.rs b/generated/stripe_billing/src/invoice_mandate_options_card/mod.rs new file mode 100644 index 000000000..7761a9ec6 --- /dev/null +++ b/generated/stripe_billing/src/invoice_mandate_options_card/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_mandate_options_card::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_payment_method_options_acss_debit/mod.rs b/generated/stripe_billing/src/invoice_payment_method_options_acss_debit/mod.rs new file mode 100644 index 000000000..c8e614647 --- /dev/null +++ b/generated/stripe_billing/src/invoice_payment_method_options_acss_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_payment_method_options_acss_debit::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_payment_method_options_acss_debit_mandate_options/mod.rs b/generated/stripe_billing/src/invoice_payment_method_options_acss_debit_mandate_options/mod.rs new file mode 100644 index 000000000..c1ad70102 --- /dev/null +++ b/generated/stripe_billing/src/invoice_payment_method_options_acss_debit_mandate_options/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_payment_method_options_acss_debit_mandate_options::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_payment_method_options_bancontact/mod.rs b/generated/stripe_billing/src/invoice_payment_method_options_bancontact/mod.rs new file mode 100644 index 000000000..65cc34529 --- /dev/null +++ b/generated/stripe_billing/src/invoice_payment_method_options_bancontact/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_payment_method_options_bancontact::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_payment_method_options_card/mod.rs b/generated/stripe_billing/src/invoice_payment_method_options_card/mod.rs new file mode 100644 index 000000000..fc9d55180 --- /dev/null +++ b/generated/stripe_billing/src/invoice_payment_method_options_card/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_payment_method_options_card::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_payment_method_options_customer_balance/mod.rs b/generated/stripe_billing/src/invoice_payment_method_options_customer_balance/mod.rs new file mode 100644 index 000000000..56d660679 --- /dev/null +++ b/generated/stripe_billing/src/invoice_payment_method_options_customer_balance/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_payment_method_options_customer_balance::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_payment_method_options_customer_balance_bank_transfer/mod.rs b/generated/stripe_billing/src/invoice_payment_method_options_customer_balance_bank_transfer/mod.rs new file mode 100644 index 000000000..cba0e5d7b --- /dev/null +++ b/generated/stripe_billing/src/invoice_payment_method_options_customer_balance_bank_transfer/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_payment_method_options_customer_balance_bank_transfer::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer/mod.rs b/generated/stripe_billing/src/invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer/mod.rs new file mode 100644 index 000000000..0acfeae00 --- /dev/null +++ b/generated/stripe_billing/src/invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_payment_method_options_konbini/mod.rs b/generated/stripe_billing/src/invoice_payment_method_options_konbini/mod.rs new file mode 100644 index 000000000..40301470c --- /dev/null +++ b/generated/stripe_billing/src/invoice_payment_method_options_konbini/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_payment_method_options_konbini::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_payment_method_options_us_bank_account/mod.rs b/generated/stripe_billing/src/invoice_payment_method_options_us_bank_account/mod.rs new file mode 100644 index 000000000..e24be5906 --- /dev/null +++ b/generated/stripe_billing/src/invoice_payment_method_options_us_bank_account/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_payment_method_options_us_bank_account::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_payment_method_options_us_bank_account_linked_account_options/mod.rs b/generated/stripe_billing/src/invoice_payment_method_options_us_bank_account_linked_account_options/mod.rs new file mode 100644 index 000000000..f447e1acf --- /dev/null +++ b/generated/stripe_billing/src/invoice_payment_method_options_us_bank_account_linked_account_options/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_payment_method_options_us_bank_account_linked_account_options::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_rendering_pdf/mod.rs b/generated/stripe_billing/src/invoice_rendering_pdf/mod.rs new file mode 100644 index 000000000..ff755b4a0 --- /dev/null +++ b/generated/stripe_billing/src/invoice_rendering_pdf/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_rendering_pdf::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_setting_custom_field/mod.rs b/generated/stripe_billing/src/invoice_setting_custom_field/mod.rs new file mode 100644 index 000000000..8ca310256 --- /dev/null +++ b/generated/stripe_billing/src/invoice_setting_custom_field/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_setting_custom_field::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_setting_customer_setting/mod.rs b/generated/stripe_billing/src/invoice_setting_customer_setting/mod.rs new file mode 100644 index 000000000..3dc0e0cd7 --- /dev/null +++ b/generated/stripe_billing/src/invoice_setting_customer_setting/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_setting_customer_setting::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_setting_quote_setting/mod.rs b/generated/stripe_billing/src/invoice_setting_quote_setting/mod.rs new file mode 100644 index 000000000..1f3d52bd2 --- /dev/null +++ b/generated/stripe_billing/src/invoice_setting_quote_setting/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_setting_quote_setting::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_setting_rendering_options/mod.rs b/generated/stripe_billing/src/invoice_setting_rendering_options/mod.rs new file mode 100644 index 000000000..d7f60055a --- /dev/null +++ b/generated/stripe_billing/src/invoice_setting_rendering_options/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_setting_rendering_options::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_setting_subscription_schedule_phase_setting/mod.rs b/generated/stripe_billing/src/invoice_setting_subscription_schedule_phase_setting/mod.rs new file mode 100644 index 000000000..e0da1da38 --- /dev/null +++ b/generated/stripe_billing/src/invoice_setting_subscription_schedule_phase_setting/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_setting_subscription_schedule_phase_setting::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_setting_subscription_schedule_setting/mod.rs b/generated/stripe_billing/src/invoice_setting_subscription_schedule_setting/mod.rs new file mode 100644 index 000000000..a491bca09 --- /dev/null +++ b/generated/stripe_billing/src/invoice_setting_subscription_schedule_setting/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_setting_subscription_schedule_setting::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_tax_amount/mod.rs b/generated/stripe_billing/src/invoice_tax_amount/mod.rs new file mode 100644 index 000000000..fe805645b --- /dev/null +++ b/generated/stripe_billing/src/invoice_tax_amount/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_tax_amount::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_threshold_reason/mod.rs b/generated/stripe_billing/src/invoice_threshold_reason/mod.rs new file mode 100644 index 000000000..6af3b55df --- /dev/null +++ b/generated/stripe_billing/src/invoice_threshold_reason/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_threshold_reason::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoice_transfer_data/mod.rs b/generated/stripe_billing/src/invoice_transfer_data/mod.rs new file mode 100644 index 000000000..c74e160f7 --- /dev/null +++ b/generated/stripe_billing/src/invoice_transfer_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoice_transfer_data::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoices_from_invoice/mod.rs b/generated/stripe_billing/src/invoices_from_invoice/mod.rs new file mode 100644 index 000000000..35c68ec27 --- /dev/null +++ b/generated/stripe_billing/src/invoices_from_invoice/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoices_from_invoice::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoices_invoice_rendering/mod.rs b/generated/stripe_billing/src/invoices_invoice_rendering/mod.rs new file mode 100644 index 000000000..cb91004d1 --- /dev/null +++ b/generated/stripe_billing/src/invoices_invoice_rendering/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoices_invoice_rendering::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoices_payment_method_options/mod.rs b/generated/stripe_billing/src/invoices_payment_method_options/mod.rs new file mode 100644 index 000000000..1e9cfdd09 --- /dev/null +++ b/generated/stripe_billing/src/invoices_payment_method_options/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoices_payment_method_options::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoices_payment_settings/mod.rs b/generated/stripe_billing/src/invoices_payment_settings/mod.rs new file mode 100644 index 000000000..dbbbbf74e --- /dev/null +++ b/generated/stripe_billing/src/invoices_payment_settings/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoices_payment_settings::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoices_resource_invoice_tax_id/mod.rs b/generated/stripe_billing/src/invoices_resource_invoice_tax_id/mod.rs new file mode 100644 index 000000000..b32cadc51 --- /dev/null +++ b/generated/stripe_billing/src/invoices_resource_invoice_tax_id/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoices_resource_invoice_tax_id::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoices_resource_line_items_credited_items/mod.rs b/generated/stripe_billing/src/invoices_resource_line_items_credited_items/mod.rs new file mode 100644 index 000000000..b8e024a82 --- /dev/null +++ b/generated/stripe_billing/src/invoices_resource_line_items_credited_items/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoices_resource_line_items_credited_items::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoices_resource_line_items_proration_details/mod.rs b/generated/stripe_billing/src/invoices_resource_line_items_proration_details/mod.rs new file mode 100644 index 000000000..671103aaa --- /dev/null +++ b/generated/stripe_billing/src/invoices_resource_line_items_proration_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoices_resource_line_items_proration_details::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoices_shipping_cost/mod.rs b/generated/stripe_billing/src/invoices_shipping_cost/mod.rs new file mode 100644 index 000000000..3fc2b0e00 --- /dev/null +++ b/generated/stripe_billing/src/invoices_shipping_cost/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoices_shipping_cost::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/invoices_status_transitions/mod.rs b/generated/stripe_billing/src/invoices_status_transitions/mod.rs new file mode 100644 index 000000000..311585782 --- /dev/null +++ b/generated/stripe_billing/src/invoices_status_transitions/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::invoices_status_transitions::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/line_item/mod.rs b/generated/stripe_billing/src/line_item/mod.rs new file mode 100644 index 000000000..28a55a053 --- /dev/null +++ b/generated/stripe_billing/src/line_item/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::line_item::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/mod.rs b/generated/stripe_billing/src/mod.rs new file mode 100644 index 000000000..0d94322a9 --- /dev/null +++ b/generated/stripe_billing/src/mod.rs @@ -0,0 +1,158 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::invalid_html_tags)] +extern crate self as stripe_billing; +pub use stripe_types::AutomaticTax; +pub mod portal_configuration; +pub use portal_configuration::PortalConfiguration; +pub mod portal_session; +pub use portal_session::PortalSession; +pub use stripe_types::CancellationDetails; +pub use stripe_types::CreditNote; +pub mod credit_note; +pub use stripe_types::CreditNoteLineItem; +pub mod credit_note_line_item; +pub use stripe_types::CreditNoteTaxAmount; +pub use stripe_types::DeletedInvoice; +pub use stripe_types::DeletedInvoiceItem; +pub use stripe_types::DeletedPlan; +pub use stripe_types::DeletedSubscriptionItem; +pub use stripe_types::DeletedTaxId; +pub use stripe_types::DeletedTestClock; +pub use stripe_types::DiscountsResourceDiscountAmount; +pub use stripe_types::Invoice; +pub mod invoice; +pub use stripe_types::InvoiceInstallmentsCard; +pub use stripe_types::InvoiceItem; +pub use stripe_types::InvoiceItemThresholdReason; +pub use stripe_types::InvoiceLineItemPeriod; +pub use stripe_types::InvoiceMandateOptionsCard; +pub use stripe_types::InvoicePaymentMethodOptionsAcssDebit; +pub use stripe_types::InvoicePaymentMethodOptionsAcssDebitMandateOptions; +pub use stripe_types::InvoicePaymentMethodOptionsBancontact; +pub use stripe_types::InvoicePaymentMethodOptionsCard; +pub use stripe_types::InvoicePaymentMethodOptionsCustomerBalance; +pub use stripe_types::InvoicePaymentMethodOptionsCustomerBalanceBankTransfer; +pub use stripe_types::InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer; +pub use stripe_types::InvoicePaymentMethodOptionsKonbini; +pub use stripe_types::InvoicePaymentMethodOptionsUsBankAccount; +pub use stripe_types::InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptions; +pub use stripe_types::InvoiceRenderingPdf; +pub use stripe_types::InvoiceSettingCustomField; +pub use stripe_types::InvoiceSettingCustomerSetting; +pub use stripe_types::InvoiceSettingQuoteSetting; +pub use stripe_types::InvoiceSettingRenderingOptions; +pub use stripe_types::InvoiceSettingSubscriptionSchedulePhaseSetting; +pub use stripe_types::InvoiceSettingSubscriptionScheduleSetting; +pub use stripe_types::InvoiceTaxAmount; +pub use stripe_types::InvoiceThresholdReason; +pub use stripe_types::InvoiceTransferData; +pub mod invoice_item; +pub use stripe_types::InvoiceLineItem; +pub use stripe_types::InvoicesFromInvoice; +pub use stripe_types::InvoicesInvoiceRendering; +pub use stripe_types::InvoicesPaymentMethodOptions; +pub use stripe_types::InvoicesPaymentSettings; +pub use stripe_types::InvoicesResourceInvoiceTaxId; +pub use stripe_types::InvoicesResourceLineItemsCreditedItems; +pub use stripe_types::InvoicesResourceLineItemsProrationDetails; +pub use stripe_types::InvoicesShippingCost; +pub use stripe_types::InvoicesStatusTransitions; +pub use stripe_types::LineItem; +pub mod invoice_line_item; +pub use stripe_types::UsageRecordSummary; +pub mod usage_record_summary; +pub use stripe_types::Period; +pub use stripe_types::Plan; +pub mod plan; +pub use stripe_types::PlanTier; +pub mod portal_business_profile; +pub use portal_business_profile::PortalBusinessProfile; +pub mod portal_customer_update; +pub use portal_customer_update::PortalCustomerUpdate; +pub mod portal_features; +pub use portal_features::PortalFeatures; +pub mod portal_flows_after_completion_hosted_confirmation; +pub use portal_flows_after_completion_hosted_confirmation::PortalFlowsAfterCompletionHostedConfirmation; +pub mod portal_flows_after_completion_redirect; +pub use portal_flows_after_completion_redirect::PortalFlowsAfterCompletionRedirect; +pub mod portal_flows_coupon_offer; +pub use portal_flows_coupon_offer::PortalFlowsCouponOffer; +pub mod portal_flows_flow; +pub use portal_flows_flow::PortalFlowsFlow; +pub mod portal_flows_flow_after_completion; +pub use portal_flows_flow_after_completion::PortalFlowsFlowAfterCompletion; +pub mod portal_flows_flow_subscription_cancel; +pub use portal_flows_flow_subscription_cancel::PortalFlowsFlowSubscriptionCancel; +pub mod portal_flows_flow_subscription_update; +pub use portal_flows_flow_subscription_update::PortalFlowsFlowSubscriptionUpdate; +pub mod portal_flows_flow_subscription_update_confirm; +pub use portal_flows_flow_subscription_update_confirm::PortalFlowsFlowSubscriptionUpdateConfirm; +pub mod portal_flows_retention; +pub use portal_flows_retention::PortalFlowsRetention; +pub mod portal_flows_subscription_update_confirm_discount; +pub use portal_flows_subscription_update_confirm_discount::PortalFlowsSubscriptionUpdateConfirmDiscount; +pub mod portal_flows_subscription_update_confirm_item; +pub use portal_flows_subscription_update_confirm_item::PortalFlowsSubscriptionUpdateConfirmItem; +pub mod portal_invoice_list; +pub use portal_invoice_list::PortalInvoiceList; +pub mod portal_login_page; +pub use portal_login_page::PortalLoginPage; +pub mod portal_payment_method_update; +pub use portal_payment_method_update::PortalPaymentMethodUpdate; +pub mod portal_subscription_cancel; +pub use portal_subscription_cancel::PortalSubscriptionCancel; +pub mod portal_subscription_cancellation_reason; +pub use portal_subscription_cancellation_reason::PortalSubscriptionCancellationReason; +pub mod portal_subscription_pause; +pub use portal_subscription_pause::PortalSubscriptionPause; +pub mod portal_subscription_update; +pub use portal_subscription_update::PortalSubscriptionUpdate; +pub mod portal_subscription_update_product; +pub use portal_subscription_update_product::PortalSubscriptionUpdateProduct; +pub use stripe_types::Quote; +pub mod quote; +pub use stripe_types::QuotesResourceAutomaticTax; +pub use stripe_types::QuotesResourceComputed; +pub use stripe_types::QuotesResourceFromQuote; +pub use stripe_types::QuotesResourceRecurring; +pub use stripe_types::QuotesResourceStatusTransitions; +pub use stripe_types::QuotesResourceSubscriptionDataSubscriptionData; +pub use stripe_types::QuotesResourceTotalDetails; +pub use stripe_types::QuotesResourceTotalDetailsResourceBreakdown; +pub use stripe_types::QuotesResourceTransferData; +pub use stripe_types::QuotesResourceUpfront; +pub use stripe_types::SchedulesPhaseAutomaticTax; +pub mod usage_record; +pub use stripe_types::Subscription; +pub use usage_record::UsageRecord; +pub mod subscription; +pub use stripe_types::SubscriptionAutomaticTax; +pub use stripe_types::SubscriptionBillingThresholds; +pub use stripe_types::SubscriptionDetailsData; +pub use stripe_types::SubscriptionItem; +pub mod subscription_item; +pub use stripe_types::SubscriptionItemBillingThresholds; +pub use stripe_types::SubscriptionPaymentMethodOptionsCard; +pub use stripe_types::SubscriptionPendingInvoiceItemInterval; +pub use stripe_types::SubscriptionSchedule; +pub mod subscription_schedule; +pub use stripe_types::SubscriptionScheduleAddInvoiceItem; +pub use stripe_types::SubscriptionScheduleConfigurationItem; +pub use stripe_types::SubscriptionScheduleCurrentPhase; +pub use stripe_types::SubscriptionSchedulePhaseConfiguration; +pub use stripe_types::SubscriptionSchedulesResourceDefaultSettings; +pub use stripe_types::SubscriptionSchedulesResourceDefaultSettingsAutomaticTax; +pub use stripe_types::SubscriptionTransferData; +pub use stripe_types::SubscriptionsResourcePauseCollection; +pub use stripe_types::SubscriptionsResourcePaymentMethodOptions; +pub use stripe_types::SubscriptionsResourcePaymentSettings; +pub use stripe_types::SubscriptionsResourcePendingUpdate; +pub use stripe_types::SubscriptionsTrialsResourceEndBehavior; +pub use stripe_types::SubscriptionsTrialsResourceTrialSettings; +pub use stripe_types::TaxId; +pub mod tax_id; +pub use stripe_types::TaxIdVerification; +pub use stripe_types::TestClock; +pub mod test_clock; +pub use stripe_types::TransformUsage; diff --git a/generated/stripe_billing/src/period/mod.rs b/generated/stripe_billing/src/period/mod.rs new file mode 100644 index 000000000..6bf03017b --- /dev/null +++ b/generated/stripe_billing/src/period/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::period::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/plan/mod.rs b/generated/stripe_billing/src/plan/mod.rs new file mode 100644 index 000000000..8822259b5 --- /dev/null +++ b/generated/stripe_billing/src/plan/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::plan::*; +#[cfg(feature = "plan")] +mod requests; +#[cfg(feature = "plan")] +pub use requests::*; diff --git a/generated/stripe_billing/src/plan/requests.rs b/generated/stripe_billing/src/plan/requests.rs new file mode 100644 index 000000000..151a42393 --- /dev/null +++ b/generated/stripe_billing/src/plan/requests.rs @@ -0,0 +1,716 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPlan<'a> { + /// Only return plans that are active or inactive (e.g., pass `false` to list all inactive plans). + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// A filter on the list, based on the object `created` field. + /// + /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return plans for the given product. + #[serde(skip_serializing_if = "Option::is_none")] + pub product: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListPlan<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPlan<'a> { + /// Returns a list of your plans. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/plans", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/plans", self) + } +} +impl<'a> stripe::PaginationParams for ListPlan<'a> {} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePlan<'a> { + /// Whether the plan is currently available for new subscriptions. + /// + /// Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Specifies a usage aggregation strategy for plans of `usage_type=metered`. + /// + /// Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. + /// Defaults to `sum`. + #[serde(skip_serializing_if = "Option::is_none")] + pub aggregate_usage: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free plan) representing how much to charge on a recurring basis. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Same as `amount`, but accepts a decimal value with at most 12 decimal places. + /// + /// Only one of `amount` and `amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_decimal: Option<&'a str>, + /// Describes how to compute the price per period. + /// + /// Either `per_unit` or `tiered`. + /// `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). + /// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_scheme: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// An identifier randomly generated by Stripe. + /// + /// Used to identify this plan when subscribing a customer. + /// You can optionally override this ID, but the ID must be unique across all plans in your Stripe account. + /// You can, however, use the same plan ID in both live and test modes. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<&'a str>, + /// Specifies billing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + pub interval: CreatePlanInterval, + /// The number of intervals between subscription billings. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A brief description of the plan, hidden from customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub nickname: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub product: Option>, + /// Each element represents a pricing tier. + /// + /// This parameter requires `billing_scheme` to be set to `tiered`. + /// See also the documentation for `billing_scheme`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers: Option<&'a [CreatePlanTiers<'a>]>, + /// Defines if the tiering price should be `graduated` or `volume` based. + /// + /// In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers_mode: Option, + /// Apply a transformation to the reported usage or set quantity before computing the billed price. + /// + /// Cannot be combined with `tiers`. + #[serde(skip_serializing_if = "Option::is_none")] + pub transform_usage: Option, + /// Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_period_days: Option, + /// Configures how the quantity per period should be determined. + /// + /// Can be either `metered` or `licensed`. + /// `licensed` automatically bills the `quantity` set when adding it to a subscription. + /// `metered` aggregates the total usage based on usage records. + /// Defaults to `licensed`. + #[serde(skip_serializing_if = "Option::is_none")] + pub usage_type: Option, +} +impl<'a> CreatePlan<'a> { + pub fn new(currency: stripe_types::Currency, interval: CreatePlanInterval) -> Self { + Self { + active: Default::default(), + aggregate_usage: Default::default(), + amount: Default::default(), + amount_decimal: Default::default(), + billing_scheme: Default::default(), + currency, + expand: Default::default(), + id: Default::default(), + interval, + interval_count: Default::default(), + metadata: Default::default(), + nickname: Default::default(), + product: Default::default(), + tiers: Default::default(), + tiers_mode: Default::default(), + transform_usage: Default::default(), + trial_period_days: Default::default(), + usage_type: Default::default(), + } + } +} +/// Specifies a usage aggregation strategy for plans of `usage_type=metered`. +/// +/// Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. +/// Defaults to `sum`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePlanAggregateUsage { + LastDuringPeriod, + LastEver, + Max, + Sum, +} +impl CreatePlanAggregateUsage { + pub fn as_str(self) -> &'static str { + use CreatePlanAggregateUsage::*; + match self { + LastDuringPeriod => "last_during_period", + LastEver => "last_ever", + Max => "max", + Sum => "sum", + } + } +} + +impl std::str::FromStr for CreatePlanAggregateUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePlanAggregateUsage::*; + match s { + "last_during_period" => Ok(LastDuringPeriod), + "last_ever" => Ok(LastEver), + "max" => Ok(Max), + "sum" => Ok(Sum), + _ => Err(()), + } + } +} +impl AsRef for CreatePlanAggregateUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePlanAggregateUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePlanAggregateUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePlanAggregateUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Describes how to compute the price per period. +/// +/// Either `per_unit` or `tiered`. +/// `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). +/// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePlanBillingScheme { + PerUnit, + Tiered, +} +impl CreatePlanBillingScheme { + pub fn as_str(self) -> &'static str { + use CreatePlanBillingScheme::*; + match self { + PerUnit => "per_unit", + Tiered => "tiered", + } + } +} + +impl std::str::FromStr for CreatePlanBillingScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePlanBillingScheme::*; + match s { + "per_unit" => Ok(PerUnit), + "tiered" => Ok(Tiered), + _ => Err(()), + } + } +} +impl AsRef for CreatePlanBillingScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePlanBillingScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePlanBillingScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePlanBillingScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies billing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePlanInterval { + Day, + Month, + Week, + Year, +} +impl CreatePlanInterval { + pub fn as_str(self) -> &'static str { + use CreatePlanInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreatePlanInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePlanInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for CreatePlanInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePlanInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreatePlanProduct<'a> { + InlineProductParams(CreatePlanInlineProductParams<'a>), + Id(&'a str), +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePlanInlineProductParams<'a> { + /// Whether the product is currently available for purchase. + /// + /// Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// The identifier for the product. + /// + /// Must be unique. + /// If not provided, an identifier will be randomly generated. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The product's name, meant to be displayable to the customer. + pub name: &'a str, + /// An arbitrary string to be displayed on your customer's credit card or bank statement. + /// + /// While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. + /// The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. + /// Non-ASCII characters are automatically stripped. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// A label that represents units of this product. + /// + /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_label: Option<&'a str>, +} +impl<'a> CreatePlanInlineProductParams<'a> { + pub fn new(name: &'a str) -> Self { + Self { + active: Default::default(), + id: Default::default(), + metadata: Default::default(), + name, + statement_descriptor: Default::default(), + tax_code: Default::default(), + unit_label: Default::default(), + } + } +} +/// Each element represents a pricing tier. +/// +/// This parameter requires `billing_scheme` to be set to `tiered`. +/// See also the documentation for `billing_scheme`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePlanTiers<'a> { + /// The flat billing amount for an entire tier, regardless of the number of units in the tier. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount: Option, + /// Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. + /// + /// Only one of `flat_amount` and `flat_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount_decimal: Option<&'a str>, + /// The per unit billing amount for each individual unit for which this tier applies. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, + /// Specifies the upper bound of this tier. + /// + /// The lower bound of a tier is the upper bound of the previous tier adding one. + /// Use `inf` to define a fallback tier. + pub up_to: CreatePlanTiersUpTo, +} +impl<'a> CreatePlanTiers<'a> { + pub fn new(up_to: CreatePlanTiersUpTo) -> Self { + Self { + flat_amount: Default::default(), + flat_amount_decimal: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + up_to, + } + } +} +/// Specifies the upper bound of this tier. +/// +/// The lower bound of a tier is the upper bound of the previous tier adding one. +/// Use `inf` to define a fallback tier. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreatePlanTiersUpTo { + Inf, + I64(i64), +} +/// Defines if the tiering price should be `graduated` or `volume` based. +/// +/// In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePlanTiersMode { + Graduated, + Volume, +} +impl CreatePlanTiersMode { + pub fn as_str(self) -> &'static str { + use CreatePlanTiersMode::*; + match self { + Graduated => "graduated", + Volume => "volume", + } + } +} + +impl std::str::FromStr for CreatePlanTiersMode { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePlanTiersMode::*; + match s { + "graduated" => Ok(Graduated), + "volume" => Ok(Volume), + _ => Err(()), + } + } +} +impl AsRef for CreatePlanTiersMode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePlanTiersMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePlanTiersMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePlanTiersMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Apply a transformation to the reported usage or set quantity before computing the billed price. +/// +/// Cannot be combined with `tiers`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePlanTransformUsage { + /// Divide usage by this number. + pub divide_by: i64, + /// After division, either round the result `up` or `down`. + pub round: CreatePlanTransformUsageRound, +} +impl CreatePlanTransformUsage { + pub fn new(divide_by: i64, round: CreatePlanTransformUsageRound) -> Self { + Self { divide_by, round } + } +} +/// After division, either round the result `up` or `down`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePlanTransformUsageRound { + Down, + Up, +} +impl CreatePlanTransformUsageRound { + pub fn as_str(self) -> &'static str { + use CreatePlanTransformUsageRound::*; + match self { + Down => "down", + Up => "up", + } + } +} + +impl std::str::FromStr for CreatePlanTransformUsageRound { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePlanTransformUsageRound::*; + match s { + "down" => Ok(Down), + "up" => Ok(Up), + _ => Err(()), + } + } +} +impl AsRef for CreatePlanTransformUsageRound { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePlanTransformUsageRound { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePlanTransformUsageRound { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePlanTransformUsageRound { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configures how the quantity per period should be determined. +/// +/// Can be either `metered` or `licensed`. +/// `licensed` automatically bills the `quantity` set when adding it to a subscription. +/// `metered` aggregates the total usage based on usage records. +/// Defaults to `licensed`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePlanUsageType { + Licensed, + Metered, +} +impl CreatePlanUsageType { + pub fn as_str(self) -> &'static str { + use CreatePlanUsageType::*; + match self { + Licensed => "licensed", + Metered => "metered", + } + } +} + +impl std::str::FromStr for CreatePlanUsageType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePlanUsageType::*; + match s { + "licensed" => Ok(Licensed), + "metered" => Ok(Metered), + _ => Err(()), + } + } +} +impl AsRef for CreatePlanUsageType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePlanUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePlanUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePlanUsageType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreatePlan<'a> { + /// You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). + /// + /// It replaces the Plans API and is backwards compatible to simplify your migration. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/plans", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePlan<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePlan<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePlan<'a> { + /// Retrieves the plan with the given ID. + pub fn send( + &self, + client: &stripe::Client, + plan: &stripe_types::plan::PlanId, + ) -> stripe::Response { + client.get_query(&format!("/plans/{plan}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePlan<'a> { + /// Whether the plan is currently available for new subscriptions. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A brief description of the plan, hidden from customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub nickname: Option<&'a str>, + /// The product the plan belongs to. + /// + /// This cannot be changed once it has been used in a subscription or subscription schedule. + #[serde(skip_serializing_if = "Option::is_none")] + pub product: Option<&'a str>, + /// Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_period_days: Option, +} +impl<'a> UpdatePlan<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdatePlan<'a> { + /// Updates the specified plan by setting the values of the parameters passed. + /// + /// Any parameters not provided are left unchanged. + /// By design, you cannot change a plan’s ID, amount, currency, or billing cycle. + pub fn send( + &self, + client: &stripe::Client, + plan: &stripe_types::plan::PlanId, + ) -> stripe::Response { + client.send_form(&format!("/plans/{plan}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeletePlan {} +impl DeletePlan { + pub fn new() -> Self { + Self::default() + } +} +impl DeletePlan { + /// Deleting plans means new subscribers can’t be added. + /// + /// Existing subscribers aren’t affected. + pub fn send( + &self, + client: &stripe::Client, + plan: &stripe_types::plan::PlanId, + ) -> stripe::Response { + client.send_form(&format!("/plans/{plan}"), self, http_types::Method::Delete) + } +} diff --git a/generated/stripe_billing/src/plan_tier/mod.rs b/generated/stripe_billing/src/plan_tier/mod.rs new file mode 100644 index 000000000..9d7fdad73 --- /dev/null +++ b/generated/stripe_billing/src/plan_tier/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::plan_tier::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/portal_business_profile/mod.rs b/generated/stripe_billing/src/portal_business_profile/mod.rs new file mode 100644 index 000000000..3252be5c4 --- /dev/null +++ b/generated/stripe_billing/src/portal_business_profile/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PortalBusinessProfile { + /// The messaging shown to customers in the portal. + pub headline: Option, + /// A link to the business’s publicly available privacy policy. + pub privacy_policy_url: Option, + /// A link to the business’s publicly available terms of service. + pub terms_of_service_url: Option, +} diff --git a/generated/stripe_billing/src/portal_configuration/mod.rs b/generated/stripe_billing/src/portal_configuration/mod.rs new file mode 100644 index 000000000..c89d8936a --- /dev/null +++ b/generated/stripe_billing/src/portal_configuration/mod.rs @@ -0,0 +1,46 @@ +/// A portal configuration describes the functionality and behavior of a portal session. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalConfiguration { + /// Whether the configuration is active and can be used to create portal sessions. + pub active: bool, + /// ID of the Connect Application that created the configuration. + pub application: Option>, + pub business_profile: stripe_billing::PortalBusinessProfile, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The default URL to redirect customers to when they click on the portal's link to return to your website. + /// + /// This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. + pub default_return_url: Option, + pub features: stripe_billing::PortalFeatures, + /// Unique identifier for the object. + pub id: stripe_billing::portal_configuration::BillingPortalConfigurationId, + /// Whether the configuration is the default. + /// + /// If `true`, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session. + pub is_default: bool, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + pub login_page: stripe_billing::PortalLoginPage, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// Time at which the object was last updated. + /// + /// Measured in seconds since the Unix epoch. + pub updated: stripe_types::Timestamp, +} +impl stripe_types::Object for PortalConfiguration { + type Id = stripe_billing::portal_configuration::BillingPortalConfigurationId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(BillingPortalConfigurationId, "bpc_"); +#[cfg(feature = "portal_configuration")] +mod requests; +#[cfg(feature = "portal_configuration")] +pub use requests::*; diff --git a/generated/stripe_billing/src/portal_configuration/requests.rs b/generated/stripe_billing/src/portal_configuration/requests.rs new file mode 100644 index 000000000..33ba3583c --- /dev/null +++ b/generated/stripe_billing/src/portal_configuration/requests.rs @@ -0,0 +1,1292 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPortalConfiguration<'a> { + /// Only return configurations that are active or inactive (e.g., pass `true` to only list active configurations). + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Only return the default or non-default configurations (e.g., pass `true` to only list the default configuration). + #[serde(skip_serializing_if = "Option::is_none")] + pub is_default: Option, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListPortalConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPortalConfiguration<'a> { + /// Returns a list of configurations that describe the functionality of the customer portal. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/billing_portal/configurations", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/billing_portal/configurations", self) + } +} +impl<'a> stripe::PaginationParams for ListPortalConfiguration<'a> {} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalConfiguration<'a> { + /// The business information shown to customers in the portal. + pub business_profile: CreatePortalConfigurationBusinessProfile<'a>, + /// The default URL to redirect customers to when they click on the portal's link to return to your website. + /// + /// This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_return_url: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Information about the features available in the portal. + pub features: CreatePortalConfigurationFeatures<'a>, + /// The hosted login page for this configuration. + /// + /// Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). + #[serde(skip_serializing_if = "Option::is_none")] + pub login_page: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> CreatePortalConfiguration<'a> { + pub fn new( + business_profile: CreatePortalConfigurationBusinessProfile<'a>, + features: CreatePortalConfigurationFeatures<'a>, + ) -> Self { + Self { + business_profile, + default_return_url: Default::default(), + expand: Default::default(), + features, + login_page: Default::default(), + metadata: Default::default(), + } + } +} +/// The business information shown to customers in the portal. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePortalConfigurationBusinessProfile<'a> { + /// The messaging shown to customers in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub headline: Option<&'a str>, + /// A link to the business’s publicly available privacy policy. + #[serde(skip_serializing_if = "Option::is_none")] + pub privacy_policy_url: Option<&'a str>, + /// A link to the business’s publicly available terms of service. + #[serde(skip_serializing_if = "Option::is_none")] + pub terms_of_service_url: Option<&'a str>, +} +impl<'a> CreatePortalConfigurationBusinessProfile<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about the features available in the portal. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePortalConfigurationFeatures<'a> { + /// Information about updating the customer details in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_update: Option>, + /// Information about showing the billing history in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_history: Option, + /// Information about updating payment methods in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_update: Option, + /// Information about canceling subscriptions in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel: Option>, + /// Information about pausing subscriptions in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_pause: Option, + /// Information about updating subscriptions in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_update: Option>, +} +impl<'a> CreatePortalConfigurationFeatures<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about updating the customer details in the portal. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalConfigurationFeaturesCustomerUpdate<'a> { + /// The types of customer updates that are supported. + /// + /// When empty, customers are not updateable. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_updates: + Option<&'a [CreatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates]>, + /// Whether the feature is enabled. + pub enabled: bool, +} +impl<'a> CreatePortalConfigurationFeaturesCustomerUpdate<'a> { + pub fn new(enabled: bool) -> Self { + Self { allowed_updates: Default::default(), enabled } + } +} +/// The types of customer updates that are supported. +/// +/// When empty, customers are not updateable. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + Address, + Email, + Name, + Phone, + Shipping, + TaxId, +} +impl CreatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + pub fn as_str(self) -> &'static str { + use CreatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates::*; + match self { + Address => "address", + Email => "email", + Name => "name", + Phone => "phone", + Shipping => "shipping", + TaxId => "tax_id", + } + } +} + +impl std::str::FromStr for CreatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates::*; + match s { + "address" => Ok(Address), + "email" => Ok(Email), + "name" => Ok(Name), + "phone" => Ok(Phone), + "shipping" => Ok(Shipping), + "tax_id" => Ok(TaxId), + _ => Err(()), + } + } +} +impl AsRef for CreatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about showing the billing history in the portal. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalConfigurationFeaturesInvoiceHistory { + /// Whether the feature is enabled. + pub enabled: bool, +} +impl CreatePortalConfigurationFeaturesInvoiceHistory { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Information about updating payment methods in the portal. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalConfigurationFeaturesPaymentMethodUpdate { + /// Whether the feature is enabled. + pub enabled: bool, +} +impl CreatePortalConfigurationFeaturesPaymentMethodUpdate { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Information about canceling subscriptions in the portal. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalConfigurationFeaturesSubscriptionCancel<'a> { + /// Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: + Option>, + /// Whether the feature is enabled. + pub enabled: bool, + /// Whether to cancel subscriptions immediately or at the end of the billing period. + #[serde(skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// Whether to create prorations when canceling subscriptions. + /// + /// Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. + /// No prorations are generated when canceling a subscription at the end of its natural billing period. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: + Option, +} +impl<'a> CreatePortalConfigurationFeaturesSubscriptionCancel<'a> { + pub fn new(enabled: bool) -> Self { + Self { + cancellation_reason: Default::default(), + enabled, + mode: Default::default(), + proration_behavior: Default::default(), + } + } +} +/// Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalConfigurationFeaturesSubscriptionCancelCancellationReason<'a> { + /// Whether the feature is enabled. + pub enabled: bool, + /// Which cancellation reasons will be given as options to the customer. + pub options: + &'a [CreatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions], +} +impl<'a> CreatePortalConfigurationFeaturesSubscriptionCancelCancellationReason<'a> { + pub fn new( + enabled: bool, + options: &'a [CreatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions], + ) -> Self { + Self { enabled, options } + } +} +/// Which cancellation reasons will be given as options to the customer. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions { + CustomerService, + LowQuality, + MissingFeatures, + Other, + SwitchedService, + TooComplex, + TooExpensive, + Unused, +} +impl CreatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions { + pub fn as_str(self) -> &'static str { + use CreatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions::*; + match self { + CustomerService => "customer_service", + LowQuality => "low_quality", + MissingFeatures => "missing_features", + Other => "other", + SwitchedService => "switched_service", + TooComplex => "too_complex", + TooExpensive => "too_expensive", + Unused => "unused", + } + } +} + +impl std::str::FromStr + for CreatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions::*; + match s { + "customer_service" => Ok(CustomerService), + "low_quality" => Ok(LowQuality), + "missing_features" => Ok(MissingFeatures), + "other" => Ok(Other), + "switched_service" => Ok(SwitchedService), + "too_complex" => Ok(TooComplex), + "too_expensive" => Ok(TooExpensive), + "unused" => Ok(Unused), + _ => Err(()), + } + } +} +impl AsRef for CreatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether to cancel subscriptions immediately or at the end of the billing period. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePortalConfigurationFeaturesSubscriptionCancelMode { + AtPeriodEnd, + Immediately, +} +impl CreatePortalConfigurationFeaturesSubscriptionCancelMode { + pub fn as_str(self) -> &'static str { + use CreatePortalConfigurationFeaturesSubscriptionCancelMode::*; + match self { + AtPeriodEnd => "at_period_end", + Immediately => "immediately", + } + } +} + +impl std::str::FromStr for CreatePortalConfigurationFeaturesSubscriptionCancelMode { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePortalConfigurationFeaturesSubscriptionCancelMode::*; + match s { + "at_period_end" => Ok(AtPeriodEnd), + "immediately" => Ok(Immediately), + _ => Err(()), + } + } +} +impl AsRef for CreatePortalConfigurationFeaturesSubscriptionCancelMode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePortalConfigurationFeaturesSubscriptionCancelMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePortalConfigurationFeaturesSubscriptionCancelMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePortalConfigurationFeaturesSubscriptionCancelMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether to create prorations when canceling subscriptions. +/// +/// Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. +/// No prorations are generated when canceling a subscription at the end of its natural billing period. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl CreatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + pub fn as_str(self) -> &'static str { + use CreatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for CreatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about pausing subscriptions in the portal. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePortalConfigurationFeaturesSubscriptionPause { + /// Whether the feature is enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} +impl CreatePortalConfigurationFeaturesSubscriptionPause { + pub fn new() -> Self { + Self::default() + } +} +/// Information about updating subscriptions in the portal. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalConfigurationFeaturesSubscriptionUpdate<'a> { + /// The types of subscription updates that are supported. + /// + /// When empty, subscriptions are not updateable. + pub default_allowed_updates: + &'a [CreatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates], + /// Whether the feature is enabled. + pub enabled: bool, + /// The list of up to 10 products that support subscription updates. + pub products: &'a [CreatePortalConfigurationFeaturesSubscriptionUpdateProducts<'a>], + /// Determines how to handle prorations resulting from subscription updates. + /// + /// Valid values are `none`, `create_prorations`, and `always_invoice`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: + Option, +} +impl<'a> CreatePortalConfigurationFeaturesSubscriptionUpdate<'a> { + pub fn new( + default_allowed_updates: &'a [CreatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates], + enabled: bool, + products: &'a [CreatePortalConfigurationFeaturesSubscriptionUpdateProducts<'a>], + ) -> Self { + Self { default_allowed_updates, enabled, products, proration_behavior: Default::default() } + } +} +/// The types of subscription updates that are supported. +/// +/// When empty, subscriptions are not updateable. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates { + Price, + PromotionCode, + Quantity, +} +impl CreatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates { + pub fn as_str(self) -> &'static str { + use CreatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates::*; + match self { + Price => "price", + PromotionCode => "promotion_code", + Quantity => "quantity", + } + } +} + +impl std::str::FromStr + for CreatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates::*; + match s { + "price" => Ok(Price), + "promotion_code" => Ok(PromotionCode), + "quantity" => Ok(Quantity), + _ => Err(()), + } + } +} +impl AsRef for CreatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of up to 10 products that support subscription updates. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalConfigurationFeaturesSubscriptionUpdateProducts<'a> { + /// The list of price IDs for the product that a subscription can be updated to. + pub prices: &'a [&'a str], + /// The product id. + pub product: &'a str, +} +impl<'a> CreatePortalConfigurationFeaturesSubscriptionUpdateProducts<'a> { + pub fn new(prices: &'a [&'a str], product: &'a str) -> Self { + Self { prices, product } + } +} +/// Determines how to handle prorations resulting from subscription updates. +/// +/// Valid values are `none`, `create_prorations`, and `always_invoice`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl CreatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + pub fn as_str(self) -> &'static str { + use CreatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for CreatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The hosted login page for this configuration. +/// +/// Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalConfigurationLoginPage { + /// Set to `true` to generate a shareable URL [`login_page.url`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-login_page-url) that will take your customers to a hosted login page for the customer portal. + pub enabled: bool, +} +impl CreatePortalConfigurationLoginPage { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +impl<'a> CreatePortalConfiguration<'a> { + /// Creates a configuration that describes the functionality and behavior of a PortalSession. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/billing_portal/configurations", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePortalConfiguration<'a> { + /// Whether the configuration is active and can be used to create portal sessions. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// The business information shown to customers in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub business_profile: Option>, + /// The default URL to redirect customers to when they click on the portal's link to return to your website. + /// + /// This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_return_url: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Information about the features available in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option>, + /// The hosted login page for this configuration. + /// + /// Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). + #[serde(skip_serializing_if = "Option::is_none")] + pub login_page: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdatePortalConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The business information shown to customers in the portal. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePortalConfigurationBusinessProfile<'a> { + /// The messaging shown to customers in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub headline: Option<&'a str>, + /// A link to the business’s publicly available privacy policy. + #[serde(skip_serializing_if = "Option::is_none")] + pub privacy_policy_url: Option<&'a str>, + /// A link to the business’s publicly available terms of service. + #[serde(skip_serializing_if = "Option::is_none")] + pub terms_of_service_url: Option<&'a str>, +} +impl<'a> UpdatePortalConfigurationBusinessProfile<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about the features available in the portal. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePortalConfigurationFeatures<'a> { + /// Information about updating the customer details in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_update: Option>, + /// Information about showing the billing history in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_history: Option, + /// Information about updating payment methods in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_update: Option, + /// Information about canceling subscriptions in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel: Option>, + /// Information about pausing subscriptions in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_pause: Option, + /// Information about updating subscriptions in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_update: Option>, +} +impl<'a> UpdatePortalConfigurationFeatures<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about updating the customer details in the portal. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePortalConfigurationFeaturesCustomerUpdate<'a> { + /// The types of customer updates that are supported. + /// + /// When empty, customers are not updateable. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_updates: + Option<&'a [UpdatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates]>, + /// Whether the feature is enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} +impl<'a> UpdatePortalConfigurationFeaturesCustomerUpdate<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The types of customer updates that are supported. +/// +/// When empty, customers are not updateable. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + Address, + Email, + Name, + Phone, + Shipping, + TaxId, +} +impl UpdatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + pub fn as_str(self) -> &'static str { + use UpdatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates::*; + match self { + Address => "address", + Email => "email", + Name => "name", + Phone => "phone", + Shipping => "shipping", + TaxId => "tax_id", + } + } +} + +impl std::str::FromStr for UpdatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates::*; + match s { + "address" => Ok(Address), + "email" => Ok(Email), + "name" => Ok(Name), + "phone" => Ok(Phone), + "shipping" => Ok(Shipping), + "tax_id" => Ok(TaxId), + _ => Err(()), + } + } +} +impl AsRef for UpdatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about showing the billing history in the portal. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePortalConfigurationFeaturesInvoiceHistory { + /// Whether the feature is enabled. + pub enabled: bool, +} +impl UpdatePortalConfigurationFeaturesInvoiceHistory { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Information about updating payment methods in the portal. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePortalConfigurationFeaturesPaymentMethodUpdate { + /// Whether the feature is enabled. + pub enabled: bool, +} +impl UpdatePortalConfigurationFeaturesPaymentMethodUpdate { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Information about canceling subscriptions in the portal. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePortalConfigurationFeaturesSubscriptionCancel<'a> { + /// Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: + Option>, + /// Whether the feature is enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// Whether to cancel subscriptions immediately or at the end of the billing period. + #[serde(skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// Whether to create prorations when canceling subscriptions. + /// + /// Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. + /// No prorations are generated when canceling a subscription at the end of its natural billing period. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: + Option, +} +impl<'a> UpdatePortalConfigurationFeaturesSubscriptionCancel<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePortalConfigurationFeaturesSubscriptionCancelCancellationReason<'a> { + /// Whether the feature is enabled. + pub enabled: bool, + /// Which cancellation reasons will be given as options to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub options: + Option<&'a [UpdatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions]>, +} +impl<'a> UpdatePortalConfigurationFeaturesSubscriptionCancelCancellationReason<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, options: Default::default() } + } +} +/// Which cancellation reasons will be given as options to the customer. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions { + CustomerService, + LowQuality, + MissingFeatures, + Other, + SwitchedService, + TooComplex, + TooExpensive, + Unused, +} +impl UpdatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions { + pub fn as_str(self) -> &'static str { + use UpdatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions::*; + match self { + CustomerService => "customer_service", + LowQuality => "low_quality", + MissingFeatures => "missing_features", + Other => "other", + SwitchedService => "switched_service", + TooComplex => "too_complex", + TooExpensive => "too_expensive", + Unused => "unused", + } + } +} + +impl std::str::FromStr + for UpdatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions::*; + match s { + "customer_service" => Ok(CustomerService), + "low_quality" => Ok(LowQuality), + "missing_features" => Ok(MissingFeatures), + "other" => Ok(Other), + "switched_service" => Ok(SwitchedService), + "too_complex" => Ok(TooComplex), + "too_expensive" => Ok(TooExpensive), + "unused" => Ok(Unused), + _ => Err(()), + } + } +} +impl AsRef for UpdatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether to cancel subscriptions immediately or at the end of the billing period. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePortalConfigurationFeaturesSubscriptionCancelMode { + AtPeriodEnd, + Immediately, +} +impl UpdatePortalConfigurationFeaturesSubscriptionCancelMode { + pub fn as_str(self) -> &'static str { + use UpdatePortalConfigurationFeaturesSubscriptionCancelMode::*; + match self { + AtPeriodEnd => "at_period_end", + Immediately => "immediately", + } + } +} + +impl std::str::FromStr for UpdatePortalConfigurationFeaturesSubscriptionCancelMode { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePortalConfigurationFeaturesSubscriptionCancelMode::*; + match s { + "at_period_end" => Ok(AtPeriodEnd), + "immediately" => Ok(Immediately), + _ => Err(()), + } + } +} +impl AsRef for UpdatePortalConfigurationFeaturesSubscriptionCancelMode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePortalConfigurationFeaturesSubscriptionCancelMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePortalConfigurationFeaturesSubscriptionCancelMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePortalConfigurationFeaturesSubscriptionCancelMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether to create prorations when canceling subscriptions. +/// +/// Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. +/// No prorations are generated when canceling a subscription at the end of its natural billing period. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl UpdatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + pub fn as_str(self) -> &'static str { + use UpdatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about pausing subscriptions in the portal. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePortalConfigurationFeaturesSubscriptionPause { + /// Whether the feature is enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} +impl UpdatePortalConfigurationFeaturesSubscriptionPause { + pub fn new() -> Self { + Self::default() + } +} +/// Information about updating subscriptions in the portal. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePortalConfigurationFeaturesSubscriptionUpdate<'a> { + /// The types of subscription updates that are supported. + /// + /// When empty, subscriptions are not updateable. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_allowed_updates: + Option<&'a [UpdatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates]>, + /// Whether the feature is enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// The list of up to 10 products that support subscription updates. + #[serde(skip_serializing_if = "Option::is_none")] + pub products: Option<&'a [UpdatePortalConfigurationFeaturesSubscriptionUpdateProducts<'a>]>, + /// Determines how to handle prorations resulting from subscription updates. + /// + /// Valid values are `none`, `create_prorations`, and `always_invoice`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: + Option, +} +impl<'a> UpdatePortalConfigurationFeaturesSubscriptionUpdate<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The types of subscription updates that are supported. +/// +/// When empty, subscriptions are not updateable. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates { + Price, + PromotionCode, + Quantity, +} +impl UpdatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates { + pub fn as_str(self) -> &'static str { + use UpdatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates::*; + match self { + Price => "price", + PromotionCode => "promotion_code", + Quantity => "quantity", + } + } +} + +impl std::str::FromStr + for UpdatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates::*; + match s { + "price" => Ok(Price), + "promotion_code" => Ok(PromotionCode), + "quantity" => Ok(Quantity), + _ => Err(()), + } + } +} +impl AsRef for UpdatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of up to 10 products that support subscription updates. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePortalConfigurationFeaturesSubscriptionUpdateProducts<'a> { + /// The list of price IDs for the product that a subscription can be updated to. + pub prices: &'a [&'a str], + /// The product id. + pub product: &'a str, +} +impl<'a> UpdatePortalConfigurationFeaturesSubscriptionUpdateProducts<'a> { + pub fn new(prices: &'a [&'a str], product: &'a str) -> Self { + Self { prices, product } + } +} +/// Determines how to handle prorations resulting from subscription updates. +/// +/// Valid values are `none`, `create_prorations`, and `always_invoice`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl UpdatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + pub fn as_str(self) -> &'static str { + use UpdatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The hosted login page for this configuration. +/// +/// Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePortalConfigurationLoginPage { + /// Set to `true` to generate a shareable URL [`login_page.url`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-login_page-url) that will take your customers to a hosted login page for the customer portal. + /// + /// Set to `false` to deactivate the `login_page.url`. + pub enabled: bool, +} +impl UpdatePortalConfigurationLoginPage { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +impl<'a> UpdatePortalConfiguration<'a> { + /// Updates a configuration that describes the functionality of the customer portal. + pub fn send( + &self, + client: &stripe::Client, + configuration: &str, + ) -> stripe::Response { + client.send_form( + &format!("/billing_portal/configurations/{configuration}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePortalConfiguration<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePortalConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePortalConfiguration<'a> { + /// Retrieves a configuration that describes the functionality of the customer portal. + pub fn send( + &self, + client: &stripe::Client, + configuration: &str, + ) -> stripe::Response { + client.get_query(&format!("/billing_portal/configurations/{configuration}"), self) + } +} diff --git a/generated/stripe_billing/src/portal_customer_update/mod.rs b/generated/stripe_billing/src/portal_customer_update/mod.rs new file mode 100644 index 000000000..0783b5f89 --- /dev/null +++ b/generated/stripe_billing/src/portal_customer_update/mod.rs @@ -0,0 +1,83 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalCustomerUpdate { + /// The types of customer updates that are supported. + /// + /// When empty, customers are not updateable. + pub allowed_updates: Vec, + /// Whether the feature is enabled. + pub enabled: bool, +} +/// The types of customer updates that are supported. +/// +/// When empty, customers are not updateable. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalCustomerUpdateAllowedUpdates { + Address, + Email, + Name, + Phone, + Shipping, + TaxId, +} +impl PortalCustomerUpdateAllowedUpdates { + pub fn as_str(self) -> &'static str { + use PortalCustomerUpdateAllowedUpdates::*; + match self { + Address => "address", + Email => "email", + Name => "name", + Phone => "phone", + Shipping => "shipping", + TaxId => "tax_id", + } + } +} + +impl std::str::FromStr for PortalCustomerUpdateAllowedUpdates { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalCustomerUpdateAllowedUpdates::*; + match s { + "address" => Ok(Address), + "email" => Ok(Email), + "name" => Ok(Name), + "phone" => Ok(Phone), + "shipping" => Ok(Shipping), + "tax_id" => Ok(TaxId), + _ => Err(()), + } + } +} +impl AsRef for PortalCustomerUpdateAllowedUpdates { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PortalCustomerUpdateAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalCustomerUpdateAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalCustomerUpdateAllowedUpdates { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalCustomerUpdateAllowedUpdates { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PortalCustomerUpdateAllowedUpdates") + }) + } +} diff --git a/generated/stripe_billing/src/portal_features/mod.rs b/generated/stripe_billing/src/portal_features/mod.rs new file mode 100644 index 000000000..e5ad9e671 --- /dev/null +++ b/generated/stripe_billing/src/portal_features/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFeatures { + pub customer_update: stripe_billing::PortalCustomerUpdate, + pub invoice_history: stripe_billing::PortalInvoiceList, + pub payment_method_update: stripe_billing::PortalPaymentMethodUpdate, + pub subscription_cancel: stripe_billing::PortalSubscriptionCancel, + pub subscription_pause: stripe_billing::PortalSubscriptionPause, + pub subscription_update: stripe_billing::PortalSubscriptionUpdate, +} diff --git a/generated/stripe_billing/src/portal_flows_after_completion_hosted_confirmation/mod.rs b/generated/stripe_billing/src/portal_flows_after_completion_hosted_confirmation/mod.rs new file mode 100644 index 000000000..1c65b58ad --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_after_completion_hosted_confirmation/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsAfterCompletionHostedConfirmation { + /// A custom message to display to the customer after the flow is completed. + pub custom_message: Option, +} diff --git a/generated/stripe_billing/src/portal_flows_after_completion_redirect/mod.rs b/generated/stripe_billing/src/portal_flows_after_completion_redirect/mod.rs new file mode 100644 index 000000000..e8a4b2d5c --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_after_completion_redirect/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsAfterCompletionRedirect { + /// The URL the customer will be redirected to after the flow is completed. + pub return_url: String, +} diff --git a/generated/stripe_billing/src/portal_flows_coupon_offer/mod.rs b/generated/stripe_billing/src/portal_flows_coupon_offer/mod.rs new file mode 100644 index 000000000..d56e0fd0f --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_coupon_offer/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsCouponOffer { + /// The ID of the coupon to be offered. + pub coupon: String, +} diff --git a/generated/stripe_billing/src/portal_flows_flow/mod.rs b/generated/stripe_billing/src/portal_flows_flow/mod.rs new file mode 100644 index 000000000..5d15d8132 --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_flow/mod.rs @@ -0,0 +1,79 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsFlow { + pub after_completion: stripe_billing::PortalFlowsFlowAfterCompletion, + /// Configuration when `flow.type=subscription_cancel`. + pub subscription_cancel: Option, + /// Configuration when `flow.type=subscription_update`. + pub subscription_update: Option, + /// Configuration when `flow.type=subscription_update_confirm`. + pub subscription_update_confirm: + Option, + /// Type of flow that the customer will go through. + #[serde(rename = "type")] + pub type_: PortalFlowsFlowType, +} +/// Type of flow that the customer will go through. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalFlowsFlowType { + PaymentMethodUpdate, + SubscriptionCancel, + SubscriptionUpdate, + SubscriptionUpdateConfirm, +} +impl PortalFlowsFlowType { + pub fn as_str(self) -> &'static str { + use PortalFlowsFlowType::*; + match self { + PaymentMethodUpdate => "payment_method_update", + SubscriptionCancel => "subscription_cancel", + SubscriptionUpdate => "subscription_update", + SubscriptionUpdateConfirm => "subscription_update_confirm", + } + } +} + +impl std::str::FromStr for PortalFlowsFlowType { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalFlowsFlowType::*; + match s { + "payment_method_update" => Ok(PaymentMethodUpdate), + "subscription_cancel" => Ok(SubscriptionCancel), + "subscription_update" => Ok(SubscriptionUpdate), + "subscription_update_confirm" => Ok(SubscriptionUpdateConfirm), + _ => Err(()), + } + } +} +impl AsRef for PortalFlowsFlowType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PortalFlowsFlowType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalFlowsFlowType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalFlowsFlowType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalFlowsFlowType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PortalFlowsFlowType")) + } +} diff --git a/generated/stripe_billing/src/portal_flows_flow_after_completion/mod.rs b/generated/stripe_billing/src/portal_flows_flow_after_completion/mod.rs new file mode 100644 index 000000000..411d8bb30 --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_flow_after_completion/mod.rs @@ -0,0 +1,73 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsFlowAfterCompletion { + /// Configuration when `after_completion.type=hosted_confirmation`. + pub hosted_confirmation: Option, + /// Configuration when `after_completion.type=redirect`. + pub redirect: Option, + /// The specified type of behavior after the flow is completed. + #[serde(rename = "type")] + pub type_: PortalFlowsFlowAfterCompletionType, +} +/// The specified type of behavior after the flow is completed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalFlowsFlowAfterCompletionType { + HostedConfirmation, + PortalHomepage, + Redirect, +} +impl PortalFlowsFlowAfterCompletionType { + pub fn as_str(self) -> &'static str { + use PortalFlowsFlowAfterCompletionType::*; + match self { + HostedConfirmation => "hosted_confirmation", + PortalHomepage => "portal_homepage", + Redirect => "redirect", + } + } +} + +impl std::str::FromStr for PortalFlowsFlowAfterCompletionType { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalFlowsFlowAfterCompletionType::*; + match s { + "hosted_confirmation" => Ok(HostedConfirmation), + "portal_homepage" => Ok(PortalHomepage), + "redirect" => Ok(Redirect), + _ => Err(()), + } + } +} +impl AsRef for PortalFlowsFlowAfterCompletionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PortalFlowsFlowAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalFlowsFlowAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalFlowsFlowAfterCompletionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalFlowsFlowAfterCompletionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PortalFlowsFlowAfterCompletionType") + }) + } +} diff --git a/generated/stripe_billing/src/portal_flows_flow_subscription_cancel/mod.rs b/generated/stripe_billing/src/portal_flows_flow_subscription_cancel/mod.rs new file mode 100644 index 000000000..64d6de5d8 --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_flow_subscription_cancel/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsFlowSubscriptionCancel { + /// Specify a retention strategy to be used in the cancellation flow. + pub retention: Option, + /// The ID of the subscription to be canceled. + pub subscription: String, +} diff --git a/generated/stripe_billing/src/portal_flows_flow_subscription_update/mod.rs b/generated/stripe_billing/src/portal_flows_flow_subscription_update/mod.rs new file mode 100644 index 000000000..36545392d --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_flow_subscription_update/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsFlowSubscriptionUpdate { + /// The ID of the subscription to be updated. + pub subscription: String, +} diff --git a/generated/stripe_billing/src/portal_flows_flow_subscription_update_confirm/mod.rs b/generated/stripe_billing/src/portal_flows_flow_subscription_update_confirm/mod.rs new file mode 100644 index 000000000..bbd009565 --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_flow_subscription_update_confirm/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsFlowSubscriptionUpdateConfirm { + /// The coupon or promotion code to apply to this subscription update. + /// + /// Currently, only up to one may be specified. + pub discounts: Option>, + /// The [subscription item](https://stripe.com/docs/api/subscription_items) to be updated through this flow. + /// + /// Currently, only up to one may be specified and subscriptions with multiple items are not updatable. + pub items: Vec, + /// The ID of the subscription to be updated. + pub subscription: String, +} diff --git a/generated/stripe_billing/src/portal_flows_retention/mod.rs b/generated/stripe_billing/src/portal_flows_retention/mod.rs new file mode 100644 index 000000000..797b08ae3 --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_retention/mod.rs @@ -0,0 +1,64 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsRetention { + /// Configuration when `retention.type=coupon_offer`. + pub coupon_offer: Option, + /// Type of retention strategy that will be used. + #[serde(rename = "type")] + pub type_: PortalFlowsRetentionType, +} +/// Type of retention strategy that will be used. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalFlowsRetentionType { + CouponOffer, +} +impl PortalFlowsRetentionType { + pub fn as_str(self) -> &'static str { + use PortalFlowsRetentionType::*; + match self { + CouponOffer => "coupon_offer", + } + } +} + +impl std::str::FromStr for PortalFlowsRetentionType { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalFlowsRetentionType::*; + match s { + "coupon_offer" => Ok(CouponOffer), + _ => Err(()), + } + } +} +impl AsRef for PortalFlowsRetentionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PortalFlowsRetentionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalFlowsRetentionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalFlowsRetentionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalFlowsRetentionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PortalFlowsRetentionType")) + } +} diff --git a/generated/stripe_billing/src/portal_flows_subscription_update_confirm_discount/mod.rs b/generated/stripe_billing/src/portal_flows_subscription_update_confirm_discount/mod.rs new file mode 100644 index 000000000..eb869a581 --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_subscription_update_confirm_discount/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsSubscriptionUpdateConfirmDiscount { + /// The ID of the coupon to apply to this subscription update. + pub coupon: Option, + /// The ID of a promotion code to apply to this subscription update. + pub promotion_code: Option, +} diff --git a/generated/stripe_billing/src/portal_flows_subscription_update_confirm_item/mod.rs b/generated/stripe_billing/src/portal_flows_subscription_update_confirm_item/mod.rs new file mode 100644 index 000000000..e047acc33 --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_subscription_update_confirm_item/mod.rs @@ -0,0 +1,20 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsSubscriptionUpdateConfirmItem { + /// The ID of the [subscription item](https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-id) to be updated. +pub id: Option, + /// The price the customer should subscribe to through this flow. + /// + /// The price must also be included in the configuration's [`features.subscription_update.products`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products). +pub price: Option, + /// [Quantity](https://stripe.com/docs/subscriptions/quantities) for this item that the customer should subscribe to through this flow. +#[serde(skip_serializing_if = "Option::is_none")] +pub quantity: Option, + +} +impl stripe_types::Object for PortalFlowsSubscriptionUpdateConfirmItem { + type Id = Option; + fn id(&self) -> Option<&str> { + self.id.as_deref() + } +} +stripe_types::def_id!(PortalFlowsSubscriptionUpdateConfirmItemId); diff --git a/generated/stripe_billing/src/portal_invoice_list/mod.rs b/generated/stripe_billing/src/portal_invoice_list/mod.rs new file mode 100644 index 000000000..5bfc9c90a --- /dev/null +++ b/generated/stripe_billing/src/portal_invoice_list/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalInvoiceList { + /// Whether the feature is enabled. + pub enabled: bool, +} diff --git a/generated/stripe_billing/src/portal_login_page/mod.rs b/generated/stripe_billing/src/portal_login_page/mod.rs new file mode 100644 index 000000000..8403d6d57 --- /dev/null +++ b/generated/stripe_billing/src/portal_login_page/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalLoginPage { + /// If `true`, a shareable `url` will be generated that will take your customers to a hosted login page for the customer portal. + /// + /// If `false`, the previously generated `url`, if any, will be deactivated. + pub enabled: bool, + /// A shareable URL to the hosted portal login page. + /// + /// Your customers will be able to log in with their [email](https://stripe.com/docs/api/customers/object#customer_object-email) and receive a link to their customer portal. + pub url: Option, +} diff --git a/generated/stripe_billing/src/portal_payment_method_update/mod.rs b/generated/stripe_billing/src/portal_payment_method_update/mod.rs new file mode 100644 index 000000000..1c2e06ae5 --- /dev/null +++ b/generated/stripe_billing/src/portal_payment_method_update/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalPaymentMethodUpdate { + /// Whether the feature is enabled. + pub enabled: bool, +} diff --git a/generated/stripe_billing/src/portal_session/mod.rs b/generated/stripe_billing/src/portal_session/mod.rs new file mode 100644 index 000000000..ea74e93c4 --- /dev/null +++ b/generated/stripe_billing/src/portal_session/mod.rs @@ -0,0 +1,254 @@ +/// The Billing customer portal is a Stripe-hosted UI for subscription and +/// billing management. +/// +/// A portal configuration describes the functionality and features that you +/// want to provide to your customers through the portal. +/// +/// A portal session describes the instantiation of the customer portal for +/// a particular customer. +/// +/// By visiting the session's URL, the customer can manage their subscriptions and billing details. +/// For security reasons, sessions are short-lived and will expire if the customer does not visit the URL. Create sessions on-demand when customers intend to manage their subscriptions and billing details. Learn more in the [integration guide](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal). +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalSession { + /// The configuration used by this session, describing the features available. + pub configuration: stripe_types::Expandable, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The ID of the customer for this session. + pub customer: String, + /// Information about a specific flow for the customer to go through. + /// + /// See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. + pub flow: Option, + /// Unique identifier for the object. + pub id: stripe_billing::portal_session::BillingPortalSessionId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The IETF language tag of the locale Customer Portal is displayed in. + /// + /// If blank or auto, the customer’s `preferred_locales` or browser’s locale is used. + pub locale: Option, + /// The account for which the session was created on behalf of. + /// + /// When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. + /// For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). + /// Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. + pub on_behalf_of: Option, + /// The URL to redirect customers to when they click on the portal's link to return to your website. + pub return_url: Option, + /// The short-lived URL of the session that gives customers access to the customer portal. + pub url: String, +} +/// The IETF language tag of the locale Customer Portal is displayed in. +/// +/// If blank or auto, the customer’s `preferred_locales` or browser’s locale is used. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PortalSessionLocale { + Auto, + Bg, + Cs, + Da, + De, + El, + En, + EnMinusAu, + EnMinusCa, + EnMinusGb, + EnMinusIe, + EnMinusIn, + EnMinusNz, + EnMinusSg, + Es, + EsMinus419, + Et, + Fi, + Fil, + Fr, + FrMinusCa, + Hr, + Hu, + Id, + It, + Ja, + Ko, + Lt, + Lv, + Ms, + Mt, + Nb, + Nl, + Pl, + Pt, + PtMinusBr, + Ro, + Ru, + Sk, + Sl, + Sv, + Th, + Tr, + Vi, + Zh, + ZhMinusHk, + ZhMinusTw, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PortalSessionLocale { + pub fn as_str(self) -> &'static str { + use PortalSessionLocale::*; + match self { + Auto => "auto", + Bg => "bg", + Cs => "cs", + Da => "da", + De => "de", + El => "el", + En => "en", + EnMinusAu => "en-AU", + EnMinusCa => "en-CA", + EnMinusGb => "en-GB", + EnMinusIe => "en-IE", + EnMinusIn => "en-IN", + EnMinusNz => "en-NZ", + EnMinusSg => "en-SG", + Es => "es", + EsMinus419 => "es-419", + Et => "et", + Fi => "fi", + Fil => "fil", + Fr => "fr", + FrMinusCa => "fr-CA", + Hr => "hr", + Hu => "hu", + Id => "id", + It => "it", + Ja => "ja", + Ko => "ko", + Lt => "lt", + Lv => "lv", + Ms => "ms", + Mt => "mt", + Nb => "nb", + Nl => "nl", + Pl => "pl", + Pt => "pt", + PtMinusBr => "pt-BR", + Ro => "ro", + Ru => "ru", + Sk => "sk", + Sl => "sl", + Sv => "sv", + Th => "th", + Tr => "tr", + Vi => "vi", + Zh => "zh", + ZhMinusHk => "zh-HK", + ZhMinusTw => "zh-TW", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PortalSessionLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalSessionLocale::*; + match s { + "auto" => Ok(Auto), + "bg" => Ok(Bg), + "cs" => Ok(Cs), + "da" => Ok(Da), + "de" => Ok(De), + "el" => Ok(El), + "en" => Ok(En), + "en-AU" => Ok(EnMinusAu), + "en-CA" => Ok(EnMinusCa), + "en-GB" => Ok(EnMinusGb), + "en-IE" => Ok(EnMinusIe), + "en-IN" => Ok(EnMinusIn), + "en-NZ" => Ok(EnMinusNz), + "en-SG" => Ok(EnMinusSg), + "es" => Ok(Es), + "es-419" => Ok(EsMinus419), + "et" => Ok(Et), + "fi" => Ok(Fi), + "fil" => Ok(Fil), + "fr" => Ok(Fr), + "fr-CA" => Ok(FrMinusCa), + "hr" => Ok(Hr), + "hu" => Ok(Hu), + "id" => Ok(Id), + "it" => Ok(It), + "ja" => Ok(Ja), + "ko" => Ok(Ko), + "lt" => Ok(Lt), + "lv" => Ok(Lv), + "ms" => Ok(Ms), + "mt" => Ok(Mt), + "nb" => Ok(Nb), + "nl" => Ok(Nl), + "pl" => Ok(Pl), + "pt" => Ok(Pt), + "pt-BR" => Ok(PtMinusBr), + "ro" => Ok(Ro), + "ru" => Ok(Ru), + "sk" => Ok(Sk), + "sl" => Ok(Sl), + "sv" => Ok(Sv), + "th" => Ok(Th), + "tr" => Ok(Tr), + "vi" => Ok(Vi), + "zh" => Ok(Zh), + "zh-HK" => Ok(ZhMinusHk), + "zh-TW" => Ok(ZhMinusTw), + _ => Err(()), + } + } +} +impl AsRef for PortalSessionLocale { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PortalSessionLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalSessionLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalSessionLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalSessionLocale { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PortalSessionLocale::Unknown)) + } +} +impl stripe_types::Object for PortalSession { + type Id = stripe_billing::portal_session::BillingPortalSessionId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(BillingPortalSessionId, "bps_"); +#[cfg(feature = "portal_session")] +mod requests; +#[cfg(feature = "portal_session")] +pub use requests::*; diff --git a/generated/stripe_billing/src/portal_session/requests.rs b/generated/stripe_billing/src/portal_session/requests.rs new file mode 100644 index 000000000..e74c2b090 --- /dev/null +++ b/generated/stripe_billing/src/portal_session/requests.rs @@ -0,0 +1,592 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalSession<'a> { + /// The ID of an existing [configuration](https://stripe.com/docs/api/customer_portal/configuration) to use for this session, describing its functionality and features. + /// + /// If not specified, the session uses the default configuration. + #[serde(skip_serializing_if = "Option::is_none")] + pub configuration: Option<&'a str>, + /// The ID of an existing customer. + pub customer: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Information about a specific flow for the customer to go through. + /// + /// See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. + #[serde(skip_serializing_if = "Option::is_none")] + pub flow_data: Option>, + /// The IETF language tag of the locale customer portal is displayed in. + /// + /// If blank or auto, the customer’s `preferred_locales` or browser’s locale is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub locale: Option, + /// The `on_behalf_of` account to use for this session. + /// + /// When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. + /// For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). + /// Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// The default URL to redirect customers to when they click on the portal's link to return to your website. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, +} +impl<'a> CreatePortalSession<'a> { + pub fn new(customer: &'a str) -> Self { + Self { + configuration: Default::default(), + customer, + expand: Default::default(), + flow_data: Default::default(), + locale: Default::default(), + on_behalf_of: Default::default(), + return_url: Default::default(), + } + } +} +/// Information about a specific flow for the customer to go through. +/// +/// See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalSessionFlowData<'a> { + /// Behavior after the flow is completed. + #[serde(skip_serializing_if = "Option::is_none")] + pub after_completion: Option>, + /// Configuration when `flow_data.type=subscription_cancel`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel: Option>, + /// Configuration when `flow_data.type=subscription_update`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_update: Option>, + /// Configuration when `flow_data.type=subscription_update_confirm`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_update_confirm: + Option>, + /// Type of flow that the customer will go through. + #[serde(rename = "type")] + pub type_: CreatePortalSessionFlowDataType, +} +impl<'a> CreatePortalSessionFlowData<'a> { + pub fn new(type_: CreatePortalSessionFlowDataType) -> Self { + Self { + after_completion: Default::default(), + subscription_cancel: Default::default(), + subscription_update: Default::default(), + subscription_update_confirm: Default::default(), + type_, + } + } +} +/// Behavior after the flow is completed. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalSessionFlowDataAfterCompletion<'a> { + /// Configuration when `after_completion.type=hosted_confirmation`. + #[serde(skip_serializing_if = "Option::is_none")] + pub hosted_confirmation: + Option>, + /// Configuration when `after_completion.type=redirect`. + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect: Option>, + /// The specified behavior after the flow is completed. + #[serde(rename = "type")] + pub type_: CreatePortalSessionFlowDataAfterCompletionType, +} +impl<'a> CreatePortalSessionFlowDataAfterCompletion<'a> { + pub fn new(type_: CreatePortalSessionFlowDataAfterCompletionType) -> Self { + Self { hosted_confirmation: Default::default(), redirect: Default::default(), type_ } + } +} +/// Configuration when `after_completion.type=hosted_confirmation`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePortalSessionFlowDataAfterCompletionHostedConfirmation<'a> { + /// A custom message to display to the customer after the flow is completed. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_message: Option<&'a str>, +} +impl<'a> CreatePortalSessionFlowDataAfterCompletionHostedConfirmation<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration when `after_completion.type=redirect`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalSessionFlowDataAfterCompletionRedirect<'a> { + /// The URL the customer will be redirected to after the flow is completed. + pub return_url: &'a str, +} +impl<'a> CreatePortalSessionFlowDataAfterCompletionRedirect<'a> { + pub fn new(return_url: &'a str) -> Self { + Self { return_url } + } +} +/// The specified behavior after the flow is completed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePortalSessionFlowDataAfterCompletionType { + HostedConfirmation, + PortalHomepage, + Redirect, +} +impl CreatePortalSessionFlowDataAfterCompletionType { + pub fn as_str(self) -> &'static str { + use CreatePortalSessionFlowDataAfterCompletionType::*; + match self { + HostedConfirmation => "hosted_confirmation", + PortalHomepage => "portal_homepage", + Redirect => "redirect", + } + } +} + +impl std::str::FromStr for CreatePortalSessionFlowDataAfterCompletionType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePortalSessionFlowDataAfterCompletionType::*; + match s { + "hosted_confirmation" => Ok(HostedConfirmation), + "portal_homepage" => Ok(PortalHomepage), + "redirect" => Ok(Redirect), + _ => Err(()), + } + } +} +impl AsRef for CreatePortalSessionFlowDataAfterCompletionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePortalSessionFlowDataAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePortalSessionFlowDataAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePortalSessionFlowDataAfterCompletionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration when `flow_data.type=subscription_cancel`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalSessionFlowDataSubscriptionCancel<'a> { + /// Specify a retention strategy to be used in the cancellation flow. + #[serde(skip_serializing_if = "Option::is_none")] + pub retention: Option>, + /// The ID of the subscription to be canceled. + pub subscription: &'a str, +} +impl<'a> CreatePortalSessionFlowDataSubscriptionCancel<'a> { + pub fn new(subscription: &'a str) -> Self { + Self { retention: Default::default(), subscription } + } +} +/// Specify a retention strategy to be used in the cancellation flow. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalSessionFlowDataSubscriptionCancelRetention<'a> { + /// Configuration when `retention.type=coupon_offer`. + pub coupon_offer: CreatePortalSessionFlowDataSubscriptionCancelRetentionCouponOffer<'a>, + /// Type of retention strategy to use with the customer. + #[serde(rename = "type")] + pub type_: CreatePortalSessionFlowDataSubscriptionCancelRetentionType, +} +impl<'a> CreatePortalSessionFlowDataSubscriptionCancelRetention<'a> { + pub fn new( + coupon_offer: CreatePortalSessionFlowDataSubscriptionCancelRetentionCouponOffer<'a>, + type_: CreatePortalSessionFlowDataSubscriptionCancelRetentionType, + ) -> Self { + Self { coupon_offer, type_ } + } +} +/// Configuration when `retention.type=coupon_offer`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalSessionFlowDataSubscriptionCancelRetentionCouponOffer<'a> { + /// The ID of the coupon to be offered. + pub coupon: &'a str, +} +impl<'a> CreatePortalSessionFlowDataSubscriptionCancelRetentionCouponOffer<'a> { + pub fn new(coupon: &'a str) -> Self { + Self { coupon } + } +} +/// Type of retention strategy to use with the customer. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePortalSessionFlowDataSubscriptionCancelRetentionType { + CouponOffer, +} +impl CreatePortalSessionFlowDataSubscriptionCancelRetentionType { + pub fn as_str(self) -> &'static str { + use CreatePortalSessionFlowDataSubscriptionCancelRetentionType::*; + match self { + CouponOffer => "coupon_offer", + } + } +} + +impl std::str::FromStr for CreatePortalSessionFlowDataSubscriptionCancelRetentionType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePortalSessionFlowDataSubscriptionCancelRetentionType::*; + match s { + "coupon_offer" => Ok(CouponOffer), + _ => Err(()), + } + } +} +impl AsRef for CreatePortalSessionFlowDataSubscriptionCancelRetentionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePortalSessionFlowDataSubscriptionCancelRetentionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePortalSessionFlowDataSubscriptionCancelRetentionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePortalSessionFlowDataSubscriptionCancelRetentionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration when `flow_data.type=subscription_update`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalSessionFlowDataSubscriptionUpdate<'a> { + /// The ID of the subscription to be updated. + pub subscription: &'a str, +} +impl<'a> CreatePortalSessionFlowDataSubscriptionUpdate<'a> { + pub fn new(subscription: &'a str) -> Self { + Self { subscription } + } +} +/// Configuration when `flow_data.type=subscription_update_confirm`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalSessionFlowDataSubscriptionUpdateConfirm<'a> { + /// The coupon or promotion code to apply to this subscription update. + /// + /// Currently, only up to one may be specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [CreatePortalSessionFlowDataSubscriptionUpdateConfirmDiscounts<'a>]>, + /// The [subscription item](https://stripe.com/docs/api/subscription_items) to be updated through this flow. + /// + /// Currently, only up to one may be specified and subscriptions with multiple items are not updatable. + pub items: &'a [CreatePortalSessionFlowDataSubscriptionUpdateConfirmItems<'a>], + /// The ID of the subscription to be updated. + pub subscription: &'a str, +} +impl<'a> CreatePortalSessionFlowDataSubscriptionUpdateConfirm<'a> { + pub fn new( + items: &'a [CreatePortalSessionFlowDataSubscriptionUpdateConfirmItems<'a>], + subscription: &'a str, + ) -> Self { + Self { discounts: Default::default(), items, subscription } + } +} +/// The coupon or promotion code to apply to this subscription update. +/// +/// Currently, only up to one may be specified. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePortalSessionFlowDataSubscriptionUpdateConfirmDiscounts<'a> { + /// The ID of the coupon to apply to this subscription update. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// The ID of a promotion code to apply to this subscription update. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option<&'a str>, +} +impl<'a> CreatePortalSessionFlowDataSubscriptionUpdateConfirmDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The [subscription item](https://stripe.com/docs/api/subscription_items) to be updated through this flow. +/// +/// Currently, only up to one may be specified and subscriptions with multiple items are not updatable. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePortalSessionFlowDataSubscriptionUpdateConfirmItems<'a> { + /// The ID of the [subscription item](https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-id) to be updated. + pub id: &'a str, + /// The price the customer should subscribe to through this flow. + /// + /// The price must also be included in the configuration's [`features.subscription_update.products`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products). + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// [Quantity](https://stripe.com/docs/subscriptions/quantities) for this item that the customer should subscribe to through this flow. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, +} +impl<'a> CreatePortalSessionFlowDataSubscriptionUpdateConfirmItems<'a> { + pub fn new(id: &'a str) -> Self { + Self { id, price: Default::default(), quantity: Default::default() } + } +} +/// Type of flow that the customer will go through. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePortalSessionFlowDataType { + PaymentMethodUpdate, + SubscriptionCancel, + SubscriptionUpdate, + SubscriptionUpdateConfirm, +} +impl CreatePortalSessionFlowDataType { + pub fn as_str(self) -> &'static str { + use CreatePortalSessionFlowDataType::*; + match self { + PaymentMethodUpdate => "payment_method_update", + SubscriptionCancel => "subscription_cancel", + SubscriptionUpdate => "subscription_update", + SubscriptionUpdateConfirm => "subscription_update_confirm", + } + } +} + +impl std::str::FromStr for CreatePortalSessionFlowDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePortalSessionFlowDataType::*; + match s { + "payment_method_update" => Ok(PaymentMethodUpdate), + "subscription_cancel" => Ok(SubscriptionCancel), + "subscription_update" => Ok(SubscriptionUpdate), + "subscription_update_confirm" => Ok(SubscriptionUpdateConfirm), + _ => Err(()), + } + } +} +impl AsRef for CreatePortalSessionFlowDataType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePortalSessionFlowDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePortalSessionFlowDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePortalSessionFlowDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The IETF language tag of the locale customer portal is displayed in. +/// +/// If blank or auto, the customer’s `preferred_locales` or browser’s locale is used. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePortalSessionLocale { + Auto, + Bg, + Cs, + Da, + De, + El, + En, + EnMinusAu, + EnMinusCa, + EnMinusGb, + EnMinusIe, + EnMinusIn, + EnMinusNz, + EnMinusSg, + Es, + EsMinus419, + Et, + Fi, + Fil, + Fr, + FrMinusCa, + Hr, + Hu, + Id, + It, + Ja, + Ko, + Lt, + Lv, + Ms, + Mt, + Nb, + Nl, + Pl, + Pt, + PtMinusBr, + Ro, + Ru, + Sk, + Sl, + Sv, + Th, + Tr, + Vi, + Zh, + ZhMinusHk, + ZhMinusTw, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePortalSessionLocale { + pub fn as_str(self) -> &'static str { + use CreatePortalSessionLocale::*; + match self { + Auto => "auto", + Bg => "bg", + Cs => "cs", + Da => "da", + De => "de", + El => "el", + En => "en", + EnMinusAu => "en-AU", + EnMinusCa => "en-CA", + EnMinusGb => "en-GB", + EnMinusIe => "en-IE", + EnMinusIn => "en-IN", + EnMinusNz => "en-NZ", + EnMinusSg => "en-SG", + Es => "es", + EsMinus419 => "es-419", + Et => "et", + Fi => "fi", + Fil => "fil", + Fr => "fr", + FrMinusCa => "fr-CA", + Hr => "hr", + Hu => "hu", + Id => "id", + It => "it", + Ja => "ja", + Ko => "ko", + Lt => "lt", + Lv => "lv", + Ms => "ms", + Mt => "mt", + Nb => "nb", + Nl => "nl", + Pl => "pl", + Pt => "pt", + PtMinusBr => "pt-BR", + Ro => "ro", + Ru => "ru", + Sk => "sk", + Sl => "sl", + Sv => "sv", + Th => "th", + Tr => "tr", + Vi => "vi", + Zh => "zh", + ZhMinusHk => "zh-HK", + ZhMinusTw => "zh-TW", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePortalSessionLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePortalSessionLocale::*; + match s { + "auto" => Ok(Auto), + "bg" => Ok(Bg), + "cs" => Ok(Cs), + "da" => Ok(Da), + "de" => Ok(De), + "el" => Ok(El), + "en" => Ok(En), + "en-AU" => Ok(EnMinusAu), + "en-CA" => Ok(EnMinusCa), + "en-GB" => Ok(EnMinusGb), + "en-IE" => Ok(EnMinusIe), + "en-IN" => Ok(EnMinusIn), + "en-NZ" => Ok(EnMinusNz), + "en-SG" => Ok(EnMinusSg), + "es" => Ok(Es), + "es-419" => Ok(EsMinus419), + "et" => Ok(Et), + "fi" => Ok(Fi), + "fil" => Ok(Fil), + "fr" => Ok(Fr), + "fr-CA" => Ok(FrMinusCa), + "hr" => Ok(Hr), + "hu" => Ok(Hu), + "id" => Ok(Id), + "it" => Ok(It), + "ja" => Ok(Ja), + "ko" => Ok(Ko), + "lt" => Ok(Lt), + "lv" => Ok(Lv), + "ms" => Ok(Ms), + "mt" => Ok(Mt), + "nb" => Ok(Nb), + "nl" => Ok(Nl), + "pl" => Ok(Pl), + "pt" => Ok(Pt), + "pt-BR" => Ok(PtMinusBr), + "ro" => Ok(Ro), + "ru" => Ok(Ru), + "sk" => Ok(Sk), + "sl" => Ok(Sl), + "sv" => Ok(Sv), + "th" => Ok(Th), + "tr" => Ok(Tr), + "vi" => Ok(Vi), + "zh" => Ok(Zh), + "zh-HK" => Ok(ZhMinusHk), + "zh-TW" => Ok(ZhMinusTw), + _ => Err(()), + } + } +} +impl AsRef for CreatePortalSessionLocale { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePortalSessionLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePortalSessionLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePortalSessionLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreatePortalSession<'a> { + /// Creates a session of the customer portal. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/billing_portal/sessions", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_billing/src/portal_subscription_cancel/mod.rs b/generated/stripe_billing/src/portal_subscription_cancel/mod.rs new file mode 100644 index 000000000..16bd8b9e1 --- /dev/null +++ b/generated/stripe_billing/src/portal_subscription_cancel/mod.rs @@ -0,0 +1,136 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalSubscriptionCancel { + pub cancellation_reason: stripe_billing::PortalSubscriptionCancellationReason, + /// Whether the feature is enabled. + pub enabled: bool, + /// Whether to cancel subscriptions immediately or at the end of the billing period. + pub mode: PortalSubscriptionCancelMode, + /// Whether to create prorations when canceling subscriptions. + /// + /// Possible values are `none` and `create_prorations`. + pub proration_behavior: PortalSubscriptionCancelProrationBehavior, +} +/// Whether to cancel subscriptions immediately or at the end of the billing period. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalSubscriptionCancelMode { + AtPeriodEnd, + Immediately, +} +impl PortalSubscriptionCancelMode { + pub fn as_str(self) -> &'static str { + use PortalSubscriptionCancelMode::*; + match self { + AtPeriodEnd => "at_period_end", + Immediately => "immediately", + } + } +} + +impl std::str::FromStr for PortalSubscriptionCancelMode { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalSubscriptionCancelMode::*; + match s { + "at_period_end" => Ok(AtPeriodEnd), + "immediately" => Ok(Immediately), + _ => Err(()), + } + } +} +impl AsRef for PortalSubscriptionCancelMode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PortalSubscriptionCancelMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalSubscriptionCancelMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalSubscriptionCancelMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalSubscriptionCancelMode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PortalSubscriptionCancelMode")) + } +} +/// Whether to create prorations when canceling subscriptions. +/// +/// Possible values are `none` and `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalSubscriptionCancelProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl PortalSubscriptionCancelProrationBehavior { + pub fn as_str(self) -> &'static str { + use PortalSubscriptionCancelProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for PortalSubscriptionCancelProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalSubscriptionCancelProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PortalSubscriptionCancelProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PortalSubscriptionCancelProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalSubscriptionCancelProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalSubscriptionCancelProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalSubscriptionCancelProrationBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PortalSubscriptionCancelProrationBehavior") + }) + } +} diff --git a/generated/stripe_billing/src/portal_subscription_cancellation_reason/mod.rs b/generated/stripe_billing/src/portal_subscription_cancellation_reason/mod.rs new file mode 100644 index 000000000..df259bbff --- /dev/null +++ b/generated/stripe_billing/src/portal_subscription_cancellation_reason/mod.rs @@ -0,0 +1,87 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalSubscriptionCancellationReason { + /// Whether the feature is enabled. + pub enabled: bool, + /// Which cancellation reasons will be given as options to the customer. + pub options: Vec, +} +/// Which cancellation reasons will be given as options to the customer. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalSubscriptionCancellationReasonOptions { + CustomerService, + LowQuality, + MissingFeatures, + Other, + SwitchedService, + TooComplex, + TooExpensive, + Unused, +} +impl PortalSubscriptionCancellationReasonOptions { + pub fn as_str(self) -> &'static str { + use PortalSubscriptionCancellationReasonOptions::*; + match self { + CustomerService => "customer_service", + LowQuality => "low_quality", + MissingFeatures => "missing_features", + Other => "other", + SwitchedService => "switched_service", + TooComplex => "too_complex", + TooExpensive => "too_expensive", + Unused => "unused", + } + } +} + +impl std::str::FromStr for PortalSubscriptionCancellationReasonOptions { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalSubscriptionCancellationReasonOptions::*; + match s { + "customer_service" => Ok(CustomerService), + "low_quality" => Ok(LowQuality), + "missing_features" => Ok(MissingFeatures), + "other" => Ok(Other), + "switched_service" => Ok(SwitchedService), + "too_complex" => Ok(TooComplex), + "too_expensive" => Ok(TooExpensive), + "unused" => Ok(Unused), + _ => Err(()), + } + } +} +impl AsRef for PortalSubscriptionCancellationReasonOptions { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PortalSubscriptionCancellationReasonOptions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalSubscriptionCancellationReasonOptions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalSubscriptionCancellationReasonOptions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalSubscriptionCancellationReasonOptions { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PortalSubscriptionCancellationReasonOptions", + ) + }) + } +} diff --git a/generated/stripe_billing/src/portal_subscription_pause/mod.rs b/generated/stripe_billing/src/portal_subscription_pause/mod.rs new file mode 100644 index 000000000..edb26171c --- /dev/null +++ b/generated/stripe_billing/src/portal_subscription_pause/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalSubscriptionPause { + /// Whether the feature is enabled. + pub enabled: bool, +} diff --git a/generated/stripe_billing/src/portal_subscription_update/mod.rs b/generated/stripe_billing/src/portal_subscription_update/mod.rs new file mode 100644 index 000000000..6b63747a6 --- /dev/null +++ b/generated/stripe_billing/src/portal_subscription_update/mod.rs @@ -0,0 +1,147 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalSubscriptionUpdate { + /// The types of subscription updates that are supported for items listed in the `products` attribute. + /// + /// When empty, subscriptions are not updateable. + pub default_allowed_updates: Vec, + /// Whether the feature is enabled. + pub enabled: bool, + /// The list of up to 10 products that support subscription updates. + pub products: Option>, + /// Determines how to handle prorations resulting from subscription updates. + /// + /// Valid values are `none`, `create_prorations`, and `always_invoice`. + pub proration_behavior: PortalSubscriptionUpdateProrationBehavior, +} +/// The types of subscription updates that are supported for items listed in the `products` attribute. +/// +/// When empty, subscriptions are not updateable. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalSubscriptionUpdateDefaultAllowedUpdates { + Price, + PromotionCode, + Quantity, +} +impl PortalSubscriptionUpdateDefaultAllowedUpdates { + pub fn as_str(self) -> &'static str { + use PortalSubscriptionUpdateDefaultAllowedUpdates::*; + match self { + Price => "price", + PromotionCode => "promotion_code", + Quantity => "quantity", + } + } +} + +impl std::str::FromStr for PortalSubscriptionUpdateDefaultAllowedUpdates { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalSubscriptionUpdateDefaultAllowedUpdates::*; + match s { + "price" => Ok(Price), + "promotion_code" => Ok(PromotionCode), + "quantity" => Ok(Quantity), + _ => Err(()), + } + } +} +impl AsRef for PortalSubscriptionUpdateDefaultAllowedUpdates { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PortalSubscriptionUpdateDefaultAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalSubscriptionUpdateDefaultAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalSubscriptionUpdateDefaultAllowedUpdates { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalSubscriptionUpdateDefaultAllowedUpdates { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PortalSubscriptionUpdateDefaultAllowedUpdates", + ) + }) + } +} +/// Determines how to handle prorations resulting from subscription updates. +/// +/// Valid values are `none`, `create_prorations`, and `always_invoice`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalSubscriptionUpdateProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl PortalSubscriptionUpdateProrationBehavior { + pub fn as_str(self) -> &'static str { + use PortalSubscriptionUpdateProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for PortalSubscriptionUpdateProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalSubscriptionUpdateProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PortalSubscriptionUpdateProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PortalSubscriptionUpdateProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalSubscriptionUpdateProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalSubscriptionUpdateProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalSubscriptionUpdateProrationBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PortalSubscriptionUpdateProrationBehavior") + }) + } +} diff --git a/generated/stripe_billing/src/portal_subscription_update_product/mod.rs b/generated/stripe_billing/src/portal_subscription_update_product/mod.rs new file mode 100644 index 000000000..6eb5cf77c --- /dev/null +++ b/generated/stripe_billing/src/portal_subscription_update_product/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalSubscriptionUpdateProduct { + /// The list of price IDs which, when subscribed to, a subscription can be updated. + pub prices: Vec, + /// The product ID. + pub product: String, +} diff --git a/generated/stripe_billing/src/quote/mod.rs b/generated/stripe_billing/src/quote/mod.rs new file mode 100644 index 000000000..00f4d8db0 --- /dev/null +++ b/generated/stripe_billing/src/quote/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::quote::*; +#[cfg(feature = "quote")] +mod requests; +#[cfg(feature = "quote")] +pub use requests::*; diff --git a/generated/stripe_billing/src/quote/requests.rs b/generated/stripe_billing/src/quote/requests.rs new file mode 100644 index 000000000..02e0dd5de --- /dev/null +++ b/generated/stripe_billing/src/quote/requests.rs @@ -0,0 +1,1271 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveQuote<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveQuote<'a> { + /// Retrieves the quote with the given ID. + pub fn send( + &self, + client: &stripe::Client, + quote: &stripe_types::quote::QuoteId, + ) -> stripe::Response { + client.get_query(&format!("/quotes/{quote}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateQuote<'a> { + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// + /// There cannot be any line items with recurring prices when using this field. + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// There must be at least 1 line item with a recurring price to use this field. + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// + /// When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// The customer for which this quote belongs to. + /// + /// A customer is required before finalizing the quote. + /// Once specified, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// The tax rates that will apply to any line item that does not have `tax_rates` set. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// A description that will be displayed on the quote PDF. + /// + /// If no value is passed, the default description configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The discounts applied to the quote. + /// + /// You can only set up to one discount. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [CreateQuoteDiscounts<'a>]>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A future timestamp on which the quote will be canceled if in `open` or `draft` status. + /// + /// Measured in seconds since the Unix epoch. + /// If no value is passed, the default expiration date configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// A footer that will be displayed on the quote PDF. + /// + /// If no value is passed, the default footer configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// Clone an existing quote. + /// + /// The new quote will be created in `status=draft`. + /// When using this parameter, you cannot specify any other parameters except for `expires_at`. + #[serde(skip_serializing_if = "Option::is_none")] + pub from_quote: Option>, + /// A header that will be displayed on the quote PDF. + /// + /// If no value is passed, the default header configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub header: Option<&'a str>, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option, + /// A list of line items the customer is being quoted for. + /// + /// Each line item includes information about the product, the quantity, and the resulting cost. + #[serde(skip_serializing_if = "Option::is_none")] + pub line_items: Option<&'a [CreateQuoteLineItems<'a>]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The account on behalf of which to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// When creating a subscription or subscription schedule, the specified configuration data will be used. + /// + /// There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. + /// A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_data: Option>, + /// ID of the test clock to attach to the quote. + #[serde(skip_serializing_if = "Option::is_none")] + pub test_clock: Option<&'a str>, + /// The data with which to automatically create a Transfer for each of the invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, +} +impl<'a> CreateQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateQuoteAutomaticTax { + /// Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. + pub enabled: bool, +} +impl CreateQuoteAutomaticTax { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// +/// When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +/// Defaults to `charge_automatically`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateQuoteCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl CreateQuoteCollectionMethod { + pub fn as_str(self) -> &'static str { + use CreateQuoteCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for CreateQuoteCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateQuoteCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl AsRef for CreateQuoteCollectionMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateQuoteCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateQuoteCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateQuoteCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The discounts applied to the quote. +/// +/// You can only set up to one discount. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateQuoteDiscounts<'a> { + /// ID of the coupon to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option<&'a str>, +} +impl<'a> CreateQuoteDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Clone an existing quote. +/// +/// The new quote will be created in `status=draft`. +/// When using this parameter, you cannot specify any other parameters except for `expires_at`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateQuoteFromQuote<'a> { + /// Whether this quote is a revision of the previous quote. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_revision: Option, + /// The `id` of the quote that will be cloned. + pub quote: &'a str, +} +impl<'a> CreateQuoteFromQuote<'a> { + pub fn new(quote: &'a str) -> Self { + Self { is_revision: Default::default(), quote } + } +} +/// All invoices will be billed using the specified settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateQuoteInvoiceSettings { + /// Number of days within which a customer must pay the invoice generated by this quote. + /// + /// This value will be `null` for quotes where `collection_method=charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, +} +impl CreateQuoteInvoiceSettings { + pub fn new() -> Self { + Self::default() + } +} +/// A list of line items the customer is being quoted for. +/// +/// Each line item includes information about the product, the quantity, and the resulting cost. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateQuoteLineItems<'a> { + /// The ID of the price object. + /// + /// One of `price` or `price_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + /// + /// One of `price` or `price_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// The quantity of the line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The tax rates which apply to the line item. + /// + /// When set, the `default_tax_rates` on the quote do not apply to this line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> CreateQuoteLineItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +/// +/// One of `price` or `price_data` is required. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateQuoteLineItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring: Option, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateQuoteLineItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { + currency, + product, + recurring: Default::default(), + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateQuoteLineItemsPriceDataRecurring { + /// Specifies billing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + pub interval: CreateQuoteLineItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl CreateQuoteLineItemsPriceDataRecurring { + pub fn new(interval: CreateQuoteLineItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: Default::default() } + } +} +/// Specifies billing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateQuoteLineItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl CreateQuoteLineItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use CreateQuoteLineItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreateQuoteLineItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateQuoteLineItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for CreateQuoteLineItemsPriceDataRecurringInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateQuoteLineItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateQuoteLineItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateQuoteLineItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateQuoteLineItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateQuoteLineItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateQuoteLineItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateQuoteLineItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateQuoteLineItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreateQuoteLineItemsPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateQuoteLineItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateQuoteLineItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateQuoteLineItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// When creating a subscription or subscription schedule, the specified configuration data will be used. +/// +/// There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. +/// A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateQuoteSubscriptionData<'a> { + /// The subscription's description, meant to be displayable to the customer. + /// + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. + /// + /// When updating a subscription, the date of which the subscription will be updated using a subscription schedule. + /// The special value `current_period_end` can be provided to update a subscription at the end of its current period. + /// The `effective_date` is ignored if it is in the past when the quote is accepted. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_date: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. + /// + /// If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. + /// If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. + /// Unlike object-level metadata, this field is declarative. + /// Updates will clear prior values. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Integer representing the number of trial period days before the customer is charged for the first time. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_period_days: Option, +} +impl<'a> CreateQuoteSubscriptionData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. +/// +/// When updating a subscription, the date of which the subscription will be updated using a subscription schedule. +/// The special value `current_period_end` can be provided to update a subscription at the end of its current period. +/// The `effective_date` is ignored if it is in the past when the quote is accepted. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreateQuoteSubscriptionDataEffectiveDate { + CurrentPeriodEnd, + Timestamp(stripe_types::Timestamp), +} +/// The data with which to automatically create a Transfer for each of the invoices. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateQuoteTransferData<'a> { + /// The amount that will be transferred automatically when the invoice is paid. + /// + /// If no amount is set, the full amount is transferred. + /// There cannot be any line items with recurring prices when using this field. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. + /// By default, the entire amount is transferred to the destination. + /// There must be at least 1 line item with a recurring price to use this field. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_percent: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> CreateQuoteTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount: Default::default(), amount_percent: Default::default(), destination } + } +} +impl<'a> CreateQuote<'a> { + /// A quote models prices and services for a customer. + /// + /// Default options for `header`, `description`, `footer`, and `expires_at` can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/quotes", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateQuote<'a> { + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// + /// There cannot be any line items with recurring prices when using this field. + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// There must be at least 1 line item with a recurring price to use this field. + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// + /// When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// The customer for which this quote belongs to. + /// + /// A customer is required before finalizing the quote. + /// Once specified, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// The tax rates that will apply to any line item that does not have `tax_rates` set. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// A description that will be displayed on the quote PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The discounts applied to the quote. + /// + /// You can only set up to one discount. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [UpdateQuoteDiscounts<'a>]>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A future timestamp on which the quote will be canceled if in `open` or `draft` status. + /// + /// Measured in seconds since the Unix epoch. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// A footer that will be displayed on the quote PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// A header that will be displayed on the quote PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub header: Option<&'a str>, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option, + /// A list of line items the customer is being quoted for. + /// + /// Each line item includes information about the product, the quantity, and the resulting cost. + #[serde(skip_serializing_if = "Option::is_none")] + pub line_items: Option<&'a [UpdateQuoteLineItems<'a>]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The account on behalf of which to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// When creating a subscription or subscription schedule, the specified configuration data will be used. + /// + /// There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. + /// A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_data: Option>, + /// The data with which to automatically create a Transfer for each of the invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, +} +impl<'a> UpdateQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateQuoteAutomaticTax { + /// Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. + pub enabled: bool, +} +impl UpdateQuoteAutomaticTax { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// +/// When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +/// Defaults to `charge_automatically`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateQuoteCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl UpdateQuoteCollectionMethod { + pub fn as_str(self) -> &'static str { + use UpdateQuoteCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for UpdateQuoteCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateQuoteCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl AsRef for UpdateQuoteCollectionMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateQuoteCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateQuoteCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateQuoteCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The discounts applied to the quote. +/// +/// You can only set up to one discount. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateQuoteDiscounts<'a> { + /// ID of the coupon to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option<&'a str>, +} +impl<'a> UpdateQuoteDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// All invoices will be billed using the specified settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateQuoteInvoiceSettings { + /// Number of days within which a customer must pay the invoice generated by this quote. + /// + /// This value will be `null` for quotes where `collection_method=charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, +} +impl UpdateQuoteInvoiceSettings { + pub fn new() -> Self { + Self::default() + } +} +/// A list of line items the customer is being quoted for. +/// +/// Each line item includes information about the product, the quantity, and the resulting cost. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateQuoteLineItems<'a> { + /// The ID of an existing line item on the quote. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<&'a str>, + /// The ID of the price object. + /// + /// One of `price` or `price_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + /// + /// One of `price` or `price_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// The quantity of the line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The tax rates which apply to the line item. + /// + /// When set, the `default_tax_rates` on the quote do not apply to this line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpdateQuoteLineItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +/// +/// One of `price` or `price_data` is required. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateQuoteLineItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring: Option, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpdateQuoteLineItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { + currency, + product, + recurring: Default::default(), + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateQuoteLineItemsPriceDataRecurring { + /// Specifies billing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + pub interval: UpdateQuoteLineItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl UpdateQuoteLineItemsPriceDataRecurring { + pub fn new(interval: UpdateQuoteLineItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: Default::default() } + } +} +/// Specifies billing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateQuoteLineItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl UpdateQuoteLineItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use UpdateQuoteLineItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpdateQuoteLineItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateQuoteLineItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for UpdateQuoteLineItemsPriceDataRecurringInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateQuoteLineItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateQuoteLineItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateQuoteLineItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateQuoteLineItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateQuoteLineItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateQuoteLineItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateQuoteLineItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateQuoteLineItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpdateQuoteLineItemsPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateQuoteLineItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateQuoteLineItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateQuoteLineItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// When creating a subscription or subscription schedule, the specified configuration data will be used. +/// +/// There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. +/// A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateQuoteSubscriptionData<'a> { + /// The subscription's description, meant to be displayable to the customer. + /// + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. + /// + /// When updating a subscription, the date of which the subscription will be updated using a subscription schedule. + /// The special value `current_period_end` can be provided to update a subscription at the end of its current period. + /// The `effective_date` is ignored if it is in the past when the quote is accepted. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_date: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. + /// + /// If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. + /// If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. + /// Unlike object-level metadata, this field is declarative. + /// Updates will clear prior values. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Integer representing the number of trial period days before the customer is charged for the first time. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_period_days: Option, +} +impl<'a> UpdateQuoteSubscriptionData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. +/// +/// When updating a subscription, the date of which the subscription will be updated using a subscription schedule. +/// The special value `current_period_end` can be provided to update a subscription at the end of its current period. +/// The `effective_date` is ignored if it is in the past when the quote is accepted. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateQuoteSubscriptionDataEffectiveDate { + CurrentPeriodEnd, + Timestamp(stripe_types::Timestamp), +} +/// The data with which to automatically create a Transfer for each of the invoices. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateQuoteTransferData<'a> { + /// The amount that will be transferred automatically when the invoice is paid. + /// + /// If no amount is set, the full amount is transferred. + /// There cannot be any line items with recurring prices when using this field. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. + /// By default, the entire amount is transferred to the destination. + /// There must be at least 1 line item with a recurring price to use this field. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_percent: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> UpdateQuoteTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount: Default::default(), amount_percent: Default::default(), destination } + } +} +impl<'a> UpdateQuote<'a> { + /// A quote models prices and services for a customer. + pub fn send( + &self, + client: &stripe::Client, + quote: &stripe_types::quote::QuoteId, + ) -> stripe::Response { + client.send_form(&format!("/quotes/{quote}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelQuote<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelQuote<'a> { + /// Cancels the quote. + pub fn send( + &self, + client: &stripe::Client, + quote: &stripe_types::quote::QuoteId, + ) -> stripe::Response { + client.send_form(&format!("/quotes/{quote}/cancel"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct FinalizeQuoteQuote<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A future timestamp on which the quote will be canceled if in `open` or `draft` status. + /// + /// Measured in seconds since the Unix epoch. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, +} +impl<'a> FinalizeQuoteQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> FinalizeQuoteQuote<'a> { + /// Finalizes the quote. + pub fn send( + &self, + client: &stripe::Client, + quote: &stripe_types::quote::QuoteId, + ) -> stripe::Response { + client.send_form(&format!("/quotes/{quote}/finalize"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct AcceptQuote<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> AcceptQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> AcceptQuote<'a> { + /// Accepts the specified quote. + pub fn send( + &self, + client: &stripe::Client, + quote: &stripe_types::quote::QuoteId, + ) -> stripe::Response { + client.send_form(&format!("/quotes/{quote}/accept"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListQuote<'a> { + /// The ID of the customer whose quotes will be retrieved. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// The status of the quote. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Provides a list of quotes that are associated with the specified test clock. + /// + /// The response will not include quotes with test clocks if this and the customer parameter is not set. + #[serde(skip_serializing_if = "Option::is_none")] + pub test_clock: Option<&'a str>, +} +impl<'a> ListQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The status of the quote. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListQuoteStatus { + Accepted, + Canceled, + Draft, + Open, +} +impl ListQuoteStatus { + pub fn as_str(self) -> &'static str { + use ListQuoteStatus::*; + match self { + Accepted => "accepted", + Canceled => "canceled", + Draft => "draft", + Open => "open", + } + } +} + +impl std::str::FromStr for ListQuoteStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListQuoteStatus::*; + match s { + "accepted" => Ok(Accepted), + "canceled" => Ok(Canceled), + "draft" => Ok(Draft), + "open" => Ok(Open), + _ => Err(()), + } + } +} +impl AsRef for ListQuoteStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListQuoteStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListQuoteStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListQuoteStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListQuote<'a> { + /// Returns a list of your quotes. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/quotes", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/quotes", self) + } +} +impl<'a> stripe::PaginationParams for ListQuote<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListLineItemsQuote<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListLineItemsQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListLineItemsQuote<'a> { + /// When retrieving a quote, there is an includable **line_items** property containing the first handful of those items. + /// + /// There is also a URL where you can retrieve the full (paginated) list of line items. + pub fn send( + &self, + client: &stripe::Client, + quote: &stripe_types::quote::QuoteId, + ) -> stripe::Response> { + client.get_query(&format!("/quotes/{quote}/line_items"), self) + } + pub fn paginate( + self, + quote: &stripe_types::quote::QuoteId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params(&format!("/quotes/{quote}/line_items"), self) + } +} +impl<'a> stripe::PaginationParams for ListLineItemsQuote<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListComputedUpfrontLineItemsQuote<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListComputedUpfrontLineItemsQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListComputedUpfrontLineItemsQuote<'a> { + /// When retrieving a quote, there is an includable **computed.upfront.line_items** property containing the first handful of those items. + /// + /// There is also a URL where you can retrieve the full (paginated) list of upfront line items. + pub fn send( + &self, + client: &stripe::Client, + quote: &stripe_types::quote::QuoteId, + ) -> stripe::Response> { + client.get_query(&format!("/quotes/{quote}/computed_upfront_line_items"), self) + } + pub fn paginate( + self, + quote: &stripe_types::quote::QuoteId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params( + &format!("/quotes/{quote}/computed_upfront_line_items"), + self, + ) + } +} +impl<'a> stripe::PaginationParams for ListComputedUpfrontLineItemsQuote<'a> {} diff --git a/generated/stripe_billing/src/quotes_resource_automatic_tax/mod.rs b/generated/stripe_billing/src/quotes_resource_automatic_tax/mod.rs new file mode 100644 index 000000000..d61902c16 --- /dev/null +++ b/generated/stripe_billing/src/quotes_resource_automatic_tax/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::quotes_resource_automatic_tax::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/quotes_resource_computed/mod.rs b/generated/stripe_billing/src/quotes_resource_computed/mod.rs new file mode 100644 index 000000000..834aebe15 --- /dev/null +++ b/generated/stripe_billing/src/quotes_resource_computed/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::quotes_resource_computed::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/quotes_resource_from_quote/mod.rs b/generated/stripe_billing/src/quotes_resource_from_quote/mod.rs new file mode 100644 index 000000000..b213dff75 --- /dev/null +++ b/generated/stripe_billing/src/quotes_resource_from_quote/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::quotes_resource_from_quote::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/quotes_resource_recurring/mod.rs b/generated/stripe_billing/src/quotes_resource_recurring/mod.rs new file mode 100644 index 000000000..e5d474aa5 --- /dev/null +++ b/generated/stripe_billing/src/quotes_resource_recurring/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::quotes_resource_recurring::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/quotes_resource_status_transitions/mod.rs b/generated/stripe_billing/src/quotes_resource_status_transitions/mod.rs new file mode 100644 index 000000000..94d5a508f --- /dev/null +++ b/generated/stripe_billing/src/quotes_resource_status_transitions/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::quotes_resource_status_transitions::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/quotes_resource_subscription_data_subscription_data/mod.rs b/generated/stripe_billing/src/quotes_resource_subscription_data_subscription_data/mod.rs new file mode 100644 index 000000000..32dcc9e41 --- /dev/null +++ b/generated/stripe_billing/src/quotes_resource_subscription_data_subscription_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::quotes_resource_subscription_data_subscription_data::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/quotes_resource_total_details/mod.rs b/generated/stripe_billing/src/quotes_resource_total_details/mod.rs new file mode 100644 index 000000000..5aa8f5047 --- /dev/null +++ b/generated/stripe_billing/src/quotes_resource_total_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::quotes_resource_total_details::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/quotes_resource_total_details_resource_breakdown/mod.rs b/generated/stripe_billing/src/quotes_resource_total_details_resource_breakdown/mod.rs new file mode 100644 index 000000000..40caa1395 --- /dev/null +++ b/generated/stripe_billing/src/quotes_resource_total_details_resource_breakdown/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::quotes_resource_total_details_resource_breakdown::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/quotes_resource_transfer_data/mod.rs b/generated/stripe_billing/src/quotes_resource_transfer_data/mod.rs new file mode 100644 index 000000000..8223f4c26 --- /dev/null +++ b/generated/stripe_billing/src/quotes_resource_transfer_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::quotes_resource_transfer_data::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/quotes_resource_upfront/mod.rs b/generated/stripe_billing/src/quotes_resource_upfront/mod.rs new file mode 100644 index 000000000..71dfb4578 --- /dev/null +++ b/generated/stripe_billing/src/quotes_resource_upfront/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::quotes_resource_upfront::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/schedules_phase_automatic_tax/mod.rs b/generated/stripe_billing/src/schedules_phase_automatic_tax/mod.rs new file mode 100644 index 000000000..566d47095 --- /dev/null +++ b/generated/stripe_billing/src/schedules_phase_automatic_tax/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::schedules_phase_automatic_tax::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscription/mod.rs b/generated/stripe_billing/src/subscription/mod.rs new file mode 100644 index 000000000..95ae756c6 --- /dev/null +++ b/generated/stripe_billing/src/subscription/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::subscription::*; +#[cfg(feature = "subscription")] +mod requests; +#[cfg(feature = "subscription")] +pub use requests::*; diff --git a/generated/stripe_billing/src/subscription/requests.rs b/generated/stripe_billing/src/subscription/requests.rs new file mode 100644 index 000000000..1b090ef81 --- /dev/null +++ b/generated/stripe_billing/src/subscription/requests.rs @@ -0,0 +1,4796 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SearchSubscription<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for pagination across multiple pages of results. + /// + /// Don't include this parameter on the first call. + /// Use the next_page value returned in a previous response to request subsequent results. + #[serde(skip_serializing_if = "Option::is_none")] + pub page: Option<&'a str>, + /// The search query string. + /// + /// See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for subscriptions](https://stripe.com/docs/search#query-fields-for-subscriptions). + pub query: &'a str, +} +impl<'a> SearchSubscription<'a> { + pub fn new(query: &'a str) -> Self { + Self { + expand: Default::default(), + limit: Default::default(), + page: Default::default(), + query, + } + } +} +impl<'a> SearchSubscription<'a> { + /// Search for subscriptions you’ve previously created using Stripe’s [Search Query Language](https://stripe.com/docs/search#search-query-language). + /// Don’t use search in read-after-write flows where strict consistency is necessary. + /// + /// Under normal operating conditions, data is searchable in less than a minute. + /// Occasionally, propagation of new or updated data can be up to an hour behind during outages. + /// Search functionality is not available to merchants in India. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.get_query("/subscriptions/search", self) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SearchReturned { + pub data: Vec, + pub has_more: bool, + pub next_page: Option, + /// String representing the object's type. + /// + /// Objects of the same type share the same value. + pub object: SearchReturnedObject, + /// The total number of objects that match the query, only accurate up to 10,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub total_count: Option, + pub url: String, +} +/// String representing the object's type. +/// +/// Objects of the same type share the same value. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SearchReturnedObject { + SearchResult, +} +impl SearchReturnedObject { + pub fn as_str(self) -> &'static str { + use SearchReturnedObject::*; + match self { + SearchResult => "search_result", + } + } +} + +impl std::str::FromStr for SearchReturnedObject { + type Err = (); + fn from_str(s: &str) -> Result { + use SearchReturnedObject::*; + match s { + "search_result" => Ok(SearchResult), + _ => Err(()), + } + } +} +impl AsRef for SearchReturnedObject { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SearchReturnedObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SearchReturnedObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SearchReturnedObject { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SearchReturnedObject { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SearchReturnedObject")) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListSubscription<'a> { + /// Filter subscriptions by their automatic tax settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// The collection method of the subscriptions to retrieve. + /// + /// Either `charge_automatically` or `send_invoice`. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub current_period_end: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub current_period_start: Option, + /// The ID of the customer whose subscriptions will be retrieved. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// The ID of the plan whose subscriptions will be retrieved. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// Filter for subscriptions that contain this recurring price ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// The status of the subscriptions to retrieve. + /// + /// Passing in a value of `canceled` will return all canceled subscriptions, including those belonging to deleted customers. + /// 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). + /// Passing in a value of `all` will return subscriptions of all statuses. + /// If no value is supplied, all subscriptions that have not been canceled are returned. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Filter for subscriptions that are associated with the specified test clock. + /// + /// The response will not include subscriptions with test clocks if this and the customer parameter is not set. + #[serde(skip_serializing_if = "Option::is_none")] + pub test_clock: Option<&'a str>, +} +impl<'a> ListSubscription<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Filter subscriptions by their automatic tax settings. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListSubscriptionAutomaticTax { + /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + pub enabled: bool, +} +impl ListSubscriptionAutomaticTax { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// The collection method of the subscriptions to retrieve. +/// +/// Either `charge_automatically` or `send_invoice`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListSubscriptionCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl ListSubscriptionCollectionMethod { + pub fn as_str(self) -> &'static str { + use ListSubscriptionCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for ListSubscriptionCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ListSubscriptionCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl AsRef for ListSubscriptionCollectionMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListSubscriptionCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListSubscriptionCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListSubscriptionCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The status of the subscriptions to retrieve. +/// +/// Passing in a value of `canceled` will return all canceled subscriptions, including those belonging to deleted customers. +/// 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). +/// Passing in a value of `all` will return subscriptions of all statuses. +/// If no value is supplied, all subscriptions that have not been canceled are returned. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListSubscriptionStatus { + Active, + All, + Canceled, + Ended, + Incomplete, + IncompleteExpired, + PastDue, + Paused, + Trialing, + Unpaid, +} +impl ListSubscriptionStatus { + pub fn as_str(self) -> &'static str { + use ListSubscriptionStatus::*; + match self { + Active => "active", + All => "all", + Canceled => "canceled", + Ended => "ended", + Incomplete => "incomplete", + IncompleteExpired => "incomplete_expired", + PastDue => "past_due", + Paused => "paused", + Trialing => "trialing", + Unpaid => "unpaid", + } + } +} + +impl std::str::FromStr for ListSubscriptionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListSubscriptionStatus::*; + match s { + "active" => Ok(Active), + "all" => Ok(All), + "canceled" => Ok(Canceled), + "ended" => Ok(Ended), + "incomplete" => Ok(Incomplete), + "incomplete_expired" => Ok(IncompleteExpired), + "past_due" => Ok(PastDue), + "paused" => Ok(Paused), + "trialing" => Ok(Trialing), + "unpaid" => Ok(Unpaid), + _ => Err(()), + } + } +} +impl AsRef for ListSubscriptionStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListSubscriptionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListSubscriptionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListSubscriptionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListSubscription<'a> { + /// By default, returns a list of subscriptions that have not been canceled. + /// + /// In order to list canceled subscriptions, specify `status=canceled`. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/subscriptions", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/subscriptions", self) + } +} +impl<'a> stripe::PaginationParams for ListSubscription<'a> {} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscription<'a> { + /// A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. + /// + /// You may pass up to 20 items. + #[serde(skip_serializing_if = "Option::is_none")] + pub add_invoice_items: Option<&'a [CreateSubscriptionAddInvoiceItems<'a>]>, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// The request must be made by a platform account on a connected account in order to set an application fee percentage. + /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Automatic tax settings for this subscription. + /// + /// We recommend you only include this parameter when the existing value is being changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// For new subscriptions, a past timestamp to backdate the subscription's start date to. + /// + /// If set, the first invoice will contain a proration for the timespan between the start date and the current time. + /// Can be combined with trials and the billing cycle anchor. + #[serde(skip_serializing_if = "Option::is_none")] + pub backdate_start_date: Option, + /// A future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). + /// + /// This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. + /// The timestamp is in UTC format. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_cycle_anchor: Option, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// + /// Pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// A timestamp at which the subscription should cancel. + /// + /// If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. + /// If set during a future period, this will always cause a proration for that period. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancel_at: Option, + /// Boolean indicating whether this subscription should cancel at the end of the current period. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancel_at_period_end: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// + /// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// The ID of the coupon to apply to this subscription. + /// + /// A coupon applied to a subscription will only affect invoices created for that particular subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The identifier of the customer to subscribe. + pub customer: &'a str, + /// Number of days a customer has to pay invoices generated by this subscription. + /// + /// Valid only for subscriptions where `collection_method` is set to `send_invoice`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, + /// ID of the default payment method for the subscription. + /// + /// It must belong to the customer associated with the subscription. + /// This takes precedence over `default_source`. + /// 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). + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// ID of the default payment source for the subscription. + /// + /// It must belong to the customer associated with the subscription and be in a chargeable state. + /// If `default_payment_method` is also set, `default_payment_method` will take precedence. + /// 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). + #[serde(skip_serializing_if = "Option::is_none")] + pub default_source: Option<&'a str>, + /// The tax rates that will apply to any subscription item that does not have `tax_rates` set. + /// + /// Invoices created will have their `default_tax_rates` populated from the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// The subscription's description, meant to be displayable to the customer. + /// + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A list of up to 20 subscription items, each with an attached price. + #[serde(skip_serializing_if = "Option::is_none")] + pub items: Option<&'a [CreateSubscriptionItems<'a>]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Indicates if a customer is on or off-session while an invoice payment is attempted. + #[serde(skip_serializing_if = "Option::is_none")] + pub off_session: Option, + /// The account on behalf of which to charge, for each of the subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// Only applies to subscriptions with `collection_method=charge_automatically`. + /// + /// Use `allow_incomplete` to create subscriptions with `status=incomplete` if the first invoice cannot be paid. + /// + /// Creating subscriptions with this status allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. + /// For example, SCA regulation may require 3DS authentication to complete payment. + /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. + /// This is the default behavior. Use `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. + /// Subscriptions transition to `status=active` when successfully confirming the payment intent on the first invoice. + /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. + /// 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. + /// 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. + /// 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. + /// This was the default behavior for API versions prior to 2019-03-14. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_behavior: Option, + /// Payment settings to pass to invoices created by the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_settings: Option>, + /// Specifies an interval for how often to bill for any pending invoice items. + /// + /// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub pending_invoice_item_interval: Option, + /// The API ID of a promotion code to apply to this subscription. + /// + /// A promotion code applied to a subscription will only affect invoices created for that particular subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option<&'a str>, + /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) resulting from the `billing_cycle_anchor`. + /// + /// If no value is passed, the default is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, + /// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. + /// + /// If set, trial_end will override the default trial period of the plan the customer is being subscribed to. + /// The special value `now` can be provided to end the customer's trial immediately. + /// Can be at most two years from `billing_cycle_anchor`. + /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_end: Option, + /// Indicates if a plan's `trial_period_days` should be applied to the subscription. + /// + /// Setting `trial_end` per subscription is preferred, and this defaults to `false`. + /// Setting this flag to `true` together with `trial_end` is not allowed. + /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_from_plan: Option, + /// Integer representing the number of trial period days before the customer is charged for the first time. + /// + /// This will always overwrite any trials that might apply via a subscribed plan. + /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_period_days: Option, + /// Settings related to subscription trials. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_settings: Option, +} +impl<'a> CreateSubscription<'a> { + pub fn new(customer: &'a str) -> Self { + Self { + add_invoice_items: Default::default(), + application_fee_percent: Default::default(), + automatic_tax: Default::default(), + backdate_start_date: Default::default(), + billing_cycle_anchor: Default::default(), + billing_thresholds: Default::default(), + cancel_at: Default::default(), + cancel_at_period_end: Default::default(), + collection_method: Default::default(), + coupon: Default::default(), + currency: Default::default(), + customer, + days_until_due: Default::default(), + default_payment_method: Default::default(), + default_source: Default::default(), + default_tax_rates: Default::default(), + description: Default::default(), + expand: Default::default(), + items: Default::default(), + metadata: Default::default(), + off_session: Default::default(), + on_behalf_of: Default::default(), + payment_behavior: Default::default(), + payment_settings: Default::default(), + pending_invoice_item_interval: Default::default(), + promotion_code: Default::default(), + proration_behavior: Default::default(), + transfer_data: Default::default(), + trial_end: Default::default(), + trial_from_plan: Default::default(), + trial_period_days: Default::default(), + trial_settings: Default::default(), + } + } +} +/// A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. +/// +/// You may pass up to 20 items. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionAddInvoiceItems<'a> { + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for this item. + /// + /// Defaults to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The tax rates which apply to the item. + /// + /// When set, the `default_tax_rates` do not apply to this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> CreateSubscriptionAddInvoiceItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionAddInvoiceItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateSubscriptionAddInvoiceItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { + currency, + product, + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionAddInvoiceItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionAddInvoiceItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Automatic tax settings for this subscription. +/// +/// We recommend you only include this parameter when the existing value is being changed. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionAutomaticTax { + /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + pub enabled: bool, +} +impl CreateSubscriptionAutomaticTax { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. +/// +/// Pass an empty string to remove previously-defined thresholds. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionBillingThresholds { + /// Monetary threshold that triggers the subscription to advance to a new billing period. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_gte: Option, + /// Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. + /// + /// If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + #[serde(skip_serializing_if = "Option::is_none")] + pub reset_billing_cycle_anchor: Option, +} +impl CreateSubscriptionBillingThresholds { + pub fn new() -> Self { + Self::default() + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// +/// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +/// Defaults to `charge_automatically`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl CreateSubscriptionCollectionMethod { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for CreateSubscriptionCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionCollectionMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A list of up to 20 subscription items, each with an attached price. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionItems<'a> { + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// + /// When updating, pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Plan ID for this item, as a string. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// + /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. + /// When updating, pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> CreateSubscriptionItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. +/// +/// When updating, pass an empty string to remove previously-defined thresholds. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionItemsBillingThresholds { + /// 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)). + pub usage_gte: i64, +} +impl CreateSubscriptionItemsBillingThresholds { + pub fn new(usage_gte: i64) -> Self { + Self { usage_gte } + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + pub recurring: CreateSubscriptionItemsPriceDataRecurring, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateSubscriptionItemsPriceData<'a> { + pub fn new( + currency: stripe_types::Currency, + product: &'a str, + recurring: CreateSubscriptionItemsPriceDataRecurring, + ) -> Self { + Self { + currency, + product, + recurring, + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionItemsPriceDataRecurring { + /// Specifies billing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + pub interval: CreateSubscriptionItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl CreateSubscriptionItemsPriceDataRecurring { + pub fn new(interval: CreateSubscriptionItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: Default::default() } + } +} +/// Specifies billing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl CreateSubscriptionItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreateSubscriptionItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionItemsPriceDataRecurringInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateSubscriptionItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateSubscriptionItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionItemsPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only applies to subscriptions with `collection_method=charge_automatically`. +/// +/// Use `allow_incomplete` to create subscriptions with `status=incomplete` if the first invoice cannot be paid. +/// +/// Creating subscriptions with this status allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. +/// For example, SCA regulation may require 3DS authentication to complete payment. +/// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. +/// This is the default behavior. Use `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. +/// Subscriptions transition to `status=active` when successfully confirming the payment intent on the first invoice. +/// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. +/// 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. +/// 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. +/// 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. +/// This was the default behavior for API versions prior to 2019-03-14. +/// 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. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentBehavior { + AllowIncomplete, + DefaultIncomplete, + ErrorIfIncomplete, + PendingIfIncomplete, +} +impl CreateSubscriptionPaymentBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentBehavior::*; + match self { + AllowIncomplete => "allow_incomplete", + DefaultIncomplete => "default_incomplete", + ErrorIfIncomplete => "error_if_incomplete", + PendingIfIncomplete => "pending_if_incomplete", + } + } +} + +impl std::str::FromStr for CreateSubscriptionPaymentBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentBehavior::*; + match s { + "allow_incomplete" => Ok(AllowIncomplete), + "default_incomplete" => Ok(DefaultIncomplete), + "error_if_incomplete" => Ok(ErrorIfIncomplete), + "pending_if_incomplete" => Ok(PendingIfIncomplete), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionPaymentBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionPaymentBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionPaymentBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionPaymentBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment settings to pass to invoices created by the subscription. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettings<'a> { + /// Payment-method-specific configuration to provide to invoices created by the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The list of payment method types (e.g. + /// + /// card) to provide to the invoice’s PaymentIntent. + /// 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). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [CreateSubscriptionPaymentSettingsPaymentMethodTypes]>, + /// Either `off`, or `on_subscription`. + /// + /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + #[serde(skip_serializing_if = "Option::is_none")] + pub save_default_payment_method: + Option, +} +impl<'a> CreateSubscriptionPaymentSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Payment-method-specific configuration to provide to invoices created by the subscription. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptions<'a> { + /// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + /// This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: + Option>, + /// This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: + Option>, +} +impl<'a> CreateSubscriptionPaymentSettingsPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit { + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Mandate creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: Option< + CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType, + >, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { + pub fn new() -> Self { + Self::default() + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + Business, + Personal, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl AsRef + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: + Option, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCard<'a> { + /// Configuration options for setting up an eMandate for cards issued in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option>, + /// Selected network to process this Subscription on. + /// + /// Depends on the available networks of the card attached to the Subscription. + /// Can be only set confirm-time. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, + /// 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). + /// + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, +} +impl<'a> CreateSubscriptionPaymentSettingsPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration options for setting up an eMandate for cards issued in India. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions<'a> { + /// Amount to be charged for future payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// One of `fixed` or `maximum`. + /// + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_type: + Option, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, +} +impl<'a> CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One of `fixed` or `maximum`. +/// +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl AsRef + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Selected network to process this Subscription on. +/// +/// Depends on the available networks of the card attached to the Subscription. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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). +/// +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// 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. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + } + } +} + +impl std::str::FromStr + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalance<'a> { + /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: Option< + CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer<'a>, + >, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// + /// Permitted values include: `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub funding_type: Option<&'a str>, +} +impl<'a> CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + /// Configuration for eu_bank_transfer funding type. +#[serde(skip_serializing_if = "Option::is_none")] +pub eu_bank_transfer: Option>, + /// The bank transfer type that can be used for funding. + /// + /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[serde(rename = "type")] +#[serde(skip_serializing_if = "Option::is_none")] +pub type_: Option<&'a str>, + +} +impl<'a> CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for eu_bank_transfer funding type. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer< + 'a, +> { + /// The desired country code of the bank account information. + /// + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: &'a str, +} +impl<'a> + CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer< + 'a, + > +{ + pub fn new(country: &'a str) -> Self { + Self { country } + } +} +/// This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: Option< + CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a>, + >, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option< + CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod, + >, +} +impl<'a> CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[serde(skip_serializing_if = "Option::is_none")] +pub permissions: Option<&'a [CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions]>, + /// List of data features that you would like to retrieve upon account creation. +#[serde(skip_serializing_if = "Option::is_none")] +pub prefetch: Option<&'a [CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch]>, + +} +impl<'a> + CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a> +{ + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { +Balances => "balances", +Ownership => "ownership", +PaymentMethod => "payment_method", +Transactions => "transactions", + + } + } +} + +impl std::str::FromStr for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), +"ownership" => Ok(Ownership), +"payment_method" => Ok(PaymentMethod), +"transactions" => Ok(Transactions), +_ => Err(()) + + } + } +} +impl AsRef for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + Balances, +} +impl + CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + } + } +} + +impl std::str::FromStr for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), +_ => Err(()) + + } + } +} +impl AsRef for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of payment method types (e.g. +/// +/// card) to provide to the invoice’s PaymentIntent. +/// 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). +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodTypes { + AchCreditTransfer, + AchDebit, + AcssDebit, + AuBecsDebit, + BacsDebit, + Bancontact, + Boleto, + Card, + Cashapp, + CustomerBalance, + Fpx, + Giropay, + Grabpay, + Ideal, + Konbini, + Link, + Paynow, + Paypal, + Promptpay, + SepaCreditTransfer, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodTypes::*; + match self { + AchCreditTransfer => "ach_credit_transfer", + AchDebit => "ach_debit", + AcssDebit => "acss_debit", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Konbini => "konbini", + Link => "link", + Paynow => "paynow", + Paypal => "paypal", + Promptpay => "promptpay", + SepaCreditTransfer => "sepa_credit_transfer", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateSubscriptionPaymentSettingsPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodTypes::*; + match s { + "ach_credit_transfer" => Ok(AchCreditTransfer), + "ach_debit" => Ok(AchDebit), + "acss_debit" => Ok(AcssDebit), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "promptpay" => Ok(Promptpay), + "sepa_credit_transfer" => Ok(SepaCreditTransfer), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionPaymentSettingsPaymentMethodTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionPaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionPaymentSettingsPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Either `off`, or `on_subscription`. +/// +/// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + Off, + OnSubscription, +} +impl CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::*; + match self { + Off => "off", + OnSubscription => "on_subscription", + } + } +} + +impl std::str::FromStr for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::*; + match s { + "off" => Ok(Off), + "on_subscription" => Ok(OnSubscription), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies an interval for how often to bill for any pending invoice items. +/// +/// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionPendingInvoiceItemInterval { + /// Specifies invoicing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + pub interval: CreateSubscriptionPendingInvoiceItemIntervalInterval, + /// The number of intervals between invoices. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl CreateSubscriptionPendingInvoiceItemInterval { + pub fn new(interval: CreateSubscriptionPendingInvoiceItemIntervalInterval) -> Self { + Self { interval, interval_count: Default::default() } + } +} +/// Specifies invoicing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPendingInvoiceItemIntervalInterval { + Day, + Month, + Week, + Year, +} +impl CreateSubscriptionPendingInvoiceItemIntervalInterval { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPendingInvoiceItemIntervalInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreateSubscriptionPendingInvoiceItemIntervalInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPendingInvoiceItemIntervalInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionPendingInvoiceItemIntervalInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionPendingInvoiceItemIntervalInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionPendingInvoiceItemIntervalInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionPendingInvoiceItemIntervalInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) resulting from the `billing_cycle_anchor`. +/// +/// If no value is passed, the default is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl CreateSubscriptionProrationBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for CreateSubscriptionProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionTransferData<'a> { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. + /// By default, the entire amount is transferred to the destination. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_percent: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> CreateSubscriptionTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount_percent: Default::default(), destination } + } +} +/// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. +/// +/// If set, trial_end will override the default trial period of the plan the customer is being subscribed to. +/// The special value `now` can be provided to end the customer's trial immediately. +/// Can be at most two years from `billing_cycle_anchor`. +/// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreateSubscriptionTrialEnd { + Now, + Timestamp(stripe_types::Timestamp), +} +/// Settings related to subscription trials. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionTrialSettings { + /// Defines how the subscription should behave when the user's free trial ends. + pub end_behavior: CreateSubscriptionTrialSettingsEndBehavior, +} +impl CreateSubscriptionTrialSettings { + pub fn new(end_behavior: CreateSubscriptionTrialSettingsEndBehavior) -> Self { + Self { end_behavior } + } +} +/// Defines how the subscription should behave when the user's free trial ends. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionTrialSettingsEndBehavior { + /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + pub missing_payment_method: CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod, +} +impl CreateSubscriptionTrialSettingsEndBehavior { + pub fn new( + missing_payment_method: CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod, + ) -> Self { + Self { missing_payment_method } + } +} +/// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + Cancel, + CreateInvoice, + Pause, +} +impl CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::*; + match self { + Cancel => "cancel", + CreateInvoice => "create_invoice", + Pause => "pause", + } + } +} + +impl std::str::FromStr for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::*; + match s { + "cancel" => Ok(Cancel), + "create_invoice" => Ok(CreateInvoice), + "pause" => Ok(Pause), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateSubscription<'a> { + /// Creates a new subscription on an existing customer. + /// + /// 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. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/subscriptions", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscription<'a> { + /// A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. + /// + /// You may pass up to 20 items. + #[serde(skip_serializing_if = "Option::is_none")] + pub add_invoice_items: Option<&'a [UpdateSubscriptionAddInvoiceItems<'a>]>, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// The request must be made by a platform account on a connected account in order to set an application fee percentage. + /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Automatic tax settings for this subscription. + /// + /// We recommend you only include this parameter when the existing value is being changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// Either `now` or `unchanged`. + /// + /// Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). + /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_cycle_anchor: Option, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// + /// Pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// A timestamp at which the subscription should cancel. + /// + /// If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. + /// If set during a future period, this will always cause a proration for that period. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancel_at: Option, + /// Boolean indicating whether this subscription should cancel at the end of the current period. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancel_at_period_end: Option, + /// Details about why this subscription was cancelled. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_details: Option>, + /// Either `charge_automatically`, or `send_invoice`. + /// + /// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// The ID of the coupon to apply to this subscription. + /// + /// A coupon applied to a subscription will only affect invoices created for that particular subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// Number of days a customer has to pay invoices generated by this subscription. + /// + /// Valid only for subscriptions where `collection_method` is set to `send_invoice`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, + /// ID of the default payment method for the subscription. + /// + /// It must belong to the customer associated with the subscription. + /// This takes precedence over `default_source`. + /// 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). + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// ID of the default payment source for the subscription. + /// + /// It must belong to the customer associated with the subscription and be in a chargeable state. + /// If `default_payment_method` is also set, `default_payment_method` will take precedence. + /// 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). + #[serde(skip_serializing_if = "Option::is_none")] + pub default_source: Option<&'a str>, + /// The tax rates that will apply to any subscription item that does not have `tax_rates` set. + /// + /// Invoices created will have their `default_tax_rates` populated from the subscription. + /// Pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// The subscription's description, meant to be displayable to the customer. + /// + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A list of up to 20 subscription items, each with an attached price. + #[serde(skip_serializing_if = "Option::is_none")] + pub items: Option<&'a [UpdateSubscriptionItems<'a>]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Indicates if a customer is on or off-session while an invoice payment is attempted. + #[serde(skip_serializing_if = "Option::is_none")] + pub off_session: Option, + /// The account on behalf of which to charge, for each of the subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// If specified, payment collection for this subscription will be paused. + #[serde(skip_serializing_if = "Option::is_none")] + pub pause_collection: Option, + /// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. + /// + /// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. + /// For example, SCA regulation may require 3DS authentication to complete payment. + /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. + /// 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. + /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. + /// 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). + /// 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. + /// 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. + /// This was the default behavior for API versions prior to 2019-03-14. + /// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_behavior: Option, + /// Payment settings to pass to invoices created by the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_settings: Option>, + /// Specifies an interval for how often to bill for any pending invoice items. + /// + /// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub pending_invoice_item_interval: Option, + /// The promotion code to apply to this subscription. + /// + /// A promotion code applied to a subscription will only affect invoices created for that particular subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option<&'a str>, + /// 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. + /// + /// The default value is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// If set, the proration will be calculated as though the subscription was updated at the given time. + /// + /// This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#upcoming_invoice) endpoint. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_date: Option, + /// 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. + /// + /// This will be unset if you POST an empty value. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, + /// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. + /// + /// This will always overwrite any trials that might apply via a subscribed plan. + /// If set, trial_end will override the default trial period of the plan the customer is being subscribed to. + /// The special value `now` can be provided to end the customer's trial immediately. + /// Can be at most two years from `billing_cycle_anchor`. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_end: Option, + /// Indicates if a plan's `trial_period_days` should be applied to the subscription. + /// + /// Setting `trial_end` per subscription is preferred, and this defaults to `false`. + /// Setting this flag to `true` together with `trial_end` is not allowed. + /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_from_plan: Option, + /// Settings related to subscription trials. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_settings: Option, +} +impl<'a> UpdateSubscription<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. +/// +/// You may pass up to 20 items. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionAddInvoiceItems<'a> { + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for this item. + /// + /// Defaults to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The tax rates which apply to the item. + /// + /// When set, the `default_tax_rates` do not apply to this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpdateSubscriptionAddInvoiceItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionAddInvoiceItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpdateSubscriptionAddInvoiceItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { + currency, + product, + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionAddInvoiceItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionAddInvoiceItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Automatic tax settings for this subscription. +/// +/// We recommend you only include this parameter when the existing value is being changed. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionAutomaticTax { + /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + pub enabled: bool, +} +impl UpdateSubscriptionAutomaticTax { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Either `now` or `unchanged`. +/// +/// Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). +/// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionBillingCycleAnchor { + Now, + Unchanged, +} +impl UpdateSubscriptionBillingCycleAnchor { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionBillingCycleAnchor::*; + match self { + Now => "now", + Unchanged => "unchanged", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionBillingCycleAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionBillingCycleAnchor::*; + match s { + "now" => Ok(Now), + "unchanged" => Ok(Unchanged), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionBillingCycleAnchor { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionBillingCycleAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. +/// +/// Pass an empty string to remove previously-defined thresholds. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionBillingThresholds { + /// Monetary threshold that triggers the subscription to advance to a new billing period. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_gte: Option, + /// Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. + /// + /// If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + #[serde(skip_serializing_if = "Option::is_none")] + pub reset_billing_cycle_anchor: Option, +} +impl UpdateSubscriptionBillingThresholds { + pub fn new() -> Self { + Self::default() + } +} +/// Details about why this subscription was cancelled. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionCancellationDetails<'a> { + /// Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. + #[serde(skip_serializing_if = "Option::is_none")] + pub comment: Option<&'a str>, + /// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. + #[serde(skip_serializing_if = "Option::is_none")] + pub feedback: Option, +} +impl<'a> UpdateSubscriptionCancellationDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionCancellationDetailsFeedback { + CustomerService, + LowQuality, + MissingFeatures, + Other, + SwitchedService, + TooComplex, + TooExpensive, + Unused, +} +impl UpdateSubscriptionCancellationDetailsFeedback { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionCancellationDetailsFeedback::*; + match self { + CustomerService => "customer_service", + LowQuality => "low_quality", + MissingFeatures => "missing_features", + Other => "other", + SwitchedService => "switched_service", + TooComplex => "too_complex", + TooExpensive => "too_expensive", + Unused => "unused", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionCancellationDetailsFeedback { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionCancellationDetailsFeedback::*; + match s { + "customer_service" => Ok(CustomerService), + "low_quality" => Ok(LowQuality), + "missing_features" => Ok(MissingFeatures), + "other" => Ok(Other), + "switched_service" => Ok(SwitchedService), + "too_complex" => Ok(TooComplex), + "too_expensive" => Ok(TooExpensive), + "unused" => Ok(Unused), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionCancellationDetailsFeedback { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionCancellationDetailsFeedback { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionCancellationDetailsFeedback { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionCancellationDetailsFeedback { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// +/// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +/// Defaults to `charge_automatically`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl UpdateSubscriptionCollectionMethod { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionCollectionMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A list of up to 20 subscription items, each with an attached price. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionItems<'a> { + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// + /// When updating, pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Delete all usage for a given subscription item. + /// + /// Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + #[serde(skip_serializing_if = "Option::is_none")] + pub clear_usage: Option, + /// A flag that, if set to `true`, will delete the specified item. + #[serde(skip_serializing_if = "Option::is_none")] + pub deleted: Option, + /// Subscription item to update. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Plan ID for this item, as a string. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// The ID of the price object. + /// + /// When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// + /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. + /// When updating, pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpdateSubscriptionItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. +/// +/// When updating, pass an empty string to remove previously-defined thresholds. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionItemsBillingThresholds { + /// 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)). + pub usage_gte: i64, +} +impl UpdateSubscriptionItemsBillingThresholds { + pub fn new(usage_gte: i64) -> Self { + Self { usage_gte } + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + pub recurring: UpdateSubscriptionItemsPriceDataRecurring, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpdateSubscriptionItemsPriceData<'a> { + pub fn new( + currency: stripe_types::Currency, + product: &'a str, + recurring: UpdateSubscriptionItemsPriceDataRecurring, + ) -> Self { + Self { + currency, + product, + recurring, + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionItemsPriceDataRecurring { + /// Specifies billing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + pub interval: UpdateSubscriptionItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl UpdateSubscriptionItemsPriceDataRecurring { + pub fn new(interval: UpdateSubscriptionItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: Default::default() } + } +} +/// Specifies billing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl UpdateSubscriptionItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionItemsPriceDataRecurringInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateSubscriptionItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionItemsPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If specified, payment collection for this subscription will be paused. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionPauseCollection { + /// The payment collection behavior for this subscription while paused. + /// + /// One of `keep_as_draft`, `mark_uncollectible`, or `void`. + pub behavior: UpdateSubscriptionPauseCollectionBehavior, + /// The time after which the subscription will resume collecting payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub resumes_at: Option, +} +impl UpdateSubscriptionPauseCollection { + pub fn new(behavior: UpdateSubscriptionPauseCollectionBehavior) -> Self { + Self { behavior, resumes_at: Default::default() } + } +} +/// The payment collection behavior for this subscription while paused. +/// +/// One of `keep_as_draft`, `mark_uncollectible`, or `void`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPauseCollectionBehavior { + KeepAsDraft, + MarkUncollectible, + Void, +} +impl UpdateSubscriptionPauseCollectionBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPauseCollectionBehavior::*; + match self { + KeepAsDraft => "keep_as_draft", + MarkUncollectible => "mark_uncollectible", + Void => "void", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionPauseCollectionBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPauseCollectionBehavior::*; + match s { + "keep_as_draft" => Ok(KeepAsDraft), + "mark_uncollectible" => Ok(MarkUncollectible), + "void" => Ok(Void), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionPauseCollectionBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionPauseCollectionBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionPauseCollectionBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionPauseCollectionBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. +/// +/// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. +/// For example, SCA regulation may require 3DS authentication to complete payment. +/// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. +/// 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. +/// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. +/// 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). +/// 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. +/// 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. +/// This was the default behavior for API versions prior to 2019-03-14. +/// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentBehavior { + AllowIncomplete, + DefaultIncomplete, + ErrorIfIncomplete, + PendingIfIncomplete, +} +impl UpdateSubscriptionPaymentBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentBehavior::*; + match self { + AllowIncomplete => "allow_incomplete", + DefaultIncomplete => "default_incomplete", + ErrorIfIncomplete => "error_if_incomplete", + PendingIfIncomplete => "pending_if_incomplete", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionPaymentBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentBehavior::*; + match s { + "allow_incomplete" => Ok(AllowIncomplete), + "default_incomplete" => Ok(DefaultIncomplete), + "error_if_incomplete" => Ok(ErrorIfIncomplete), + "pending_if_incomplete" => Ok(PendingIfIncomplete), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionPaymentBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionPaymentBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionPaymentBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionPaymentBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment settings to pass to invoices created by the subscription. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettings<'a> { + /// Payment-method-specific configuration to provide to invoices created by the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The list of payment method types (e.g. + /// + /// card) to provide to the invoice’s PaymentIntent. + /// 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). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [UpdateSubscriptionPaymentSettingsPaymentMethodTypes]>, + /// Either `off`, or `on_subscription`. + /// + /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + #[serde(skip_serializing_if = "Option::is_none")] + pub save_default_payment_method: + Option, +} +impl<'a> UpdateSubscriptionPaymentSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Payment-method-specific configuration to provide to invoices created by the subscription. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptions<'a> { + /// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + /// This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: + Option>, + /// This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: + Option>, +} +impl<'a> UpdateSubscriptionPaymentSettingsPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit { + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Mandate creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: Option< + UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType, + >, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { + pub fn new() -> Self { + Self::default() + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + Business, + Personal, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl AsRef + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: + Option, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCard<'a> { + /// Configuration options for setting up an eMandate for cards issued in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option>, + /// Selected network to process this Subscription on. + /// + /// Depends on the available networks of the card attached to the Subscription. + /// Can be only set confirm-time. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, + /// 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). + /// + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, +} +impl<'a> UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration options for setting up an eMandate for cards issued in India. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions<'a> { + /// Amount to be charged for future payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// One of `fixed` or `maximum`. + /// + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_type: + Option, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, +} +impl<'a> UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One of `fixed` or `maximum`. +/// +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl AsRef + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Selected network to process this Subscription on. +/// +/// Depends on the available networks of the card attached to the Subscription. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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). +/// +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// 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. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + } + } +} + +impl std::str::FromStr + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalance<'a> { + /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: Option< + UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer<'a>, + >, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// + /// Permitted values include: `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub funding_type: Option<&'a str>, +} +impl<'a> UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + /// Configuration for eu_bank_transfer funding type. +#[serde(skip_serializing_if = "Option::is_none")] +pub eu_bank_transfer: Option>, + /// The bank transfer type that can be used for funding. + /// + /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[serde(rename = "type")] +#[serde(skip_serializing_if = "Option::is_none")] +pub type_: Option<&'a str>, + +} +impl<'a> UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for eu_bank_transfer funding type. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer< + 'a, +> { + /// The desired country code of the bank account information. + /// + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: &'a str, +} +impl<'a> + UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer< + 'a, + > +{ + pub fn new(country: &'a str) -> Self { + Self { country } + } +} +/// This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: Option< + UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a>, + >, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option< + UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod, + >, +} +impl<'a> UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[serde(skip_serializing_if = "Option::is_none")] +pub permissions: Option<&'a [UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions]>, + /// List of data features that you would like to retrieve upon account creation. +#[serde(skip_serializing_if = "Option::is_none")] +pub prefetch: Option<&'a [UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch]>, + +} +impl<'a> + UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a> +{ + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { +Balances => "balances", +Ownership => "ownership", +PaymentMethod => "payment_method", +Transactions => "transactions", + + } + } +} + +impl std::str::FromStr for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), +"ownership" => Ok(Ownership), +"payment_method" => Ok(PaymentMethod), +"transactions" => Ok(Transactions), +_ => Err(()) + + } + } +} +impl AsRef for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + Balances, +} +impl + UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), +_ => Err(()) + + } + } +} +impl AsRef for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of payment method types (e.g. +/// +/// card) to provide to the invoice’s PaymentIntent. +/// 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). +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodTypes { + AchCreditTransfer, + AchDebit, + AcssDebit, + AuBecsDebit, + BacsDebit, + Bancontact, + Boleto, + Card, + Cashapp, + CustomerBalance, + Fpx, + Giropay, + Grabpay, + Ideal, + Konbini, + Link, + Paynow, + Paypal, + Promptpay, + SepaCreditTransfer, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodTypes::*; + match self { + AchCreditTransfer => "ach_credit_transfer", + AchDebit => "ach_debit", + AcssDebit => "acss_debit", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Konbini => "konbini", + Link => "link", + Paynow => "paynow", + Paypal => "paypal", + Promptpay => "promptpay", + SepaCreditTransfer => "sepa_credit_transfer", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionPaymentSettingsPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodTypes::*; + match s { + "ach_credit_transfer" => Ok(AchCreditTransfer), + "ach_debit" => Ok(AchDebit), + "acss_debit" => Ok(AcssDebit), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "promptpay" => Ok(Promptpay), + "sepa_credit_transfer" => Ok(SepaCreditTransfer), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionPaymentSettingsPaymentMethodTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionPaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionPaymentSettingsPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Either `off`, or `on_subscription`. +/// +/// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + Off, + OnSubscription, +} +impl UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::*; + match self { + Off => "off", + OnSubscription => "on_subscription", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::*; + match s { + "off" => Ok(Off), + "on_subscription" => Ok(OnSubscription), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies an interval for how often to bill for any pending invoice items. +/// +/// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionPendingInvoiceItemInterval { + /// Specifies invoicing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + pub interval: UpdateSubscriptionPendingInvoiceItemIntervalInterval, + /// The number of intervals between invoices. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl UpdateSubscriptionPendingInvoiceItemInterval { + pub fn new(interval: UpdateSubscriptionPendingInvoiceItemIntervalInterval) -> Self { + Self { interval, interval_count: Default::default() } + } +} +/// Specifies invoicing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPendingInvoiceItemIntervalInterval { + Day, + Month, + Week, + Year, +} +impl UpdateSubscriptionPendingInvoiceItemIntervalInterval { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPendingInvoiceItemIntervalInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionPendingInvoiceItemIntervalInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPendingInvoiceItemIntervalInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionPendingInvoiceItemIntervalInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionPendingInvoiceItemIntervalInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionPendingInvoiceItemIntervalInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionPendingInvoiceItemIntervalInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// The default value is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl UpdateSubscriptionProrationBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// This will be unset if you POST an empty value. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionTransferData<'a> { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. + /// By default, the entire amount is transferred to the destination. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_percent: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> UpdateSubscriptionTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount_percent: Default::default(), destination } + } +} +/// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. +/// +/// This will always overwrite any trials that might apply via a subscribed plan. +/// If set, trial_end will override the default trial period of the plan the customer is being subscribed to. +/// The special value `now` can be provided to end the customer's trial immediately. +/// Can be at most two years from `billing_cycle_anchor`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateSubscriptionTrialEnd { + Now, + Timestamp(stripe_types::Timestamp), +} +/// Settings related to subscription trials. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionTrialSettings { + /// Defines how the subscription should behave when the user's free trial ends. + pub end_behavior: UpdateSubscriptionTrialSettingsEndBehavior, +} +impl UpdateSubscriptionTrialSettings { + pub fn new(end_behavior: UpdateSubscriptionTrialSettingsEndBehavior) -> Self { + Self { end_behavior } + } +} +/// Defines how the subscription should behave when the user's free trial ends. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionTrialSettingsEndBehavior { + /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + pub missing_payment_method: UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod, +} +impl UpdateSubscriptionTrialSettingsEndBehavior { + pub fn new( + missing_payment_method: UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod, + ) -> Self { + Self { missing_payment_method } + } +} +/// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + Cancel, + CreateInvoice, + Pause, +} +impl UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::*; + match self { + Cancel => "cancel", + CreateInvoice => "create_invoice", + Pause => "pause", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::*; + match s { + "cancel" => Ok(Cancel), + "create_invoice" => Ok(CreateInvoice), + "pause" => Ok(Pause), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateSubscription<'a> { + /// Updates an existing subscription to match the specified parameters. + /// When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. + /// To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. + /// + /// By default, we prorate subscription changes. + /// + /// For example, if a customer signs up on May 1 for a $100 price, they’ll be billed $100 immediately. + /// 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). + /// Similarly, a downgrade generates a credit that is applied to the next invoice. + /// We also prorate when you make quantity changes. Switching prices does not normally change the billing date or generate an immediate charge unless:
  • The billing interval is changed (for example, from monthly to yearly).
  • The subscription moves from free to paid, or paid to free.
  • A trial starts or ends.
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. + /// If you pass `create_prorations`, the prorations are created but not automatically invoiced. + /// 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`. + /// With this option, the customer is billed $100 on May 1 and $200 on June 1. + /// 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. + /// 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). + /// If you need to bill for a frequently changing quantity, consider integrating [usage-based billing](https://stripe.com/docs/billing/subscriptions/usage-based) instead. + pub fn send( + &self, + client: &stripe::Client, + subscription_exposed_id: &stripe_types::subscription::SubscriptionId, + ) -> stripe::Response { + client.send_form( + &format!("/subscriptions/{subscription_exposed_id}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveSubscription<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveSubscription<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveSubscription<'a> { + /// Retrieves the subscription with the given ID. + pub fn send( + &self, + client: &stripe::Client, + subscription_exposed_id: &stripe_types::subscription::SubscriptionId, + ) -> stripe::Response { + client.get_query(&format!("/subscriptions/{subscription_exposed_id}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelSubscription<'a> { + /// Details about why this subscription was cancelled. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_details: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_now: Option, + /// Will generate a proration invoice item that credits remaining unused time until the subscription period end. + #[serde(skip_serializing_if = "Option::is_none")] + pub prorate: Option, +} +impl<'a> CancelSubscription<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details about why this subscription was cancelled. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelSubscriptionCancellationDetails<'a> { + /// Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. + #[serde(skip_serializing_if = "Option::is_none")] + pub comment: Option<&'a str>, + /// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. + #[serde(skip_serializing_if = "Option::is_none")] + pub feedback: Option, +} +impl<'a> CancelSubscriptionCancellationDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CancelSubscriptionCancellationDetailsFeedback { + CustomerService, + LowQuality, + MissingFeatures, + Other, + SwitchedService, + TooComplex, + TooExpensive, + Unused, +} +impl CancelSubscriptionCancellationDetailsFeedback { + pub fn as_str(self) -> &'static str { + use CancelSubscriptionCancellationDetailsFeedback::*; + match self { + CustomerService => "customer_service", + LowQuality => "low_quality", + MissingFeatures => "missing_features", + Other => "other", + SwitchedService => "switched_service", + TooComplex => "too_complex", + TooExpensive => "too_expensive", + Unused => "unused", + } + } +} + +impl std::str::FromStr for CancelSubscriptionCancellationDetailsFeedback { + type Err = (); + fn from_str(s: &str) -> Result { + use CancelSubscriptionCancellationDetailsFeedback::*; + match s { + "customer_service" => Ok(CustomerService), + "low_quality" => Ok(LowQuality), + "missing_features" => Ok(MissingFeatures), + "other" => Ok(Other), + "switched_service" => Ok(SwitchedService), + "too_complex" => Ok(TooComplex), + "too_expensive" => Ok(TooExpensive), + "unused" => Ok(Unused), + _ => Err(()), + } + } +} +impl AsRef for CancelSubscriptionCancellationDetailsFeedback { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CancelSubscriptionCancellationDetailsFeedback { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CancelSubscriptionCancellationDetailsFeedback { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CancelSubscriptionCancellationDetailsFeedback { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CancelSubscription<'a> { + /// Cancels a customer’s subscription immediately. + /// + /// 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). + /// 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. + /// 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. + /// This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. + /// However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. + /// Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. + pub fn send( + &self, + client: &stripe::Client, + subscription_exposed_id: &stripe_types::subscription::SubscriptionId, + ) -> stripe::Response { + client.send_form( + &format!("/subscriptions/{subscription_exposed_id}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ResumeSubscription<'a> { + /// Either `now` or `unchanged`. + /// + /// Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). + /// Setting the value to `unchanged` advances the subscription's billing cycle anchor to the period that surrounds the current time. + /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_cycle_anchor: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// 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. + /// + /// The default value is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// If set, the proration will be calculated as though the subscription was resumed at the given time. + /// + /// This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_date: Option, +} +impl<'a> ResumeSubscription<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Either `now` or `unchanged`. +/// +/// Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). +/// Setting the value to `unchanged` advances the subscription's billing cycle anchor to the period that surrounds the current time. +/// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ResumeSubscriptionBillingCycleAnchor { + Now, + Unchanged, +} +impl ResumeSubscriptionBillingCycleAnchor { + pub fn as_str(self) -> &'static str { + use ResumeSubscriptionBillingCycleAnchor::*; + match self { + Now => "now", + Unchanged => "unchanged", + } + } +} + +impl std::str::FromStr for ResumeSubscriptionBillingCycleAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use ResumeSubscriptionBillingCycleAnchor::*; + match s { + "now" => Ok(Now), + "unchanged" => Ok(Unchanged), + _ => Err(()), + } + } +} +impl AsRef for ResumeSubscriptionBillingCycleAnchor { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ResumeSubscriptionBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ResumeSubscriptionBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ResumeSubscriptionBillingCycleAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// The default value is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ResumeSubscriptionProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl ResumeSubscriptionProrationBehavior { + pub fn as_str(self) -> &'static str { + use ResumeSubscriptionProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for ResumeSubscriptionProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use ResumeSubscriptionProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for ResumeSubscriptionProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ResumeSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ResumeSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ResumeSubscriptionProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ResumeSubscription<'a> { + /// Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. + /// + /// If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. + /// If payment succeeds the subscription will become `active`, and if payment fails the subscription will be `past_due`. + /// The resumption invoice will void automatically if not paid by the expiration date. + pub fn send( + &self, + client: &stripe::Client, + subscription: &stripe_types::subscription::SubscriptionId, + ) -> stripe::Response { + client.send_form( + &format!("/subscriptions/{subscription}/resume"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteDiscountSubscription {} +impl DeleteDiscountSubscription { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteDiscountSubscription { + /// Removes the currently applied discount on a subscription. + pub fn send( + &self, + client: &stripe::Client, + subscription_exposed_id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/subscriptions/{subscription_exposed_id}/discount"), + self, + http_types::Method::Delete, + ) + } +} diff --git a/generated/stripe_billing/src/subscription_automatic_tax/mod.rs b/generated/stripe_billing/src/subscription_automatic_tax/mod.rs new file mode 100644 index 000000000..0018cfc83 --- /dev/null +++ b/generated/stripe_billing/src/subscription_automatic_tax/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscription_automatic_tax::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscription_billing_thresholds/mod.rs b/generated/stripe_billing/src/subscription_billing_thresholds/mod.rs new file mode 100644 index 000000000..af281410a --- /dev/null +++ b/generated/stripe_billing/src/subscription_billing_thresholds/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscription_billing_thresholds::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscription_details_data/mod.rs b/generated/stripe_billing/src/subscription_details_data/mod.rs new file mode 100644 index 000000000..a4f2d6e15 --- /dev/null +++ b/generated/stripe_billing/src/subscription_details_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscription_details_data::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscription_item/mod.rs b/generated/stripe_billing/src/subscription_item/mod.rs new file mode 100644 index 000000000..a77d6ea7f --- /dev/null +++ b/generated/stripe_billing/src/subscription_item/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::subscription_item::*; +#[cfg(feature = "subscription_item")] +mod requests; +#[cfg(feature = "subscription_item")] +pub use requests::*; diff --git a/generated/stripe_billing/src/subscription_item/requests.rs b/generated/stripe_billing/src/subscription_item/requests.rs new file mode 100644 index 000000000..f04b87f45 --- /dev/null +++ b/generated/stripe_billing/src/subscription_item/requests.rs @@ -0,0 +1,1019 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListSubscriptionItem<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// The ID of the subscription whose items will be retrieved. + pub subscription: &'a str, +} +impl<'a> ListSubscriptionItem<'a> { + pub fn new(subscription: &'a str) -> Self { + Self { + ending_before: Default::default(), + expand: Default::default(), + limit: Default::default(), + starting_after: Default::default(), + subscription, + } + } +} +impl<'a> ListSubscriptionItem<'a> { + /// Returns a list of your subscription items for a given subscription. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/subscription_items", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/subscription_items", self) + } +} +impl<'a> stripe::PaginationParams for ListSubscriptionItem<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveSubscriptionItem<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveSubscriptionItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveSubscriptionItem<'a> { + /// Retrieves the subscription item with the given ID. + pub fn send( + &self, + client: &stripe::Client, + item: &stripe_types::line_item::ItemId, + ) -> stripe::Response { + client.get_query(&format!("/subscription_items/{item}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionItem<'a> { + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// + /// When updating, pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. + /// + /// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. + /// For example, SCA regulation may require 3DS authentication to complete payment. + /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. + /// 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. + /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. + /// 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). + /// 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. + /// 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. + /// This was the default behavior for API versions prior to 2019-03-14. + /// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_behavior: Option, + /// The identifier of the plan to add to the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// 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. + /// + /// The default value is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// If set, the proration will be calculated as though the subscription was updated at the given time. + /// + /// This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_date: Option, + /// The quantity you'd like to apply to the subscription item you're creating. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The identifier of the subscription to modify. + pub subscription: &'a str, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// + /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. + /// When updating, pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> CreateSubscriptionItem<'a> { + pub fn new(subscription: &'a str) -> Self { + Self { + billing_thresholds: Default::default(), + expand: Default::default(), + metadata: Default::default(), + payment_behavior: Default::default(), + plan: Default::default(), + price: Default::default(), + price_data: Default::default(), + proration_behavior: Default::default(), + proration_date: Default::default(), + quantity: Default::default(), + subscription, + tax_rates: Default::default(), + } + } +} +/// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. +/// +/// When updating, pass an empty string to remove previously-defined thresholds. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionItemBillingThresholds { + /// 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)). + pub usage_gte: i64, +} +impl CreateSubscriptionItemBillingThresholds { + pub fn new(usage_gte: i64) -> Self { + Self { usage_gte } + } +} +/// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. +/// +/// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. +/// For example, SCA regulation may require 3DS authentication to complete payment. +/// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. +/// 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. +/// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. +/// 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). +/// 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. +/// 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. +/// This was the default behavior for API versions prior to 2019-03-14. +/// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionItemPaymentBehavior { + AllowIncomplete, + DefaultIncomplete, + ErrorIfIncomplete, + PendingIfIncomplete, +} +impl CreateSubscriptionItemPaymentBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionItemPaymentBehavior::*; + match self { + AllowIncomplete => "allow_incomplete", + DefaultIncomplete => "default_incomplete", + ErrorIfIncomplete => "error_if_incomplete", + PendingIfIncomplete => "pending_if_incomplete", + } + } +} + +impl std::str::FromStr for CreateSubscriptionItemPaymentBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionItemPaymentBehavior::*; + match s { + "allow_incomplete" => Ok(AllowIncomplete), + "default_incomplete" => Ok(DefaultIncomplete), + "error_if_incomplete" => Ok(ErrorIfIncomplete), + "pending_if_incomplete" => Ok(PendingIfIncomplete), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionItemPaymentBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionItemPaymentBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionItemPaymentBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionItemPaymentBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionItemPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + pub recurring: CreateSubscriptionItemPriceDataRecurring, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateSubscriptionItemPriceData<'a> { + pub fn new( + currency: stripe_types::Currency, + product: &'a str, + recurring: CreateSubscriptionItemPriceDataRecurring, + ) -> Self { + Self { + currency, + product, + recurring, + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionItemPriceDataRecurring { + /// Specifies billing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + pub interval: CreateSubscriptionItemPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl CreateSubscriptionItemPriceDataRecurring { + pub fn new(interval: CreateSubscriptionItemPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: Default::default() } + } +} +/// Specifies billing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionItemPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl CreateSubscriptionItemPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionItemPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreateSubscriptionItemPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionItemPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionItemPriceDataRecurringInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionItemPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionItemPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionItemPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionItemPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateSubscriptionItemPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionItemPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateSubscriptionItemPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionItemPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionItemPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionItemPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// The default value is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionItemProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl CreateSubscriptionItemProrationBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionItemProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for CreateSubscriptionItemProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionItemProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionItemProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionItemProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionItemProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionItemProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateSubscriptionItem<'a> { + /// Adds a new item to an existing subscription. + /// + /// No existing items will be changed or replaced. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/subscription_items", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionItem<'a> { + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// + /// When updating, pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Indicates if a customer is on or off-session while an invoice payment is attempted. + #[serde(skip_serializing_if = "Option::is_none")] + pub off_session: Option, + /// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. + /// + /// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. + /// For example, SCA regulation may require 3DS authentication to complete payment. + /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. + /// 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. + /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. + /// 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). + /// 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. + /// 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. + /// This was the default behavior for API versions prior to 2019-03-14. + /// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_behavior: Option, + /// The identifier of the new plan for this subscription item. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// The ID of the price object. + /// + /// When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// 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. + /// + /// The default value is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// If set, the proration will be calculated as though the subscription was updated at the given time. + /// + /// This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_date: Option, + /// The quantity you'd like to apply to the subscription item you're creating. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// + /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. + /// When updating, pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpdateSubscriptionItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. +/// +/// When updating, pass an empty string to remove previously-defined thresholds. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionItemBillingThresholds { + /// 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)). + pub usage_gte: i64, +} +impl UpdateSubscriptionItemBillingThresholds { + pub fn new(usage_gte: i64) -> Self { + Self { usage_gte } + } +} +/// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. +/// +/// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. +/// For example, SCA regulation may require 3DS authentication to complete payment. +/// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. +/// 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. +/// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. +/// 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). +/// 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. +/// 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. +/// This was the default behavior for API versions prior to 2019-03-14. +/// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionItemPaymentBehavior { + AllowIncomplete, + DefaultIncomplete, + ErrorIfIncomplete, + PendingIfIncomplete, +} +impl UpdateSubscriptionItemPaymentBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionItemPaymentBehavior::*; + match self { + AllowIncomplete => "allow_incomplete", + DefaultIncomplete => "default_incomplete", + ErrorIfIncomplete => "error_if_incomplete", + PendingIfIncomplete => "pending_if_incomplete", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionItemPaymentBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionItemPaymentBehavior::*; + match s { + "allow_incomplete" => Ok(AllowIncomplete), + "default_incomplete" => Ok(DefaultIncomplete), + "error_if_incomplete" => Ok(ErrorIfIncomplete), + "pending_if_incomplete" => Ok(PendingIfIncomplete), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionItemPaymentBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionItemPaymentBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionItemPaymentBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionItemPaymentBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionItemPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + pub recurring: UpdateSubscriptionItemPriceDataRecurring, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpdateSubscriptionItemPriceData<'a> { + pub fn new( + currency: stripe_types::Currency, + product: &'a str, + recurring: UpdateSubscriptionItemPriceDataRecurring, + ) -> Self { + Self { + currency, + product, + recurring, + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionItemPriceDataRecurring { + /// Specifies billing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + pub interval: UpdateSubscriptionItemPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl UpdateSubscriptionItemPriceDataRecurring { + pub fn new(interval: UpdateSubscriptionItemPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: Default::default() } + } +} +/// Specifies billing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionItemPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl UpdateSubscriptionItemPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionItemPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionItemPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionItemPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionItemPriceDataRecurringInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionItemPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionItemPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionItemPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionItemPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateSubscriptionItemPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionItemPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionItemPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionItemPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionItemPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionItemPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// The default value is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionItemProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl UpdateSubscriptionItemProrationBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionItemProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionItemProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionItemProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionItemProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionItemProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionItemProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionItemProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateSubscriptionItem<'a> { + /// Updates the plan or quantity of an item on a current subscription. + pub fn send( + &self, + client: &stripe::Client, + item: &stripe_types::line_item::ItemId, + ) -> stripe::Response { + client.send_form(&format!("/subscription_items/{item}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteSubscriptionItem { + /// Delete all usage for the given subscription item. + /// + /// Allowed only when the current plan's `usage_type` is `metered`. + #[serde(skip_serializing_if = "Option::is_none")] + pub clear_usage: Option, + /// 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. + /// + /// The default value is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// If set, the proration will be calculated as though the subscription was updated at the given time. + /// + /// This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_date: Option, +} +impl DeleteSubscriptionItem { + pub fn new() -> Self { + Self::default() + } +} +/// 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. +/// +/// The default value is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum DeleteSubscriptionItemProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl DeleteSubscriptionItemProrationBehavior { + pub fn as_str(self) -> &'static str { + use DeleteSubscriptionItemProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for DeleteSubscriptionItemProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use DeleteSubscriptionItemProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for DeleteSubscriptionItemProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for DeleteSubscriptionItemProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for DeleteSubscriptionItemProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for DeleteSubscriptionItemProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl DeleteSubscriptionItem { + /// Deletes an item from the subscription. + /// + /// Removing a subscription item from a subscription will not cancel the subscription. + pub fn send( + &self, + client: &stripe::Client, + item: &stripe_types::line_item::ItemId, + ) -> stripe::Response { + client.send_form(&format!("/subscription_items/{item}"), self, http_types::Method::Delete) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UsageRecordSummariesSubscriptionItem<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> UsageRecordSummariesSubscriptionItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UsageRecordSummariesSubscriptionItem<'a> { + /// For the specified subscription item, returns a list of summary objects. + /// + /// Each object in the list provides usage information that’s been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). The list is sorted in reverse-chronological order (newest first). + /// The first list item represents the most current usage period that hasn’t ended yet. + /// Since new usage records can still be added, the returned summary information for the subscription item’s ID should be seen as unstable until the subscription billing period ends. + pub fn send( + &self, + client: &stripe::Client, + subscription_item: &stripe_types::subscription_item::SubscriptionItemId, + ) -> stripe::Response> { + client.get_query( + &format!("/subscription_items/{subscription_item}/usage_record_summaries"), + self, + ) + } + pub fn paginate( + self, + subscription_item: &stripe_types::subscription_item::SubscriptionItemId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params( + &format!("/subscription_items/{subscription_item}/usage_record_summaries"), + self, + ) + } +} +impl<'a> stripe::PaginationParams for UsageRecordSummariesSubscriptionItem<'a> {} diff --git a/generated/stripe_billing/src/subscription_item_billing_thresholds/mod.rs b/generated/stripe_billing/src/subscription_item_billing_thresholds/mod.rs new file mode 100644 index 000000000..b15addb1d --- /dev/null +++ b/generated/stripe_billing/src/subscription_item_billing_thresholds/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscription_item_billing_thresholds::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscription_payment_method_options_card/mod.rs b/generated/stripe_billing/src/subscription_payment_method_options_card/mod.rs new file mode 100644 index 000000000..dba776ff9 --- /dev/null +++ b/generated/stripe_billing/src/subscription_payment_method_options_card/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscription_payment_method_options_card::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscription_pending_invoice_item_interval/mod.rs b/generated/stripe_billing/src/subscription_pending_invoice_item_interval/mod.rs new file mode 100644 index 000000000..3b573b61e --- /dev/null +++ b/generated/stripe_billing/src/subscription_pending_invoice_item_interval/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscription_pending_invoice_item_interval::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscription_schedule/mod.rs b/generated/stripe_billing/src/subscription_schedule/mod.rs new file mode 100644 index 000000000..d2d4366b4 --- /dev/null +++ b/generated/stripe_billing/src/subscription_schedule/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::subscription_schedule::*; +#[cfg(feature = "subscription_schedule")] +mod requests; +#[cfg(feature = "subscription_schedule")] +pub use requests::*; diff --git a/generated/stripe_billing/src/subscription_schedule/requests.rs b/generated/stripe_billing/src/subscription_schedule/requests.rs new file mode 100644 index 000000000..6db615af0 --- /dev/null +++ b/generated/stripe_billing/src/subscription_schedule/requests.rs @@ -0,0 +1,2375 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListSubscriptionSchedule<'a> { + /// Only return subscription schedules that were created canceled the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub canceled_at: Option, + /// Only return subscription schedules that completed during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub completed_at: Option, + /// Only return subscription schedules that were created during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return subscription schedules for the given customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return subscription schedules that were released during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub released_at: Option, + /// Only return subscription schedules that have not started yet. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduled: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListSubscriptionSchedule<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListSubscriptionSchedule<'a> { + /// Retrieves the list of your subscription schedules. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/subscription_schedules", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/subscription_schedules", self) + } +} +impl<'a> stripe::PaginationParams for ListSubscriptionSchedule<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionSchedule<'a> { + /// The identifier of the customer to create the subscription schedule for. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Object representing the subscription schedule's default settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_settings: Option>, + /// Behavior of the subscription schedule and underlying subscription when it ends. + /// + /// Possible values are `release` or `cancel` with the default being `release`. + /// `release` will end the subscription schedule and keep the underlying subscription running.`cancel` will end the subscription schedule and cancel the underlying subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_behavior: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Migrate an existing subscription to be managed by a subscription schedule. + /// + /// If this parameter is set, a subscription schedule will be created using the subscription's item(s), set to auto-renew using the subscription's interval. + /// When using this parameter, other parameters (such as phase values) cannot be set. + /// To create a subscription schedule with other modifications, we recommend making two separate API calls. + #[serde(skip_serializing_if = "Option::is_none")] + pub from_subscription: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// List representing phases of the subscription schedule. + /// + /// Each phase can be customized to have different durations, plans, and coupons. + /// If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub phases: Option<&'a [CreateSubscriptionSchedulePhases<'a>]>, + /// When the subscription schedule starts. + /// + /// We recommend using `now` so that it starts the subscription immediately. + /// You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_date: Option, +} +impl<'a> CreateSubscriptionSchedule<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Object representing the subscription schedule's default settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionScheduleDefaultSettings<'a> { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// The request must be made by a platform account on a connected account in order to set an application fee percentage. + /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Default settings for automatic tax computation. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. + /// + /// Cannot be set to `phase_start` if this phase specifies a trial. + /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_cycle_anchor: Option, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// + /// Pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// + /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically` on creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// ID of the default payment method for the subscription schedule. + /// + /// It must belong to the customer associated with the subscription schedule. + /// If not set, invoices will use the default payment method in the customer's invoice settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// Subscription description, meant to be displayable to the customer. + /// + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option, + /// The account on behalf of which to charge, for each of the associated subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// The data with which to automatically create a Transfer for each of the associated subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, +} +impl<'a> CreateSubscriptionScheduleDefaultSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Default settings for automatic tax computation. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionScheduleDefaultSettingsAutomaticTax { + /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + pub enabled: bool, +} +impl CreateSubscriptionScheduleDefaultSettingsAutomaticTax { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. +/// +/// Cannot be set to `phase_start` if this phase specifies a trial. +/// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + Automatic, + PhaseStart, +} +impl CreateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionScheduleDefaultSettingsBillingCycleAnchor::*; + match self { + Automatic => "automatic", + PhaseStart => "phase_start", + } + } +} + +impl std::str::FromStr for CreateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionScheduleDefaultSettingsBillingCycleAnchor::*; + match s { + "automatic" => Ok(Automatic), + "phase_start" => Ok(PhaseStart), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. +/// +/// Pass an empty string to remove previously-defined thresholds. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionScheduleDefaultSettingsBillingThresholds { + /// Monetary threshold that triggers the subscription to advance to a new billing period. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_gte: Option, + /// Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. + /// + /// If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + #[serde(skip_serializing_if = "Option::is_none")] + pub reset_billing_cycle_anchor: Option, +} +impl CreateSubscriptionScheduleDefaultSettingsBillingThresholds { + pub fn new() -> Self { + Self::default() + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// +/// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +/// Defaults to `charge_automatically` on creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionScheduleDefaultSettingsCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl CreateSubscriptionScheduleDefaultSettingsCollectionMethod { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionScheduleDefaultSettingsCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for CreateSubscriptionScheduleDefaultSettingsCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionScheduleDefaultSettingsCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionScheduleDefaultSettingsCollectionMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionScheduleDefaultSettingsCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionScheduleDefaultSettingsCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionScheduleDefaultSettingsCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// All invoices will be billed using the specified settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionScheduleDefaultSettingsInvoiceSettings { + /// Number of days within which a customer must pay invoices generated by this subscription schedule. + /// + /// This value will be `null` for subscription schedules where `collection_method=charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, +} +impl CreateSubscriptionScheduleDefaultSettingsInvoiceSettings { + pub fn new() -> Self { + Self::default() + } +} +/// The data with which to automatically create a Transfer for each of the associated subscription's invoices. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionScheduleDefaultSettingsTransferData<'a> { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. + /// By default, the entire amount is transferred to the destination. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_percent: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> CreateSubscriptionScheduleDefaultSettingsTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount_percent: Default::default(), destination } + } +} +/// Behavior of the subscription schedule and underlying subscription when it ends. +/// +/// Possible values are `release` or `cancel` with the default being `release`. +/// `release` will end the subscription schedule and keep the underlying subscription running.`cancel` will end the subscription schedule and cancel the underlying subscription. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionScheduleEndBehavior { + Cancel, + None, + Release, + Renew, +} +impl CreateSubscriptionScheduleEndBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionScheduleEndBehavior::*; + match self { + Cancel => "cancel", + None => "none", + Release => "release", + Renew => "renew", + } + } +} + +impl std::str::FromStr for CreateSubscriptionScheduleEndBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionScheduleEndBehavior::*; + match s { + "cancel" => Ok(Cancel), + "none" => Ok(None), + "release" => Ok(Release), + "renew" => Ok(Renew), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionScheduleEndBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionScheduleEndBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionScheduleEndBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionScheduleEndBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List representing phases of the subscription schedule. +/// +/// Each phase can be customized to have different durations, plans, and coupons. +/// If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhases<'a> { + /// A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. + /// + /// You may pass up to 20 items. + #[serde(skip_serializing_if = "Option::is_none")] + pub add_invoice_items: Option<&'a [CreateSubscriptionSchedulePhasesAddInvoiceItems<'a>]>, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// The request must be made by a platform account on a connected account in order to set an application fee percentage. + /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Automatic tax settings for this phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. + /// + /// Cannot be set to `phase_start` if this phase specifies a trial. + /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_cycle_anchor: Option, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// + /// Pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// + /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically` on creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// The identifier of the coupon to apply to this phase of the subscription schedule. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// ID of the default payment method for the subscription schedule. + /// + /// It must belong to the customer associated with the subscription schedule. + /// If not set, invoices will use the default payment method in the customer's invoice settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// + /// These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// Subscription description, meant to be displayable to the customer. + /// + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The date at which this phase of the subscription schedule ends. + /// + /// If set, `iterations` must not be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option, + /// List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. + pub items: &'a [CreateSubscriptionSchedulePhasesItems<'a>], + /// Integer representing the multiplier applied to the price interval. + /// + /// For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. + /// If set, `end_date` must not be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub iterations: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. + /// + /// Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. + /// Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. + /// To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The account on behalf of which to charge, for each of the associated subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. + /// + /// The default value is `create_prorations`. + /// This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. + /// It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// The data with which to automatically create a Transfer for each of the associated subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, + /// If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial: Option, + /// Sets the phase to trialing from the start date to this date. + /// + /// Must be before the phase end date, can not be combined with `trial`. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_end: Option, +} +impl<'a> CreateSubscriptionSchedulePhases<'a> { + pub fn new(items: &'a [CreateSubscriptionSchedulePhasesItems<'a>]) -> Self { + Self { + add_invoice_items: Default::default(), + application_fee_percent: Default::default(), + automatic_tax: Default::default(), + billing_cycle_anchor: Default::default(), + billing_thresholds: Default::default(), + collection_method: Default::default(), + coupon: Default::default(), + currency: Default::default(), + default_payment_method: Default::default(), + default_tax_rates: Default::default(), + description: Default::default(), + end_date: Default::default(), + invoice_settings: Default::default(), + items, + iterations: Default::default(), + metadata: Default::default(), + on_behalf_of: Default::default(), + proration_behavior: Default::default(), + transfer_data: Default::default(), + trial: Default::default(), + trial_end: Default::default(), + } + } +} +/// A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. +/// +/// You may pass up to 20 items. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesAddInvoiceItems<'a> { + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for this item. + /// + /// Defaults to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The tax rates which apply to the item. + /// + /// When set, the `default_tax_rates` do not apply to this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> CreateSubscriptionSchedulePhasesAddInvoiceItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { + currency, + product, + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Automatic tax settings for this phase. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesAutomaticTax { + /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + pub enabled: bool, +} +impl CreateSubscriptionSchedulePhasesAutomaticTax { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. +/// +/// Cannot be set to `phase_start` if this phase specifies a trial. +/// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionSchedulePhasesBillingCycleAnchor { + Automatic, + PhaseStart, +} +impl CreateSubscriptionSchedulePhasesBillingCycleAnchor { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionSchedulePhasesBillingCycleAnchor::*; + match self { + Automatic => "automatic", + PhaseStart => "phase_start", + } + } +} + +impl std::str::FromStr for CreateSubscriptionSchedulePhasesBillingCycleAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionSchedulePhasesBillingCycleAnchor::*; + match s { + "automatic" => Ok(Automatic), + "phase_start" => Ok(PhaseStart), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionSchedulePhasesBillingCycleAnchor { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionSchedulePhasesBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionSchedulePhasesBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionSchedulePhasesBillingCycleAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. +/// +/// Pass an empty string to remove previously-defined thresholds. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesBillingThresholds { + /// Monetary threshold that triggers the subscription to advance to a new billing period. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_gte: Option, + /// Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. + /// + /// If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + #[serde(skip_serializing_if = "Option::is_none")] + pub reset_billing_cycle_anchor: Option, +} +impl CreateSubscriptionSchedulePhasesBillingThresholds { + pub fn new() -> Self { + Self::default() + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// +/// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +/// Defaults to `charge_automatically` on creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionSchedulePhasesCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl CreateSubscriptionSchedulePhasesCollectionMethod { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionSchedulePhasesCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for CreateSubscriptionSchedulePhasesCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionSchedulePhasesCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionSchedulePhasesCollectionMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionSchedulePhasesCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionSchedulePhasesCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionSchedulePhasesCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// All invoices will be billed using the specified settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesInvoiceSettings { + /// Number of days within which a customer must pay invoices generated by this subscription schedule. + /// + /// This value will be `null` for subscription schedules where `billing=charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, +} +impl CreateSubscriptionSchedulePhasesInvoiceSettings { + pub fn new() -> Self { + Self::default() + } +} +/// List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesItems<'a> { + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// + /// When updating, pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. + /// + /// Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. + /// Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. + /// To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The plan ID to subscribe to. + /// + /// You may specify the same ID in `plan` and `price`. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for the given price. + /// + /// Can be set only if the price's `usage_type` is `licensed` and not `metered`. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// + /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. + /// When updating, pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> CreateSubscriptionSchedulePhasesItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. +/// +/// When updating, pass an empty string to remove previously-defined thresholds. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesItemsBillingThresholds { + /// 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)). + pub usage_gte: i64, +} +impl CreateSubscriptionSchedulePhasesItemsBillingThresholds { + pub fn new(usage_gte: i64) -> Self { + Self { usage_gte } + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + pub recurring: CreateSubscriptionSchedulePhasesItemsPriceDataRecurring, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateSubscriptionSchedulePhasesItemsPriceData<'a> { + pub fn new( + currency: stripe_types::Currency, + product: &'a str, + recurring: CreateSubscriptionSchedulePhasesItemsPriceDataRecurring, + ) -> Self { + Self { + currency, + product, + recurring, + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesItemsPriceDataRecurring { + /// Specifies billing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + pub interval: CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl CreateSubscriptionSchedulePhasesItemsPriceDataRecurring { + pub fn new(interval: CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: Default::default() } + } +} +/// Specifies billing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. +/// +/// The default value is `create_prorations`. +/// This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. +/// It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionSchedulePhasesProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl CreateSubscriptionSchedulePhasesProrationBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionSchedulePhasesProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for CreateSubscriptionSchedulePhasesProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionSchedulePhasesProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSubscriptionSchedulePhasesProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSubscriptionSchedulePhasesProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionSchedulePhasesProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionSchedulePhasesProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The data with which to automatically create a Transfer for each of the associated subscription's invoices. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesTransferData<'a> { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. + /// By default, the entire amount is transferred to the destination. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_percent: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> CreateSubscriptionSchedulePhasesTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount_percent: Default::default(), destination } + } +} +/// When the subscription schedule starts. +/// +/// We recommend using `now` so that it starts the subscription immediately. +/// You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreateSubscriptionScheduleStartDate { + Timestamp(stripe_types::Timestamp), + Now, +} +impl<'a> CreateSubscriptionSchedule<'a> { + /// Creates a new subscription schedule object. + /// + /// Each customer can have up to 500 active or scheduled subscriptions. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/subscription_schedules", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveSubscriptionSchedule<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveSubscriptionSchedule<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveSubscriptionSchedule<'a> { + /// Retrieves the details of an existing subscription schedule. + /// + /// You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation. + pub fn send( + &self, + client: &stripe::Client, + schedule: &str, + ) -> stripe::Response { + client.get_query(&format!("/subscription_schedules/{schedule}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionSchedule<'a> { + /// Object representing the subscription schedule's default settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_settings: Option>, + /// Behavior of the subscription schedule and underlying subscription when it ends. + /// + /// Possible values are `release` or `cancel` with the default being `release`. + /// `release` will end the subscription schedule and keep the underlying subscription running.`cancel` will end the subscription schedule and cancel the underlying subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_behavior: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// List representing phases of the subscription schedule. + /// + /// Each phase can be customized to have different durations, plans, and coupons. + /// If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. + /// Note that past phases can be omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub phases: Option<&'a [UpdateSubscriptionSchedulePhases<'a>]>, + /// If the update changes the current phase, indicates whether the changes should be prorated. + /// + /// The default value is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, +} +impl<'a> UpdateSubscriptionSchedule<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Object representing the subscription schedule's default settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionScheduleDefaultSettings<'a> { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// The request must be made by a platform account on a connected account in order to set an application fee percentage. + /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Default settings for automatic tax computation. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. + /// + /// Cannot be set to `phase_start` if this phase specifies a trial. + /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_cycle_anchor: Option, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// + /// Pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// + /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically` on creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// ID of the default payment method for the subscription schedule. + /// + /// It must belong to the customer associated with the subscription schedule. + /// If not set, invoices will use the default payment method in the customer's invoice settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// Subscription description, meant to be displayable to the customer. + /// + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option, + /// The account on behalf of which to charge, for each of the associated subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// The data with which to automatically create a Transfer for each of the associated subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, +} +impl<'a> UpdateSubscriptionScheduleDefaultSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Default settings for automatic tax computation. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionScheduleDefaultSettingsAutomaticTax { + /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + pub enabled: bool, +} +impl UpdateSubscriptionScheduleDefaultSettingsAutomaticTax { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. +/// +/// Cannot be set to `phase_start` if this phase specifies a trial. +/// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + Automatic, + PhaseStart, +} +impl UpdateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionScheduleDefaultSettingsBillingCycleAnchor::*; + match self { + Automatic => "automatic", + PhaseStart => "phase_start", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionScheduleDefaultSettingsBillingCycleAnchor::*; + match s { + "automatic" => Ok(Automatic), + "phase_start" => Ok(PhaseStart), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. +/// +/// Pass an empty string to remove previously-defined thresholds. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionScheduleDefaultSettingsBillingThresholds { + /// Monetary threshold that triggers the subscription to advance to a new billing period. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_gte: Option, + /// Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. + /// + /// If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + #[serde(skip_serializing_if = "Option::is_none")] + pub reset_billing_cycle_anchor: Option, +} +impl UpdateSubscriptionScheduleDefaultSettingsBillingThresholds { + pub fn new() -> Self { + Self::default() + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// +/// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +/// Defaults to `charge_automatically` on creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionScheduleDefaultSettingsCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl UpdateSubscriptionScheduleDefaultSettingsCollectionMethod { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionScheduleDefaultSettingsCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionScheduleDefaultSettingsCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionScheduleDefaultSettingsCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionScheduleDefaultSettingsCollectionMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionScheduleDefaultSettingsCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionScheduleDefaultSettingsCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionScheduleDefaultSettingsCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// All invoices will be billed using the specified settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionScheduleDefaultSettingsInvoiceSettings { + /// Number of days within which a customer must pay invoices generated by this subscription schedule. + /// + /// This value will be `null` for subscription schedules where `collection_method=charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, +} +impl UpdateSubscriptionScheduleDefaultSettingsInvoiceSettings { + pub fn new() -> Self { + Self::default() + } +} +/// The data with which to automatically create a Transfer for each of the associated subscription's invoices. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionScheduleDefaultSettingsTransferData<'a> { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. + /// By default, the entire amount is transferred to the destination. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_percent: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> UpdateSubscriptionScheduleDefaultSettingsTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount_percent: Default::default(), destination } + } +} +/// Behavior of the subscription schedule and underlying subscription when it ends. +/// +/// Possible values are `release` or `cancel` with the default being `release`. +/// `release` will end the subscription schedule and keep the underlying subscription running.`cancel` will end the subscription schedule and cancel the underlying subscription. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionScheduleEndBehavior { + Cancel, + None, + Release, + Renew, +} +impl UpdateSubscriptionScheduleEndBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionScheduleEndBehavior::*; + match self { + Cancel => "cancel", + None => "none", + Release => "release", + Renew => "renew", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionScheduleEndBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionScheduleEndBehavior::*; + match s { + "cancel" => Ok(Cancel), + "none" => Ok(None), + "release" => Ok(Release), + "renew" => Ok(Renew), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionScheduleEndBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionScheduleEndBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionScheduleEndBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionScheduleEndBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List representing phases of the subscription schedule. +/// +/// Each phase can be customized to have different durations, plans, and coupons. +/// If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. +/// Note that past phases can be omitted. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhases<'a> { + /// A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. + /// + /// You may pass up to 20 items. + #[serde(skip_serializing_if = "Option::is_none")] + pub add_invoice_items: Option<&'a [UpdateSubscriptionSchedulePhasesAddInvoiceItems<'a>]>, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// The request must be made by a platform account on a connected account in order to set an application fee percentage. + /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Automatic tax settings for this phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. + /// + /// Cannot be set to `phase_start` if this phase specifies a trial. + /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_cycle_anchor: Option, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// + /// Pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// + /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically` on creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// The identifier of the coupon to apply to this phase of the subscription schedule. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// ID of the default payment method for the subscription schedule. + /// + /// It must belong to the customer associated with the subscription schedule. + /// If not set, invoices will use the default payment method in the customer's invoice settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// + /// These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// Subscription description, meant to be displayable to the customer. + /// + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The date at which this phase of the subscription schedule ends. + /// + /// If set, `iterations` must not be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option, + /// List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. + pub items: &'a [UpdateSubscriptionSchedulePhasesItems<'a>], + /// Integer representing the multiplier applied to the price interval. + /// + /// For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. + /// If set, `end_date` must not be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub iterations: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. + /// + /// Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. + /// Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. + /// To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The account on behalf of which to charge, for each of the associated subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. + /// + /// The default value is `create_prorations`. + /// This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. + /// It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// The date at which this phase of the subscription schedule starts or `now`. + /// + /// Must be set on the first phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_date: Option, + /// The data with which to automatically create a Transfer for each of the associated subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, + /// If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial: Option, + /// Sets the phase to trialing from the start date to this date. + /// + /// Must be before the phase end date, can not be combined with `trial`. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_end: Option, +} +impl<'a> UpdateSubscriptionSchedulePhases<'a> { + pub fn new(items: &'a [UpdateSubscriptionSchedulePhasesItems<'a>]) -> Self { + Self { + add_invoice_items: Default::default(), + application_fee_percent: Default::default(), + automatic_tax: Default::default(), + billing_cycle_anchor: Default::default(), + billing_thresholds: Default::default(), + collection_method: Default::default(), + coupon: Default::default(), + currency: Default::default(), + default_payment_method: Default::default(), + default_tax_rates: Default::default(), + description: Default::default(), + end_date: Default::default(), + invoice_settings: Default::default(), + items, + iterations: Default::default(), + metadata: Default::default(), + on_behalf_of: Default::default(), + proration_behavior: Default::default(), + start_date: Default::default(), + transfer_data: Default::default(), + trial: Default::default(), + trial_end: Default::default(), + } + } +} +/// A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. +/// +/// You may pass up to 20 items. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesAddInvoiceItems<'a> { + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for this item. + /// + /// Defaults to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The tax rates which apply to the item. + /// + /// When set, the `default_tax_rates` do not apply to this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpdateSubscriptionSchedulePhasesAddInvoiceItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { + currency, + product, + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Automatic tax settings for this phase. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesAutomaticTax { + /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + pub enabled: bool, +} +impl UpdateSubscriptionSchedulePhasesAutomaticTax { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. +/// +/// Cannot be set to `phase_start` if this phase specifies a trial. +/// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionSchedulePhasesBillingCycleAnchor { + Automatic, + PhaseStart, +} +impl UpdateSubscriptionSchedulePhasesBillingCycleAnchor { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionSchedulePhasesBillingCycleAnchor::*; + match self { + Automatic => "automatic", + PhaseStart => "phase_start", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionSchedulePhasesBillingCycleAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionSchedulePhasesBillingCycleAnchor::*; + match s { + "automatic" => Ok(Automatic), + "phase_start" => Ok(PhaseStart), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionSchedulePhasesBillingCycleAnchor { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionSchedulePhasesBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionSchedulePhasesBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionSchedulePhasesBillingCycleAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. +/// +/// Pass an empty string to remove previously-defined thresholds. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesBillingThresholds { + /// Monetary threshold that triggers the subscription to advance to a new billing period. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_gte: Option, + /// Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. + /// + /// If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + #[serde(skip_serializing_if = "Option::is_none")] + pub reset_billing_cycle_anchor: Option, +} +impl UpdateSubscriptionSchedulePhasesBillingThresholds { + pub fn new() -> Self { + Self::default() + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// +/// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +/// Defaults to `charge_automatically` on creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionSchedulePhasesCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl UpdateSubscriptionSchedulePhasesCollectionMethod { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionSchedulePhasesCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionSchedulePhasesCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionSchedulePhasesCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionSchedulePhasesCollectionMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionSchedulePhasesCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionSchedulePhasesCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionSchedulePhasesCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The date at which this phase of the subscription schedule ends. +/// +/// If set, `iterations` must not be set. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateSubscriptionSchedulePhasesEndDate { + Timestamp(stripe_types::Timestamp), + Now, +} +/// All invoices will be billed using the specified settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesInvoiceSettings { + /// Number of days within which a customer must pay invoices generated by this subscription schedule. + /// + /// This value will be `null` for subscription schedules where `billing=charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, +} +impl UpdateSubscriptionSchedulePhasesInvoiceSettings { + pub fn new() -> Self { + Self::default() + } +} +/// List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesItems<'a> { + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// + /// When updating, pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. + /// + /// Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. + /// Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. + /// To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The plan ID to subscribe to. + /// + /// You may specify the same ID in `plan` and `price`. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for the given price. + /// + /// Can be set only if the price's `usage_type` is `licensed` and not `metered`. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// + /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. + /// When updating, pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpdateSubscriptionSchedulePhasesItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. +/// +/// When updating, pass an empty string to remove previously-defined thresholds. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesItemsBillingThresholds { + /// 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)). + pub usage_gte: i64, +} +impl UpdateSubscriptionSchedulePhasesItemsBillingThresholds { + pub fn new(usage_gte: i64) -> Self { + Self { usage_gte } + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + pub recurring: UpdateSubscriptionSchedulePhasesItemsPriceDataRecurring, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpdateSubscriptionSchedulePhasesItemsPriceData<'a> { + pub fn new( + currency: stripe_types::Currency, + product: &'a str, + recurring: UpdateSubscriptionSchedulePhasesItemsPriceDataRecurring, + ) -> Self { + Self { + currency, + product, + recurring, + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesItemsPriceDataRecurring { + /// Specifies billing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + pub interval: UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl UpdateSubscriptionSchedulePhasesItemsPriceDataRecurring { + pub fn new(interval: UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: Default::default() } + } +} +/// Specifies billing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. +/// +/// The default value is `create_prorations`. +/// This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. +/// It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionSchedulePhasesProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl UpdateSubscriptionSchedulePhasesProrationBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionSchedulePhasesProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionSchedulePhasesProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionSchedulePhasesProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionSchedulePhasesProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionSchedulePhasesProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionSchedulePhasesProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionSchedulePhasesProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The date at which this phase of the subscription schedule starts or `now`. +/// +/// Must be set on the first phase. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateSubscriptionSchedulePhasesStartDate { + Timestamp(stripe_types::Timestamp), + Now, +} +/// The data with which to automatically create a Transfer for each of the associated subscription's invoices. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesTransferData<'a> { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. + /// By default, the entire amount is transferred to the destination. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_percent: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> UpdateSubscriptionSchedulePhasesTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount_percent: Default::default(), destination } + } +} +/// Sets the phase to trialing from the start date to this date. +/// +/// Must be before the phase end date, can not be combined with `trial`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateSubscriptionSchedulePhasesTrialEnd { + Timestamp(stripe_types::Timestamp), + Now, +} +/// If the update changes the current phase, indicates whether the changes should be prorated. +/// +/// The default value is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionScheduleProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl UpdateSubscriptionScheduleProrationBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionScheduleProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionScheduleProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionScheduleProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdateSubscriptionScheduleProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSubscriptionScheduleProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionScheduleProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionScheduleProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateSubscriptionSchedule<'a> { + /// Updates an existing subscription schedule. + pub fn send( + &self, + client: &stripe::Client, + schedule: &str, + ) -> stripe::Response { + client.send_form( + &format!("/subscription_schedules/{schedule}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelSubscriptionSchedule<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. + /// + /// Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_now: Option, + /// If the subscription schedule is `active`, indicates if the cancellation should be prorated. + /// + /// Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub prorate: Option, +} +impl<'a> CancelSubscriptionSchedule<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelSubscriptionSchedule<'a> { + /// Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). + /// + /// A subscription schedule can only be canceled if its status is `not_started` or `active`. + pub fn send( + &self, + client: &stripe::Client, + schedule: &str, + ) -> stripe::Response { + client.send_form( + &format!("/subscription_schedules/{schedule}/cancel"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReleaseSubscriptionSchedule<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Keep any cancellation on the subscription that the schedule has set. + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_cancel_date: Option, +} +impl<'a> ReleaseSubscriptionSchedule<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ReleaseSubscriptionSchedule<'a> { + /// Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. + /// + /// A schedule can only be released if its status is `not_started` or `active`. + /// If the subscription schedule is currently associated with a subscription, releasing it will remove its `subscription` property and set the subscription’s ID to the `released_subscription` property. + pub fn send( + &self, + client: &stripe::Client, + schedule: &str, + ) -> stripe::Response { + client.send_form( + &format!("/subscription_schedules/{schedule}/release"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_billing/src/subscription_schedule_add_invoice_item/mod.rs b/generated/stripe_billing/src/subscription_schedule_add_invoice_item/mod.rs new file mode 100644 index 000000000..7976a723d --- /dev/null +++ b/generated/stripe_billing/src/subscription_schedule_add_invoice_item/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscription_schedule_add_invoice_item::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscription_schedule_configuration_item/mod.rs b/generated/stripe_billing/src/subscription_schedule_configuration_item/mod.rs new file mode 100644 index 000000000..3d533e395 --- /dev/null +++ b/generated/stripe_billing/src/subscription_schedule_configuration_item/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscription_schedule_configuration_item::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscription_schedule_current_phase/mod.rs b/generated/stripe_billing/src/subscription_schedule_current_phase/mod.rs new file mode 100644 index 000000000..a0c8c48d3 --- /dev/null +++ b/generated/stripe_billing/src/subscription_schedule_current_phase/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscription_schedule_current_phase::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscription_schedule_phase_configuration/mod.rs b/generated/stripe_billing/src/subscription_schedule_phase_configuration/mod.rs new file mode 100644 index 000000000..4ac9835ad --- /dev/null +++ b/generated/stripe_billing/src/subscription_schedule_phase_configuration/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscription_schedule_phase_configuration::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscription_schedules_resource_default_settings/mod.rs b/generated/stripe_billing/src/subscription_schedules_resource_default_settings/mod.rs new file mode 100644 index 000000000..32f5806ee --- /dev/null +++ b/generated/stripe_billing/src/subscription_schedules_resource_default_settings/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscription_schedules_resource_default_settings::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscription_schedules_resource_default_settings_automatic_tax/mod.rs b/generated/stripe_billing/src/subscription_schedules_resource_default_settings_automatic_tax/mod.rs new file mode 100644 index 000000000..993a3022f --- /dev/null +++ b/generated/stripe_billing/src/subscription_schedules_resource_default_settings_automatic_tax/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscription_schedules_resource_default_settings_automatic_tax::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscription_transfer_data/mod.rs b/generated/stripe_billing/src/subscription_transfer_data/mod.rs new file mode 100644 index 000000000..d4fc7b641 --- /dev/null +++ b/generated/stripe_billing/src/subscription_transfer_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscription_transfer_data::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscriptions_resource_pause_collection/mod.rs b/generated/stripe_billing/src/subscriptions_resource_pause_collection/mod.rs new file mode 100644 index 000000000..7e7409af9 --- /dev/null +++ b/generated/stripe_billing/src/subscriptions_resource_pause_collection/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscriptions_resource_pause_collection::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscriptions_resource_payment_method_options/mod.rs b/generated/stripe_billing/src/subscriptions_resource_payment_method_options/mod.rs new file mode 100644 index 000000000..81c96ebf3 --- /dev/null +++ b/generated/stripe_billing/src/subscriptions_resource_payment_method_options/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscriptions_resource_payment_method_options::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscriptions_resource_payment_settings/mod.rs b/generated/stripe_billing/src/subscriptions_resource_payment_settings/mod.rs new file mode 100644 index 000000000..9b1dc6e50 --- /dev/null +++ b/generated/stripe_billing/src/subscriptions_resource_payment_settings/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscriptions_resource_payment_settings::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscriptions_resource_pending_update/mod.rs b/generated/stripe_billing/src/subscriptions_resource_pending_update/mod.rs new file mode 100644 index 000000000..7b6dc5fa3 --- /dev/null +++ b/generated/stripe_billing/src/subscriptions_resource_pending_update/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscriptions_resource_pending_update::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscriptions_trials_resource_end_behavior/mod.rs b/generated/stripe_billing/src/subscriptions_trials_resource_end_behavior/mod.rs new file mode 100644 index 000000000..04aa94124 --- /dev/null +++ b/generated/stripe_billing/src/subscriptions_trials_resource_end_behavior/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscriptions_trials_resource_end_behavior::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/subscriptions_trials_resource_trial_settings/mod.rs b/generated/stripe_billing/src/subscriptions_trials_resource_trial_settings/mod.rs new file mode 100644 index 000000000..12f83ff4b --- /dev/null +++ b/generated/stripe_billing/src/subscriptions_trials_resource_trial_settings/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::subscriptions_trials_resource_trial_settings::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/tax_id/mod.rs b/generated/stripe_billing/src/tax_id/mod.rs new file mode 100644 index 000000000..15bc4d40c --- /dev/null +++ b/generated/stripe_billing/src/tax_id/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::tax_id::*; +#[cfg(feature = "tax_id")] +mod requests; +#[cfg(feature = "tax_id")] +pub use requests::*; diff --git a/generated/stripe_billing/src/tax_id/requests.rs b/generated/stripe_billing/src/tax_id/requests.rs new file mode 100644 index 000000000..320850d23 --- /dev/null +++ b/generated/stripe_billing/src/tax_id/requests.rs @@ -0,0 +1,362 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxId<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. + #[serde(rename = "type")] + pub type_: CreateTaxIdType, + /// Value of the tax ID. + pub value: &'a str, +} +impl<'a> CreateTaxId<'a> { + pub fn new(type_: CreateTaxIdType, value: &'a str) -> Self { + Self { expand: Default::default(), type_, value } + } +} +/// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateTaxIdType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateTaxIdType { + pub fn as_str(self) -> &'static str { + use CreateTaxIdType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateTaxIdType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxIdType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxIdType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxIdType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateTaxId<'a> { + /// Creates a new `tax_id` object for a customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::Response { + client.send_form(&format!("/customers/{customer}/tax_ids"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTaxId<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTaxId<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTaxId<'a> { + /// Retrieves the `tax_id` object with the given identifier. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + id: &str, + ) -> stripe::Response { + client.get_query(&format!("/customers/{customer}/tax_ids/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTaxId<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListTaxId<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTaxId<'a> { + /// Returns a list of tax IDs for a customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::Response> { + client.get_query(&format!("/customers/{customer}/tax_ids"), self) + } + pub fn paginate( + self, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params(&format!("/customers/{customer}/tax_ids"), self) + } +} +impl<'a> stripe::PaginationParams for ListTaxId<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteTaxId {} +impl DeleteTaxId { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteTaxId { + /// Deletes an existing `tax_id` object. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/tax_ids/{id}"), + self, + http_types::Method::Delete, + ) + } +} diff --git a/generated/stripe_billing/src/tax_id_verification/mod.rs b/generated/stripe_billing/src/tax_id_verification/mod.rs new file mode 100644 index 000000000..67fb33987 --- /dev/null +++ b/generated/stripe_billing/src/tax_id_verification/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::tax_id_verification::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/test_clock/mod.rs b/generated/stripe_billing/src/test_clock/mod.rs new file mode 100644 index 000000000..b0ce4430a --- /dev/null +++ b/generated/stripe_billing/src/test_clock/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::test_clock::*; +#[cfg(feature = "test_clock")] +mod requests; +#[cfg(feature = "test_clock")] +pub use requests::*; diff --git a/generated/stripe_billing/src/test_clock/requests.rs b/generated/stripe_billing/src/test_clock/requests.rs new file mode 100644 index 000000000..1f134d9fc --- /dev/null +++ b/generated/stripe_billing/src/test_clock/requests.rs @@ -0,0 +1,138 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTestClock<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTestClock<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTestClock<'a> { + /// Retrieves a test clock. + pub fn send( + &self, + client: &stripe::Client, + test_clock: &str, + ) -> stripe::Response { + client.get_query(&format!("/test_helpers/test_clocks/{test_clock}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTestClock<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The initial frozen time for this test clock. + pub frozen_time: stripe_types::Timestamp, + /// The name for this test clock. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, +} +impl<'a> CreateTestClock<'a> { + pub fn new(frozen_time: stripe_types::Timestamp) -> Self { + Self { expand: Default::default(), frozen_time, name: Default::default() } + } +} +impl<'a> CreateTestClock<'a> { + /// Creates a new test clock that can be attached to new customers and quotes. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/test_helpers/test_clocks", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteTestClock {} +impl DeleteTestClock { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteTestClock { + /// Deletes a test clock. + pub fn send( + &self, + client: &stripe::Client, + test_clock: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/test_clocks/{test_clock}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct AdvanceTestClock<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The time to advance the test clock. + /// + /// Must be after the test clock's current frozen time. + /// Cannot be more than two intervals in the future from the shortest subscription in this test clock. + /// If there are no subscriptions in this test clock, it cannot be more than two years in the future. + pub frozen_time: stripe_types::Timestamp, +} +impl<'a> AdvanceTestClock<'a> { + pub fn new(frozen_time: stripe_types::Timestamp) -> Self { + Self { expand: Default::default(), frozen_time } + } +} +impl<'a> AdvanceTestClock<'a> { + /// Starts advancing a test clock to a specified time in the future. + /// + /// Advancement is done when status changes to `Ready`. + pub fn send( + &self, + client: &stripe::Client, + test_clock: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/test_clocks/{test_clock}/advance"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTestClock<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListTestClock<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTestClock<'a> { + /// Returns a list of your test clocks. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/test_helpers/test_clocks", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/test_helpers/test_clocks", self) + } +} +impl<'a> stripe::PaginationParams for ListTestClock<'a> {} diff --git a/generated/stripe_billing/src/transform_usage/mod.rs b/generated/stripe_billing/src/transform_usage/mod.rs new file mode 100644 index 000000000..9d30281a2 --- /dev/null +++ b/generated/stripe_billing/src/transform_usage/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::transform_usage::*; \ No newline at end of file diff --git a/generated/stripe_billing/src/usage_record/mod.rs b/generated/stripe_billing/src/usage_record/mod.rs new file mode 100644 index 000000000..06b1ce5b0 --- /dev/null +++ b/generated/stripe_billing/src/usage_record/mod.rs @@ -0,0 +1,30 @@ +/// Usage records allow you to report customer usage and metrics to Stripe for +/// metered billing of subscription prices. +/// +/// Related guide: [Metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct UsageRecord { + /// Unique identifier for the object. + pub id: stripe_billing::usage_record::UsageRecordId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The usage quantity for the specified date. + pub quantity: u64, + /// The ID of the subscription item this usage record contains data for. + pub subscription_item: String, + /// The timestamp when this usage occurred. + pub timestamp: stripe_types::Timestamp, +} +impl stripe_types::Object for UsageRecord { + type Id = stripe_billing::usage_record::UsageRecordId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(UsageRecordId, "mbur_"); +#[cfg(feature = "usage_record")] +mod requests; +#[cfg(feature = "usage_record")] +pub use requests::*; diff --git a/generated/stripe_billing/src/usage_record/requests.rs b/generated/stripe_billing/src/usage_record/requests.rs new file mode 100644 index 000000000..794d647b4 --- /dev/null +++ b/generated/stripe_billing/src/usage_record/requests.rs @@ -0,0 +1,120 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateUsageRecord<'a> { + /// Valid values are `increment` (default) or `set`. + /// + /// When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. + /// The `set` action will overwrite the usage quantity at that timestamp. + /// If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), `increment` is the only allowed value. + #[serde(skip_serializing_if = "Option::is_none")] + pub action: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The usage quantity for the specified timestamp. + pub quantity: u64, + /// The timestamp for the usage event. + /// + /// This timestamp must be within the current billing period of the subscription of the provided `subscription_item`, and must not be in the future. + /// When passing `"now"`, Stripe records usage for the current time. + /// Default is `"now"` if a value is not provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub timestamp: Option, +} +impl<'a> CreateUsageRecord<'a> { + pub fn new(quantity: u64) -> Self { + Self { + action: Default::default(), + expand: Default::default(), + quantity, + timestamp: Default::default(), + } + } +} +/// Valid values are `increment` (default) or `set`. +/// +/// When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. +/// The `set` action will overwrite the usage quantity at that timestamp. +/// If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), `increment` is the only allowed value. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateUsageRecordAction { + Increment, + Set, +} +impl CreateUsageRecordAction { + pub fn as_str(self) -> &'static str { + use CreateUsageRecordAction::*; + match self { + Increment => "increment", + Set => "set", + } + } +} + +impl std::str::FromStr for CreateUsageRecordAction { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateUsageRecordAction::*; + match s { + "increment" => Ok(Increment), + "set" => Ok(Set), + _ => Err(()), + } + } +} +impl AsRef for CreateUsageRecordAction { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateUsageRecordAction { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateUsageRecordAction { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateUsageRecordAction { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The timestamp for the usage event. +/// +/// This timestamp must be within the current billing period of the subscription of the provided `subscription_item`, and must not be in the future. +/// When passing `"now"`, Stripe records usage for the current time. +/// Default is `"now"` if a value is not provided. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreateUsageRecordTimestamp { + Now, + Timestamp(stripe_types::Timestamp), +} +impl<'a> CreateUsageRecord<'a> { + /// Creates a usage record for a specified subscription item and date, and fills it with a quantity. + /// + /// Usage records provide `quantity` information that Stripe uses to track how much a customer is using your service. + /// + /// With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. The default calculation for usage is to add up all the `quantity` values of the usage records within a billing period. + /// You can change this default behavior with the billing plan’s `aggregate_usage` [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). + /// When there is more than one usage record with the same timestamp, Stripe adds the `quantity` values together. + /// In most cases, this is the desired resolution, however, you can change this behavior with the `action` parameter. The default pricing model for metered billing is [per-unit pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme). + /// For finer granularity, you can configure metered billing to have a [tiered pricing](https://stripe.com/docs/billing/subscriptions/tiers) model. + pub fn send( + &self, + client: &stripe::Client, + subscription_item: &stripe_types::subscription_item::SubscriptionItemId, + ) -> stripe::Response { + client.send_form( + &format!("/subscription_items/{subscription_item}/usage_records"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_billing/src/usage_record_summary/mod.rs b/generated/stripe_billing/src/usage_record_summary/mod.rs new file mode 100644 index 000000000..d76354db6 --- /dev/null +++ b/generated/stripe_billing/src/usage_record_summary/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::usage_record_summary::*; +#[cfg(feature = "usage_record_summary")] +mod requests; +#[cfg(feature = "usage_record_summary")] +pub use requests::*; diff --git a/generated/stripe_billing/src/usage_record_summary/requests.rs b/generated/stripe_billing/src/usage_record_summary/requests.rs new file mode 100644 index 000000000..bcca01338 --- /dev/null +++ b/generated/stripe_billing/src/usage_record_summary/requests.rs @@ -0,0 +1,55 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListUsageRecordSummary<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListUsageRecordSummary<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListUsageRecordSummary<'a> { + /// For the specified subscription item, returns a list of summary objects. + /// + /// Each object in the list provides usage information that’s been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). The list is sorted in reverse-chronological order (newest first). + /// The first list item represents the most current usage period that hasn’t ended yet. + /// Since new usage records can still be added, the returned summary information for the subscription item’s ID should be seen as unstable until the subscription billing period ends. + pub fn send( + &self, + client: &stripe::Client, + subscription_item: &stripe_types::subscription_item::SubscriptionItemId, + ) -> stripe::Response> { + client.get_query( + &format!("/subscription_items/{subscription_item}/usage_record_summaries"), + self, + ) + } + pub fn paginate( + self, + subscription_item: &stripe_types::subscription_item::SubscriptionItemId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params( + &format!("/subscription_items/{subscription_item}/usage_record_summaries"), + self, + ) + } +} +impl<'a> stripe::PaginationParams for ListUsageRecordSummary<'a> {} diff --git a/generated/stripe_checkout/Cargo.toml b/generated/stripe_checkout/Cargo.toml new file mode 100644 index 000000000..ffde390a4 --- /dev/null +++ b/generated/stripe_checkout/Cargo.toml @@ -0,0 +1,41 @@ +[package] +name = "stripe_checkout" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + +[dependencies] +serde.workspace = true +http-types.workspace = true +smol_str.workspace = true +serde_json.workspace = true +async-stripe = {path = "../../async-stripe"} + +stripe_types = {path = "../../stripe_types"} + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +session = [] + +full = ["session"] + diff --git a/generated/stripe_checkout/src/checkout_acss_debit_mandate_options/mod.rs b/generated/stripe_checkout/src/checkout_acss_debit_mandate_options/mod.rs new file mode 100644 index 000000000..8d40be7aa --- /dev/null +++ b/generated/stripe_checkout/src/checkout_acss_debit_mandate_options/mod.rs @@ -0,0 +1,208 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutAcssDebitMandateOptions { + /// A URL for custom mandate text. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option, + /// List of Stripe products where this mandate can be selected automatically. + /// + /// Returned when the Session is in `setup` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for: Option>, + /// Description of the interval. + /// + /// Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + pub interval_description: Option, + /// Payment schedule for the mandate. + pub payment_schedule: Option, + /// Transaction type of the mandate. + pub transaction_type: Option, +} +/// List of Stripe products where this mandate can be selected automatically. +/// +/// Returned when the Session is in `setup` mode. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAcssDebitMandateOptionsDefaultFor { + Invoice, + Subscription, +} +impl CheckoutAcssDebitMandateOptionsDefaultFor { + pub fn as_str(self) -> &'static str { + use CheckoutAcssDebitMandateOptionsDefaultFor::*; + match self { + Invoice => "invoice", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for CheckoutAcssDebitMandateOptionsDefaultFor { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAcssDebitMandateOptionsDefaultFor::*; + match s { + "invoice" => Ok(Invoice), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl AsRef for CheckoutAcssDebitMandateOptionsDefaultFor { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAcssDebitMandateOptionsDefaultFor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAcssDebitMandateOptionsDefaultFor { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for CheckoutAcssDebitMandateOptionsDefaultFor") + }) + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAcssDebitMandateOptionsPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl CheckoutAcssDebitMandateOptionsPaymentSchedule { + pub fn as_str(self) -> &'static str { + use CheckoutAcssDebitMandateOptionsPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr for CheckoutAcssDebitMandateOptionsPaymentSchedule { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAcssDebitMandateOptionsPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl AsRef for CheckoutAcssDebitMandateOptionsPaymentSchedule { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutAcssDebitMandateOptionsPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAcssDebitMandateOptionsPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAcssDebitMandateOptionsPaymentSchedule { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAcssDebitMandateOptionsPaymentSchedule { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAcssDebitMandateOptionsPaymentSchedule", + ) + }) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl CheckoutAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use CheckoutAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr for CheckoutAcssDebitMandateOptionsTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl AsRef for CheckoutAcssDebitMandateOptionsTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutAcssDebitMandateOptionsTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAcssDebitMandateOptionsTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAcssDebitMandateOptionsTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAcssDebitMandateOptionsTransactionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAcssDebitMandateOptionsTransactionType", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_acss_debit_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_acss_debit_payment_method_options/mod.rs new file mode 100644 index 000000000..0f3190ae0 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_acss_debit_payment_method_options/mod.rs @@ -0,0 +1,218 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutAcssDebitPaymentMethodOptions { + /// Currency supported by the bank account. + /// + /// Returned when the Session is in `setup` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option, +} +/// Currency supported by the bank account. +/// +/// Returned when the Session is in `setup` mode. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAcssDebitPaymentMethodOptionsCurrency { + Cad, + Usd, +} +impl CheckoutAcssDebitPaymentMethodOptionsCurrency { + pub fn as_str(self) -> &'static str { + use CheckoutAcssDebitPaymentMethodOptionsCurrency::*; + match self { + Cad => "cad", + Usd => "usd", + } + } +} + +impl std::str::FromStr for CheckoutAcssDebitPaymentMethodOptionsCurrency { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAcssDebitPaymentMethodOptionsCurrency::*; + match s { + "cad" => Ok(Cad), + "usd" => Ok(Usd), + _ => Err(()), + } + } +} +impl AsRef for CheckoutAcssDebitPaymentMethodOptionsCurrency { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutAcssDebitPaymentMethodOptionsCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAcssDebitPaymentMethodOptionsCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAcssDebitPaymentMethodOptionsCurrency { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAcssDebitPaymentMethodOptionsCurrency { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAcssDebitPaymentMethodOptionsCurrency", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { + pub fn as_str(self) -> &'static str { + use CheckoutAcssDebitPaymentMethodOptionsVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAcssDebitPaymentMethodOptionsVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_affirm_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_affirm_payment_method_options/mod.rs new file mode 100644 index 000000000..05fc4141e --- /dev/null +++ b/generated/stripe_checkout/src/checkout_affirm_payment_method_options/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutAffirmPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutAffirmPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAffirmPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_afterpay_clearpay_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_afterpay_clearpay_payment_method_options/mod.rs new file mode 100644 index 000000000..440c63095 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_afterpay_clearpay_payment_method_options/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutAfterpayClearpayPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_alipay_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_alipay_payment_method_options/mod.rs new file mode 100644 index 000000000..402016953 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_alipay_payment_method_options/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutAlipayPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutAlipayPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAlipayPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_au_becs_debit_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_au_becs_debit_payment_method_options/mod.rs new file mode 100644 index 000000000..f6e1c188e --- /dev/null +++ b/generated/stripe_checkout/src/checkout_au_becs_debit_payment_method_options/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutAuBecsDebitPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_bacs_debit_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_bacs_debit_payment_method_options/mod.rs new file mode 100644 index 000000000..afac34bcd --- /dev/null +++ b/generated/stripe_checkout/src/checkout_bacs_debit_payment_method_options/mod.rs @@ -0,0 +1,79 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutBacsDebitPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_bancontact_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_bancontact_payment_method_options/mod.rs new file mode 100644 index 000000000..2b907b743 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_bancontact_payment_method_options/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutBancontactPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutBancontactPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutBancontactPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_boleto_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_boleto_payment_method_options/mod.rs new file mode 100644 index 000000000..32fddebab --- /dev/null +++ b/generated/stripe_checkout/src/checkout_boleto_payment_method_options/mod.rs @@ -0,0 +1,83 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CheckoutBoletoPaymentMethodOptions { + /// The number of calendar days before a Boleto voucher expires. + /// + /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time. + pub expires_after_days: u32, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutBoletoPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutBoletoPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_card_installments_options/mod.rs b/generated/stripe_checkout/src/checkout_card_installments_options/mod.rs new file mode 100644 index 000000000..441fa282a --- /dev/null +++ b/generated/stripe_checkout/src/checkout_card_installments_options/mod.rs @@ -0,0 +1,6 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutCardInstallmentsOptions { + /// Indicates if installments are enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} diff --git a/generated/stripe_checkout/src/checkout_card_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_card_payment_method_options/mod.rs new file mode 100644 index 000000000..1d6c777af --- /dev/null +++ b/generated/stripe_checkout/src/checkout_card_payment_method_options/mod.rs @@ -0,0 +1,95 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutCardPaymentMethodOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub installments: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Provides information about a card payment that customers see on their statements. + /// + /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kana: Option, + /// Provides information about a card payment that customers see on their statements. + /// + /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 17 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kanji: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutCardPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CheckoutCardPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutCardPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CheckoutCardPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutCardPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CheckoutCardPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutCardPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutCardPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutCardPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutCardPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutCardPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_cashapp_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_cashapp_payment_method_options/mod.rs new file mode 100644 index 000000000..7146010ec --- /dev/null +++ b/generated/stripe_checkout/src/checkout_cashapp_payment_method_options/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutCashappPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutCashappPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutCashappPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutCashappPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_customer_balance_bank_transfer_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_customer_balance_bank_transfer_payment_method_options/mod.rs new file mode 100644 index 000000000..9dd9cc359 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_customer_balance_bank_transfer_payment_method_options/mod.rs @@ -0,0 +1,170 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutCustomerBalanceBankTransferPaymentMethodOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub eu_bank_transfer: Option, + /// List of address types that should be returned in the financial_addresses response. + /// + /// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested_address_types: + Option>, + /// The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + #[serde(rename = "type")] + pub type_: Option, +} +/// List of address types that should be returned in the financial_addresses response. +/// +/// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes { + Aba, + Iban, + Sepa, + SortCode, + Spei, + Swift, + Zengin, +} +impl CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes { + pub fn as_str(self) -> &'static str { + use CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::*; + match self { + Aba => "aba", + Iban => "iban", + Sepa => "sepa", + SortCode => "sort_code", + Spei => "spei", + Swift => "swift", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr + for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::*; + match s { + "aba" => Ok(Aba), + "iban" => Ok(Iban), + "sepa" => Ok(Sepa), + "sort_code" => Ok(SortCode), + "spei" => Ok(Spei), + "swift" => Ok(Swift), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl AsRef for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes")) + } +} +/// The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { + pub fn as_str(self) -> &'static str { + use CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "gb_bank_transfer" => Ok(GbBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + "mx_bank_transfer" => Ok(MxBankTransfer), + "us_bank_transfer" => Ok(UsBankTransfer), + _ => Err(()), + } + } +} +impl AsRef for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_customer_balance_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_customer_balance_payment_method_options/mod.rs new file mode 100644 index 000000000..3f5d25d7a --- /dev/null +++ b/generated/stripe_checkout/src/checkout_customer_balance_payment_method_options/mod.rs @@ -0,0 +1,141 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutCustomerBalancePaymentMethodOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: + Option, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// + /// Permitted values include: `bank_transfer`. + pub funding_type: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// The funding method type to be used when there are not enough funds in the customer balance. +/// +/// Permitted values include: `bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutCustomerBalancePaymentMethodOptionsFundingType { + BankTransfer, +} +impl CheckoutCustomerBalancePaymentMethodOptionsFundingType { + pub fn as_str(self) -> &'static str { + use CheckoutCustomerBalancePaymentMethodOptionsFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr for CheckoutCustomerBalancePaymentMethodOptionsFundingType { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutCustomerBalancePaymentMethodOptionsFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl AsRef for CheckoutCustomerBalancePaymentMethodOptionsFundingType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutCustomerBalancePaymentMethodOptionsFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutCustomerBalancePaymentMethodOptionsFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutCustomerBalancePaymentMethodOptionsFundingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutCustomerBalancePaymentMethodOptionsFundingType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutCustomerBalancePaymentMethodOptionsFundingType", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_eps_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_eps_payment_method_options/mod.rs new file mode 100644 index 000000000..6be3dac7f --- /dev/null +++ b/generated/stripe_checkout/src/checkout_eps_payment_method_options/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutEpsPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutEpsPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutEpsPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutEpsPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutEpsPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutEpsPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CheckoutEpsPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutEpsPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutEpsPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutEpsPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutEpsPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutEpsPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_fpx_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_fpx_payment_method_options/mod.rs new file mode 100644 index 000000000..95f9ee476 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_fpx_payment_method_options/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutFpxPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutFpxPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutFpxPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutFpxPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutFpxPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutFpxPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CheckoutFpxPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutFpxPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutFpxPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutFpxPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutFpxPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutFpxPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_giropay_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_giropay_payment_method_options/mod.rs new file mode 100644 index 000000000..ae6e8a082 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_giropay_payment_method_options/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutGiropayPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutGiropayPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutGiropayPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_grab_pay_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_grab_pay_payment_method_options/mod.rs new file mode 100644 index 000000000..a846760bb --- /dev/null +++ b/generated/stripe_checkout/src/checkout_grab_pay_payment_method_options/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutGrabPayPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_ideal_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_ideal_payment_method_options/mod.rs new file mode 100644 index 000000000..09533a76f --- /dev/null +++ b/generated/stripe_checkout/src/checkout_ideal_payment_method_options/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutIdealPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutIdealPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutIdealPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutIdealPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutIdealPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutIdealPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CheckoutIdealPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutIdealPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutIdealPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutIdealPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutIdealPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutIdealPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_klarna_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_klarna_payment_method_options/mod.rs new file mode 100644 index 000000000..77f3ed693 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_klarna_payment_method_options/mod.rs @@ -0,0 +1,79 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutKlarnaPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_konbini_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_konbini_payment_method_options/mod.rs new file mode 100644 index 000000000..c666e6e95 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_konbini_payment_method_options/mod.rs @@ -0,0 +1,77 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutKonbiniPaymentMethodOptions { + /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. + /// + /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_link_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_link_payment_method_options/mod.rs new file mode 100644 index 000000000..4d2023904 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_link_payment_method_options/mod.rs @@ -0,0 +1,76 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutLinkPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, +} +impl CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutLinkPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutLinkPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutLinkPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_oxxo_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_oxxo_payment_method_options/mod.rs new file mode 100644 index 000000000..c67a1a7e4 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_oxxo_payment_method_options/mod.rs @@ -0,0 +1,77 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CheckoutOxxoPaymentMethodOptions { + /// The number of calendar days before an OXXO invoice expires. + /// + /// For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + pub expires_after_days: u32, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutOxxoPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutOxxoPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_p24_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_p24_payment_method_options/mod.rs new file mode 100644 index 000000000..981ea7d9a --- /dev/null +++ b/generated/stripe_checkout/src/checkout_p24_payment_method_options/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutP24PaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutP24PaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutP24PaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutP24PaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutP24PaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutP24PaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CheckoutP24PaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutP24PaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutP24PaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutP24PaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutP24PaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutP24PaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_paynow_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_paynow_payment_method_options/mod.rs new file mode 100644 index 000000000..073f001b6 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_paynow_payment_method_options/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutPaynowPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutPaynowPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutPaynowPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_paypal_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_paypal_payment_method_options/mod.rs new file mode 100644 index 000000000..89005f46b --- /dev/null +++ b/generated/stripe_checkout/src/checkout_paypal_payment_method_options/mod.rs @@ -0,0 +1,144 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutPaypalPaymentMethodOptions { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred locale of the PayPal checkout page that the customer is redirected to. + pub preferred_locale: Option, + /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. + /// + /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + pub reference: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutPaypalPaymentMethodOptionsCaptureMethod { + Manual, +} +impl CheckoutPaypalPaymentMethodOptionsCaptureMethod { + pub fn as_str(self) -> &'static str { + use CheckoutPaypalPaymentMethodOptionsCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CheckoutPaypalPaymentMethodOptionsCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutPaypalPaymentMethodOptionsCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for CheckoutPaypalPaymentMethodOptionsCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutPaypalPaymentMethodOptionsCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutPaypalPaymentMethodOptionsCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutPaypalPaymentMethodOptionsCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutPaypalPaymentMethodOptionsCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutPaypalPaymentMethodOptionsCaptureMethod", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, +} +impl CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutPaypalPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutPaypalPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutPaypalPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_pix_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_pix_payment_method_options/mod.rs new file mode 100644 index 000000000..e36949e64 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_pix_payment_method_options/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutPixPaymentMethodOptions { + /// The number of seconds after which Pix payment will expire. + pub expires_after_seconds: Option, +} diff --git a/generated/stripe_checkout/src/checkout_revolut_pay_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_revolut_pay_payment_method_options/mod.rs new file mode 100644 index 000000000..a780a71df --- /dev/null +++ b/generated/stripe_checkout/src/checkout_revolut_pay_payment_method_options/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutRevolutPayPaymentMethodOptions {} diff --git a/generated/stripe_checkout/src/checkout_sepa_debit_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_sepa_debit_payment_method_options/mod.rs new file mode 100644 index 000000000..ded816aca --- /dev/null +++ b/generated/stripe_checkout/src/checkout_sepa_debit_payment_method_options/mod.rs @@ -0,0 +1,79 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutSepaDebitPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_session_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_session_payment_method_options/mod.rs new file mode 100644 index 000000000..ca92e35c9 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_session_payment_method_options/mod.rs @@ -0,0 +1,59 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutSessionPaymentMethodOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} diff --git a/generated/stripe_checkout/src/checkout_sofort_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_sofort_payment_method_options/mod.rs new file mode 100644 index 000000000..f9e5e230e --- /dev/null +++ b/generated/stripe_checkout/src/checkout_sofort_payment_method_options/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutSofortPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutSofortPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutSofortPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutSofortPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutSofortPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutSofortPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CheckoutSofortPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutSofortPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutSofortPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutSofortPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutSofortPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutSofortPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_us_bank_account_payment_method_options/mod.rs b/generated/stripe_checkout/src/checkout_us_bank_account_payment_method_options/mod.rs new file mode 100644 index 000000000..1f635b50d --- /dev/null +++ b/generated/stripe_checkout/src/checkout_us_bank_account_payment_method_options/mod.rs @@ -0,0 +1,146 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutUsBankAccountPaymentMethodOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { + Automatic, + Instant, +} +impl CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { + pub fn as_str(self) -> &'static str { + use CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + } + } +} + +impl std::str::FromStr for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + _ => Err(()), + } + } +} +impl AsRef for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/mod.rs b/generated/stripe_checkout/src/mod.rs new file mode 100644 index 000000000..59c97acd7 --- /dev/null +++ b/generated/stripe_checkout/src/mod.rs @@ -0,0 +1,120 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::invalid_html_tags)] +extern crate self as stripe_checkout; +pub mod session; +pub use session::Session; +pub mod checkout_acss_debit_mandate_options; +pub use checkout_acss_debit_mandate_options::CheckoutAcssDebitMandateOptions; +pub mod checkout_acss_debit_payment_method_options; +pub use checkout_acss_debit_payment_method_options::CheckoutAcssDebitPaymentMethodOptions; +pub mod checkout_affirm_payment_method_options; +pub use checkout_affirm_payment_method_options::CheckoutAffirmPaymentMethodOptions; +pub mod checkout_afterpay_clearpay_payment_method_options; +pub use checkout_afterpay_clearpay_payment_method_options::CheckoutAfterpayClearpayPaymentMethodOptions; +pub mod checkout_alipay_payment_method_options; +pub use checkout_alipay_payment_method_options::CheckoutAlipayPaymentMethodOptions; +pub mod checkout_au_becs_debit_payment_method_options; +pub use checkout_au_becs_debit_payment_method_options::CheckoutAuBecsDebitPaymentMethodOptions; +pub mod checkout_bacs_debit_payment_method_options; +pub use checkout_bacs_debit_payment_method_options::CheckoutBacsDebitPaymentMethodOptions; +pub mod checkout_bancontact_payment_method_options; +pub use checkout_bancontact_payment_method_options::CheckoutBancontactPaymentMethodOptions; +pub mod checkout_boleto_payment_method_options; +pub use checkout_boleto_payment_method_options::CheckoutBoletoPaymentMethodOptions; +pub mod checkout_card_installments_options; +pub use checkout_card_installments_options::CheckoutCardInstallmentsOptions; +pub mod checkout_card_payment_method_options; +pub use checkout_card_payment_method_options::CheckoutCardPaymentMethodOptions; +pub mod checkout_cashapp_payment_method_options; +pub use checkout_cashapp_payment_method_options::CheckoutCashappPaymentMethodOptions; +pub mod checkout_customer_balance_bank_transfer_payment_method_options; +pub use checkout_customer_balance_bank_transfer_payment_method_options::CheckoutCustomerBalanceBankTransferPaymentMethodOptions; +pub mod checkout_customer_balance_payment_method_options; +pub use checkout_customer_balance_payment_method_options::CheckoutCustomerBalancePaymentMethodOptions; +pub mod checkout_eps_payment_method_options; +pub use checkout_eps_payment_method_options::CheckoutEpsPaymentMethodOptions; +pub mod checkout_fpx_payment_method_options; +pub use checkout_fpx_payment_method_options::CheckoutFpxPaymentMethodOptions; +pub mod checkout_giropay_payment_method_options; +pub use checkout_giropay_payment_method_options::CheckoutGiropayPaymentMethodOptions; +pub mod checkout_grab_pay_payment_method_options; +pub use checkout_grab_pay_payment_method_options::CheckoutGrabPayPaymentMethodOptions; +pub mod checkout_ideal_payment_method_options; +pub use checkout_ideal_payment_method_options::CheckoutIdealPaymentMethodOptions; +pub mod checkout_klarna_payment_method_options; +pub use checkout_klarna_payment_method_options::CheckoutKlarnaPaymentMethodOptions; +pub mod checkout_konbini_payment_method_options; +pub use checkout_konbini_payment_method_options::CheckoutKonbiniPaymentMethodOptions; +pub mod checkout_link_payment_method_options; +pub use checkout_link_payment_method_options::CheckoutLinkPaymentMethodOptions; +pub mod checkout_oxxo_payment_method_options; +pub use checkout_oxxo_payment_method_options::CheckoutOxxoPaymentMethodOptions; +pub mod checkout_p24_payment_method_options; +pub use checkout_p24_payment_method_options::CheckoutP24PaymentMethodOptions; +pub mod checkout_paynow_payment_method_options; +pub use checkout_paynow_payment_method_options::CheckoutPaynowPaymentMethodOptions; +pub mod checkout_paypal_payment_method_options; +pub use checkout_paypal_payment_method_options::CheckoutPaypalPaymentMethodOptions; +pub mod checkout_pix_payment_method_options; +pub use checkout_pix_payment_method_options::CheckoutPixPaymentMethodOptions; +pub mod checkout_revolut_pay_payment_method_options; +pub use checkout_revolut_pay_payment_method_options::CheckoutRevolutPayPaymentMethodOptions; +pub mod checkout_sepa_debit_payment_method_options; +pub use checkout_sepa_debit_payment_method_options::CheckoutSepaDebitPaymentMethodOptions; +pub mod checkout_session_payment_method_options; +pub use checkout_session_payment_method_options::CheckoutSessionPaymentMethodOptions; +pub mod checkout_sofort_payment_method_options; +pub use checkout_sofort_payment_method_options::CheckoutSofortPaymentMethodOptions; +pub mod checkout_us_bank_account_payment_method_options; +pub use checkout_us_bank_account_payment_method_options::CheckoutUsBankAccountPaymentMethodOptions; +pub mod payment_pages_checkout_session_after_expiration; +pub use payment_pages_checkout_session_after_expiration::PaymentPagesCheckoutSessionAfterExpiration; +pub mod payment_pages_checkout_session_after_expiration_recovery; +pub use payment_pages_checkout_session_after_expiration_recovery::PaymentPagesCheckoutSessionAfterExpirationRecovery; +pub mod payment_pages_checkout_session_automatic_tax; +pub use payment_pages_checkout_session_automatic_tax::PaymentPagesCheckoutSessionAutomaticTax; +pub mod payment_pages_checkout_session_consent; +pub use payment_pages_checkout_session_consent::PaymentPagesCheckoutSessionConsent; +pub mod payment_pages_checkout_session_consent_collection; +pub use payment_pages_checkout_session_consent_collection::PaymentPagesCheckoutSessionConsentCollection; +pub mod payment_pages_checkout_session_currency_conversion; +pub use payment_pages_checkout_session_currency_conversion::PaymentPagesCheckoutSessionCurrencyConversion; +pub mod payment_pages_checkout_session_custom_fields; +pub use payment_pages_checkout_session_custom_fields::PaymentPagesCheckoutSessionCustomFields; +pub mod payment_pages_checkout_session_custom_fields_dropdown; +pub use payment_pages_checkout_session_custom_fields_dropdown::PaymentPagesCheckoutSessionCustomFieldsDropdown; +pub mod payment_pages_checkout_session_custom_fields_label; +pub use payment_pages_checkout_session_custom_fields_label::PaymentPagesCheckoutSessionCustomFieldsLabel; +pub mod payment_pages_checkout_session_custom_fields_numeric; +pub use payment_pages_checkout_session_custom_fields_numeric::PaymentPagesCheckoutSessionCustomFieldsNumeric; +pub mod payment_pages_checkout_session_custom_fields_option; +pub use payment_pages_checkout_session_custom_fields_option::PaymentPagesCheckoutSessionCustomFieldsOption; +pub mod payment_pages_checkout_session_custom_fields_text; +pub use payment_pages_checkout_session_custom_fields_text::PaymentPagesCheckoutSessionCustomFieldsText; +pub mod payment_pages_checkout_session_custom_text; +pub use payment_pages_checkout_session_custom_text::PaymentPagesCheckoutSessionCustomText; +pub mod payment_pages_checkout_session_custom_text_position; +pub use payment_pages_checkout_session_custom_text_position::PaymentPagesCheckoutSessionCustomTextPosition; +pub mod payment_pages_checkout_session_customer_details; +pub use payment_pages_checkout_session_customer_details::PaymentPagesCheckoutSessionCustomerDetails; +pub mod payment_pages_checkout_session_invoice_creation; +pub use payment_pages_checkout_session_invoice_creation::PaymentPagesCheckoutSessionInvoiceCreation; +pub mod payment_pages_checkout_session_invoice_settings; +pub use payment_pages_checkout_session_invoice_settings::PaymentPagesCheckoutSessionInvoiceSettings; +pub mod payment_pages_checkout_session_phone_number_collection; +pub use payment_pages_checkout_session_phone_number_collection::PaymentPagesCheckoutSessionPhoneNumberCollection; +pub mod payment_pages_checkout_session_shipping_address_collection; +pub use payment_pages_checkout_session_shipping_address_collection::PaymentPagesCheckoutSessionShippingAddressCollection; +pub mod payment_pages_checkout_session_shipping_cost; +pub use payment_pages_checkout_session_shipping_cost::PaymentPagesCheckoutSessionShippingCost; +pub mod payment_pages_checkout_session_shipping_option; +pub use payment_pages_checkout_session_shipping_option::PaymentPagesCheckoutSessionShippingOption; +pub mod payment_pages_checkout_session_tax_id; +pub use payment_pages_checkout_session_tax_id::PaymentPagesCheckoutSessionTaxId; +pub mod payment_pages_checkout_session_tax_id_collection; +pub use payment_pages_checkout_session_tax_id_collection::PaymentPagesCheckoutSessionTaxIdCollection; +pub mod payment_pages_checkout_session_total_details; +pub use payment_pages_checkout_session_total_details::PaymentPagesCheckoutSessionTotalDetails; +pub mod payment_pages_checkout_session_total_details_resource_breakdown; +pub use payment_pages_checkout_session_total_details_resource_breakdown::PaymentPagesCheckoutSessionTotalDetailsResourceBreakdown; diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_after_expiration/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_after_expiration/mod.rs new file mode 100644 index 000000000..8556d7c03 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_after_expiration/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionAfterExpiration { + /// When set, configuration used to recover the Checkout Session on expiry. + pub recovery: Option, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_after_expiration_recovery/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_after_expiration_recovery/mod.rs new file mode 100644 index 000000000..bd05eae4a --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_after_expiration_recovery/mod.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionAfterExpirationRecovery { + /// Enables user redeemable promotion codes on the recovered Checkout Sessions. + /// + /// Defaults to `false`. + pub allow_promotion_codes: bool, + /// If `true`, a recovery url will be generated to recover this Checkout Session if it + /// expires before a transaction is completed. + /// + /// It will be attached to the Checkout Session object upon expiration. + pub enabled: bool, + /// The timestamp at which the recovery URL will expire. + pub expires_at: Option, + /// URL that creates a new Checkout Session when clicked that is a copy of this expired Checkout Session. + pub url: Option, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_automatic_tax/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_automatic_tax/mod.rs new file mode 100644 index 000000000..b482e30a8 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_automatic_tax/mod.rs @@ -0,0 +1,72 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionAutomaticTax { + /// Indicates whether automatic tax is enabled for the session. + pub enabled: bool, + /// The status of the most recent automated tax calculation for this session. + pub status: Option, +} +/// The status of the most recent automated tax calculation for this session. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionAutomaticTaxStatus { + Complete, + Failed, + RequiresLocationInputs, +} +impl PaymentPagesCheckoutSessionAutomaticTaxStatus { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionAutomaticTaxStatus::*; + match self { + Complete => "complete", + Failed => "failed", + RequiresLocationInputs => "requires_location_inputs", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionAutomaticTaxStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionAutomaticTaxStatus::*; + match s { + "complete" => Ok(Complete), + "failed" => Ok(Failed), + "requires_location_inputs" => Ok(RequiresLocationInputs), + _ => Err(()), + } + } +} +impl AsRef for PaymentPagesCheckoutSessionAutomaticTaxStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionAutomaticTaxStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionAutomaticTaxStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionAutomaticTaxStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionAutomaticTaxStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentPagesCheckoutSessionAutomaticTaxStatus", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_consent/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_consent/mod.rs new file mode 100644 index 000000000..0dca26c97 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_consent/mod.rs @@ -0,0 +1,130 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionConsent { + /// If `opt_in`, the customer consents to receiving promotional communications + /// from the merchant about this Checkout Session. + pub promotions: Option, + /// If `accepted`, the customer in this Checkout Session has agreed to the merchant's terms of service. + pub terms_of_service: Option, +} +/// If `opt_in`, the customer consents to receiving promotional communications +/// from the merchant about this Checkout Session. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionConsentPromotions { + OptIn, + OptOut, +} +impl PaymentPagesCheckoutSessionConsentPromotions { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionConsentPromotions::*; + match self { + OptIn => "opt_in", + OptOut => "opt_out", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionConsentPromotions { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionConsentPromotions::*; + match s { + "opt_in" => Ok(OptIn), + "opt_out" => Ok(OptOut), + _ => Err(()), + } + } +} +impl AsRef for PaymentPagesCheckoutSessionConsentPromotions { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionConsentPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionConsentPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionConsentPromotions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionConsentPromotions { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentPagesCheckoutSessionConsentPromotions", + ) + }) + } +} +/// If `accepted`, the customer in this Checkout Session has agreed to the merchant's terms of service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionConsentTermsOfService { + Accepted, +} +impl PaymentPagesCheckoutSessionConsentTermsOfService { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionConsentTermsOfService::*; + match self { + Accepted => "accepted", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionConsentTermsOfService { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionConsentTermsOfService::*; + match s { + "accepted" => Ok(Accepted), + _ => Err(()), + } + } +} +impl AsRef for PaymentPagesCheckoutSessionConsentTermsOfService { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionConsentTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionConsentTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionConsentTermsOfService { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionConsentTermsOfService { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentPagesCheckoutSessionConsentTermsOfService", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_consent_collection/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_consent_collection/mod.rs new file mode 100644 index 000000000..bc893eab2 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_consent_collection/mod.rs @@ -0,0 +1,137 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionConsentCollection { + /// If set to `auto`, enables the collection of customer consent for promotional communications. + /// + /// The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. + /// Only available to US merchants. + pub promotions: Option, + /// If set to `required`, it requires customers to accept the terms of service before being able to pay. + pub terms_of_service: Option, +} +/// If set to `auto`, enables the collection of customer consent for promotional communications. +/// +/// The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. +/// Only available to US merchants. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionConsentCollectionPromotions { + Auto, + None, +} +impl PaymentPagesCheckoutSessionConsentCollectionPromotions { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionConsentCollectionPromotions::*; + match self { + Auto => "auto", + None => "none", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionConsentCollectionPromotions { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionConsentCollectionPromotions::*; + match s { + "auto" => Ok(Auto), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentPagesCheckoutSessionConsentCollectionPromotions { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionConsentCollectionPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionConsentCollectionPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionConsentCollectionPromotions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionConsentCollectionPromotions { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentPagesCheckoutSessionConsentCollectionPromotions", + ) + }) + } +} +/// If set to `required`, it requires customers to accept the terms of service before being able to pay. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionConsentCollectionTermsOfService { + None, + Required, +} +impl PaymentPagesCheckoutSessionConsentCollectionTermsOfService { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionConsentCollectionTermsOfService::*; + match self { + None => "none", + Required => "required", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionConsentCollectionTermsOfService { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionConsentCollectionTermsOfService::*; + match s { + "none" => Ok(None), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl AsRef for PaymentPagesCheckoutSessionConsentCollectionTermsOfService { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionConsentCollectionTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionConsentCollectionTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionConsentCollectionTermsOfService { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionConsentCollectionTermsOfService { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentPagesCheckoutSessionConsentCollectionTermsOfService", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_currency_conversion/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_currency_conversion/mod.rs new file mode 100644 index 000000000..ba71d0028 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_currency_conversion/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCurrencyConversion { + /// Total of all items in source currency before discounts or taxes are applied. + pub amount_subtotal: i64, + /// Total of all items in source currency after discounts and taxes are applied. + pub amount_total: i64, + /// Exchange rate used to convert source currency amounts to customer currency amounts. + pub fx_rate: String, + /// Creation currency of the CheckoutSession before localization. + pub source_currency: stripe_types::Currency, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields/mod.rs new file mode 100644 index 000000000..5112a7794 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields/mod.rs @@ -0,0 +1,86 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomFields { + #[serde(skip_serializing_if = "Option::is_none")] + pub dropdown: Option, + /// String of your choice that your integration can use to reconcile this field. + /// + /// Must be unique to this field, alphanumeric, and up to 200 characters. + pub key: String, + pub label: stripe_checkout::PaymentPagesCheckoutSessionCustomFieldsLabel, + #[serde(skip_serializing_if = "Option::is_none")] + pub numeric: Option, + /// Whether the customer is required to complete the field before completing the Checkout Session. + /// + /// Defaults to `false`. + pub optional: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub text: Option, + /// The type of the field. + #[serde(rename = "type")] + pub type_: PaymentPagesCheckoutSessionCustomFieldsType, +} +/// The type of the field. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionCustomFieldsType { + Dropdown, + Numeric, + Text, +} +impl PaymentPagesCheckoutSessionCustomFieldsType { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionCustomFieldsType::*; + match self { + Dropdown => "dropdown", + Numeric => "numeric", + Text => "text", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionCustomFieldsType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionCustomFieldsType::*; + match s { + "dropdown" => Ok(Dropdown), + "numeric" => Ok(Numeric), + "text" => Ok(Text), + _ => Err(()), + } + } +} +impl AsRef for PaymentPagesCheckoutSessionCustomFieldsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionCustomFieldsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionCustomFieldsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentPagesCheckoutSessionCustomFieldsType", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_dropdown/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_dropdown/mod.rs new file mode 100644 index 000000000..0c281e8b3 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_dropdown/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomFieldsDropdown { + /// The options available for the customer to select. + /// + /// Up to 200 options allowed. + pub options: Vec, + /// The option selected by the customer. + /// + /// This will be the `value` for the option. + pub value: Option, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_label/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_label/mod.rs new file mode 100644 index 000000000..c7016b0a6 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_label/mod.rs @@ -0,0 +1,69 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomFieldsLabel { + /// Custom text for the label, displayed to the customer. + /// + /// Up to 50 characters. + pub custom: Option, + /// The type of the label. + #[serde(rename = "type")] + pub type_: PaymentPagesCheckoutSessionCustomFieldsLabelType, +} +/// The type of the label. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionCustomFieldsLabelType { + Custom, +} +impl PaymentPagesCheckoutSessionCustomFieldsLabelType { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionCustomFieldsLabelType::*; + match self { + Custom => "custom", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionCustomFieldsLabelType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionCustomFieldsLabelType::*; + match s { + "custom" => Ok(Custom), + _ => Err(()), + } + } +} +impl AsRef for PaymentPagesCheckoutSessionCustomFieldsLabelType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionCustomFieldsLabelType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionCustomFieldsLabelType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentPagesCheckoutSessionCustomFieldsLabelType", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_numeric/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_numeric/mod.rs new file mode 100644 index 000000000..74e41bf6e --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_numeric/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomFieldsNumeric { + /// The maximum character length constraint for the customer's input. + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + pub minimum_length: Option, + /// The value entered by the customer, containing only digits. + pub value: Option, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_option/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_option/mod.rs new file mode 100644 index 000000000..c5de82e24 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_option/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomFieldsOption { + /// The label for the option, displayed to the customer. + /// + /// Up to 100 characters. + pub label: String, + /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. + /// + /// Must be unique to this option, alphanumeric, and up to 100 characters. + pub value: String, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_text/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_text/mod.rs new file mode 100644 index 000000000..48f5a6e6c --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_text/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomFieldsText { + /// The maximum character length constraint for the customer's input. + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + pub minimum_length: Option, + /// The value entered by the customer. + pub value: Option, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_custom_text/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_text/mod.rs new file mode 100644 index 000000000..6a5c4d221 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_text/mod.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomText { + /// Custom text that should be displayed alongside shipping address collection. + pub shipping_address: Option, + /// Custom text that should be displayed alongside the payment confirmation button. + pub submit: Option, + /// Custom text that should be displayed in place of the default terms of service agreement text. + pub terms_of_service_acceptance: + Option, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_custom_text_position/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_text_position/mod.rs new file mode 100644 index 000000000..513e59422 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_text_position/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomTextPosition { + /// Text may be up to 1200 characters in length. + pub message: String, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_customer_details/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_customer_details/mod.rs new file mode 100644 index 000000000..af87d4239 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_customer_details/mod.rs @@ -0,0 +1,85 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomerDetails { + /// The customer's address after a completed Checkout Session. + /// + /// Note: This property is populated only for sessions on or after March 30, 2022. + pub address: Option, + /// The email associated with the Customer, if one exists, on the Checkout Session after a completed Checkout Session or at time of session expiry. + /// Otherwise, if the customer has consented to promotional content, this value is the most recent valid email provided by the customer on the Checkout form. + pub email: Option, + /// The customer's name after a completed Checkout Session. + /// + /// Note: This property is populated only for sessions on or after March 30, 2022. + pub name: Option, + /// The customer's phone number after a completed Checkout Session. + pub phone: Option, + /// The customer’s tax exempt status after a completed Checkout Session. + pub tax_exempt: Option, + /// The customer’s tax IDs after a completed Checkout Session. + pub tax_ids: Option>, +} +/// The customer’s tax exempt status after a completed Checkout Session. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { + Exempt, + None, + Reverse, +} +impl PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionCustomerDetailsTaxExempt::*; + match self { + Exempt => "exempt", + None => "none", + Reverse => "reverse", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionCustomerDetailsTaxExempt::*; + match s { + "exempt" => Ok(Exempt), + "none" => Ok(None), + "reverse" => Ok(Reverse), + _ => Err(()), + } + } +} +impl AsRef for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_invoice_creation/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_invoice_creation/mod.rs new file mode 100644 index 000000000..4fe0bf5be --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_invoice_creation/mod.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionInvoiceCreation { + /// Indicates whether invoice creation is enabled for the Checkout Session. + pub enabled: bool, + pub invoice_data: stripe_checkout::PaymentPagesCheckoutSessionInvoiceSettings, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_invoice_settings/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_invoice_settings/mod.rs new file mode 100644 index 000000000..eaa045af7 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_invoice_settings/mod.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionInvoiceSettings { + /// The account tax IDs associated with the invoice. + pub account_tax_ids: Option>>, + /// Custom fields displayed on the invoice. + pub custom_fields: Option>, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// Footer displayed on the invoice. + pub footer: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// Options for invoice PDF rendering. + pub rendering_options: Option, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_phone_number_collection/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_phone_number_collection/mod.rs new file mode 100644 index 000000000..e7ea5e4d3 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_phone_number_collection/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionPhoneNumberCollection { + /// Indicates whether phone number collection is enabled for the session. + pub enabled: bool, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_address_collection/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_address_collection/mod.rs new file mode 100644 index 000000000..8dc1b5c3a --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_address_collection/mod.rs @@ -0,0 +1,783 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionShippingAddressCollection { + /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for + /// shipping locations. + /// + /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + pub allowed_countries: + Vec, +} +/// An array of two-letter ISO country codes representing which countries Checkout should provide as options for +/// shipping locations. +/// +/// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { + Ac, + Ad, + Ae, + Af, + Ag, + Ai, + Al, + Am, + Ao, + Aq, + Ar, + At, + Au, + Aw, + Ax, + Az, + Ba, + Bb, + Bd, + Be, + Bf, + Bg, + Bh, + Bi, + Bj, + Bl, + Bm, + Bn, + Bo, + Bq, + Br, + Bs, + Bt, + Bv, + Bw, + By, + Bz, + Ca, + Cd, + Cf, + Cg, + Ch, + Ci, + Ck, + Cl, + Cm, + Cn, + Co, + Cr, + Cv, + Cw, + Cy, + Cz, + De, + Dj, + Dk, + Dm, + Do, + Dz, + Ec, + Ee, + Eg, + Eh, + Er, + Es, + Et, + Fi, + Fj, + Fk, + Fo, + Fr, + Ga, + Gb, + Gd, + Ge, + Gf, + Gg, + Gh, + Gi, + Gl, + Gm, + Gn, + Gp, + Gq, + Gr, + Gs, + Gt, + Gu, + Gw, + Gy, + Hk, + Hn, + Hr, + Ht, + Hu, + Id, + Ie, + Il, + Im, + In, + Io, + Iq, + Is, + It, + Je, + Jm, + Jo, + Jp, + Ke, + Kg, + Kh, + Ki, + Km, + Kn, + Kr, + Kw, + Ky, + Kz, + La, + Lb, + Lc, + Li, + Lk, + Lr, + Ls, + Lt, + Lu, + Lv, + Ly, + Ma, + Mc, + Md, + Me, + Mf, + Mg, + Mk, + Ml, + Mm, + Mn, + Mo, + Mq, + Mr, + Ms, + Mt, + Mu, + Mv, + Mw, + Mx, + My, + Mz, + Na, + Nc, + Ne, + Ng, + Ni, + Nl, + No, + Np, + Nr, + Nu, + Nz, + Om, + Pa, + Pe, + Pf, + Pg, + Ph, + Pk, + Pl, + Pm, + Pn, + Pr, + Ps, + Pt, + Py, + Qa, + Re, + Ro, + Rs, + Ru, + Rw, + Sa, + Sb, + Sc, + Se, + Sg, + Sh, + Si, + Sj, + Sk, + Sl, + Sm, + Sn, + So, + Sr, + Ss, + St, + Sv, + Sx, + Sz, + Ta, + Tc, + Td, + Tf, + Tg, + Th, + Tj, + Tk, + Tl, + Tm, + Tn, + To, + Tr, + Tt, + Tv, + Tw, + Tz, + Ua, + Ug, + Us, + Uy, + Uz, + Va, + Vc, + Ve, + Vg, + Vn, + Vu, + Wf, + Ws, + Xk, + Ye, + Yt, + Za, + Zm, + Zw, + Zz, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::*; + match self { + Ac => "AC", + Ad => "AD", + Ae => "AE", + Af => "AF", + Ag => "AG", + Ai => "AI", + Al => "AL", + Am => "AM", + Ao => "AO", + Aq => "AQ", + Ar => "AR", + At => "AT", + Au => "AU", + Aw => "AW", + Ax => "AX", + Az => "AZ", + Ba => "BA", + Bb => "BB", + Bd => "BD", + Be => "BE", + Bf => "BF", + Bg => "BG", + Bh => "BH", + Bi => "BI", + Bj => "BJ", + Bl => "BL", + Bm => "BM", + Bn => "BN", + Bo => "BO", + Bq => "BQ", + Br => "BR", + Bs => "BS", + Bt => "BT", + Bv => "BV", + Bw => "BW", + By => "BY", + Bz => "BZ", + Ca => "CA", + Cd => "CD", + Cf => "CF", + Cg => "CG", + Ch => "CH", + Ci => "CI", + Ck => "CK", + Cl => "CL", + Cm => "CM", + Cn => "CN", + Co => "CO", + Cr => "CR", + Cv => "CV", + Cw => "CW", + Cy => "CY", + Cz => "CZ", + De => "DE", + Dj => "DJ", + Dk => "DK", + Dm => "DM", + Do => "DO", + Dz => "DZ", + Ec => "EC", + Ee => "EE", + Eg => "EG", + Eh => "EH", + Er => "ER", + Es => "ES", + Et => "ET", + Fi => "FI", + Fj => "FJ", + Fk => "FK", + Fo => "FO", + Fr => "FR", + Ga => "GA", + Gb => "GB", + Gd => "GD", + Ge => "GE", + Gf => "GF", + Gg => "GG", + Gh => "GH", + Gi => "GI", + Gl => "GL", + Gm => "GM", + Gn => "GN", + Gp => "GP", + Gq => "GQ", + Gr => "GR", + Gs => "GS", + Gt => "GT", + Gu => "GU", + Gw => "GW", + Gy => "GY", + Hk => "HK", + Hn => "HN", + Hr => "HR", + Ht => "HT", + Hu => "HU", + Id => "ID", + Ie => "IE", + Il => "IL", + Im => "IM", + In => "IN", + Io => "IO", + Iq => "IQ", + Is => "IS", + It => "IT", + Je => "JE", + Jm => "JM", + Jo => "JO", + Jp => "JP", + Ke => "KE", + Kg => "KG", + Kh => "KH", + Ki => "KI", + Km => "KM", + Kn => "KN", + Kr => "KR", + Kw => "KW", + Ky => "KY", + Kz => "KZ", + La => "LA", + Lb => "LB", + Lc => "LC", + Li => "LI", + Lk => "LK", + Lr => "LR", + Ls => "LS", + Lt => "LT", + Lu => "LU", + Lv => "LV", + Ly => "LY", + Ma => "MA", + Mc => "MC", + Md => "MD", + Me => "ME", + Mf => "MF", + Mg => "MG", + Mk => "MK", + Ml => "ML", + Mm => "MM", + Mn => "MN", + Mo => "MO", + Mq => "MQ", + Mr => "MR", + Ms => "MS", + Mt => "MT", + Mu => "MU", + Mv => "MV", + Mw => "MW", + Mx => "MX", + My => "MY", + Mz => "MZ", + Na => "NA", + Nc => "NC", + Ne => "NE", + Ng => "NG", + Ni => "NI", + Nl => "NL", + No => "NO", + Np => "NP", + Nr => "NR", + Nu => "NU", + Nz => "NZ", + Om => "OM", + Pa => "PA", + Pe => "PE", + Pf => "PF", + Pg => "PG", + Ph => "PH", + Pk => "PK", + Pl => "PL", + Pm => "PM", + Pn => "PN", + Pr => "PR", + Ps => "PS", + Pt => "PT", + Py => "PY", + Qa => "QA", + Re => "RE", + Ro => "RO", + Rs => "RS", + Ru => "RU", + Rw => "RW", + Sa => "SA", + Sb => "SB", + Sc => "SC", + Se => "SE", + Sg => "SG", + Sh => "SH", + Si => "SI", + Sj => "SJ", + Sk => "SK", + Sl => "SL", + Sm => "SM", + Sn => "SN", + So => "SO", + Sr => "SR", + Ss => "SS", + St => "ST", + Sv => "SV", + Sx => "SX", + Sz => "SZ", + Ta => "TA", + Tc => "TC", + Td => "TD", + Tf => "TF", + Tg => "TG", + Th => "TH", + Tj => "TJ", + Tk => "TK", + Tl => "TL", + Tm => "TM", + Tn => "TN", + To => "TO", + Tr => "TR", + Tt => "TT", + Tv => "TV", + Tw => "TW", + Tz => "TZ", + Ua => "UA", + Ug => "UG", + Us => "US", + Uy => "UY", + Uz => "UZ", + Va => "VA", + Vc => "VC", + Ve => "VE", + Vg => "VG", + Vn => "VN", + Vu => "VU", + Wf => "WF", + Ws => "WS", + Xk => "XK", + Ye => "YE", + Yt => "YT", + Za => "ZA", + Zm => "ZM", + Zw => "ZW", + Zz => "ZZ", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::*; + match s { + "AC" => Ok(Ac), + "AD" => Ok(Ad), + "AE" => Ok(Ae), + "AF" => Ok(Af), + "AG" => Ok(Ag), + "AI" => Ok(Ai), + "AL" => Ok(Al), + "AM" => Ok(Am), + "AO" => Ok(Ao), + "AQ" => Ok(Aq), + "AR" => Ok(Ar), + "AT" => Ok(At), + "AU" => Ok(Au), + "AW" => Ok(Aw), + "AX" => Ok(Ax), + "AZ" => Ok(Az), + "BA" => Ok(Ba), + "BB" => Ok(Bb), + "BD" => Ok(Bd), + "BE" => Ok(Be), + "BF" => Ok(Bf), + "BG" => Ok(Bg), + "BH" => Ok(Bh), + "BI" => Ok(Bi), + "BJ" => Ok(Bj), + "BL" => Ok(Bl), + "BM" => Ok(Bm), + "BN" => Ok(Bn), + "BO" => Ok(Bo), + "BQ" => Ok(Bq), + "BR" => Ok(Br), + "BS" => Ok(Bs), + "BT" => Ok(Bt), + "BV" => Ok(Bv), + "BW" => Ok(Bw), + "BY" => Ok(By), + "BZ" => Ok(Bz), + "CA" => Ok(Ca), + "CD" => Ok(Cd), + "CF" => Ok(Cf), + "CG" => Ok(Cg), + "CH" => Ok(Ch), + "CI" => Ok(Ci), + "CK" => Ok(Ck), + "CL" => Ok(Cl), + "CM" => Ok(Cm), + "CN" => Ok(Cn), + "CO" => Ok(Co), + "CR" => Ok(Cr), + "CV" => Ok(Cv), + "CW" => Ok(Cw), + "CY" => Ok(Cy), + "CZ" => Ok(Cz), + "DE" => Ok(De), + "DJ" => Ok(Dj), + "DK" => Ok(Dk), + "DM" => Ok(Dm), + "DO" => Ok(Do), + "DZ" => Ok(Dz), + "EC" => Ok(Ec), + "EE" => Ok(Ee), + "EG" => Ok(Eg), + "EH" => Ok(Eh), + "ER" => Ok(Er), + "ES" => Ok(Es), + "ET" => Ok(Et), + "FI" => Ok(Fi), + "FJ" => Ok(Fj), + "FK" => Ok(Fk), + "FO" => Ok(Fo), + "FR" => Ok(Fr), + "GA" => Ok(Ga), + "GB" => Ok(Gb), + "GD" => Ok(Gd), + "GE" => Ok(Ge), + "GF" => Ok(Gf), + "GG" => Ok(Gg), + "GH" => Ok(Gh), + "GI" => Ok(Gi), + "GL" => Ok(Gl), + "GM" => Ok(Gm), + "GN" => Ok(Gn), + "GP" => Ok(Gp), + "GQ" => Ok(Gq), + "GR" => Ok(Gr), + "GS" => Ok(Gs), + "GT" => Ok(Gt), + "GU" => Ok(Gu), + "GW" => Ok(Gw), + "GY" => Ok(Gy), + "HK" => Ok(Hk), + "HN" => Ok(Hn), + "HR" => Ok(Hr), + "HT" => Ok(Ht), + "HU" => Ok(Hu), + "ID" => Ok(Id), + "IE" => Ok(Ie), + "IL" => Ok(Il), + "IM" => Ok(Im), + "IN" => Ok(In), + "IO" => Ok(Io), + "IQ" => Ok(Iq), + "IS" => Ok(Is), + "IT" => Ok(It), + "JE" => Ok(Je), + "JM" => Ok(Jm), + "JO" => Ok(Jo), + "JP" => Ok(Jp), + "KE" => Ok(Ke), + "KG" => Ok(Kg), + "KH" => Ok(Kh), + "KI" => Ok(Ki), + "KM" => Ok(Km), + "KN" => Ok(Kn), + "KR" => Ok(Kr), + "KW" => Ok(Kw), + "KY" => Ok(Ky), + "KZ" => Ok(Kz), + "LA" => Ok(La), + "LB" => Ok(Lb), + "LC" => Ok(Lc), + "LI" => Ok(Li), + "LK" => Ok(Lk), + "LR" => Ok(Lr), + "LS" => Ok(Ls), + "LT" => Ok(Lt), + "LU" => Ok(Lu), + "LV" => Ok(Lv), + "LY" => Ok(Ly), + "MA" => Ok(Ma), + "MC" => Ok(Mc), + "MD" => Ok(Md), + "ME" => Ok(Me), + "MF" => Ok(Mf), + "MG" => Ok(Mg), + "MK" => Ok(Mk), + "ML" => Ok(Ml), + "MM" => Ok(Mm), + "MN" => Ok(Mn), + "MO" => Ok(Mo), + "MQ" => Ok(Mq), + "MR" => Ok(Mr), + "MS" => Ok(Ms), + "MT" => Ok(Mt), + "MU" => Ok(Mu), + "MV" => Ok(Mv), + "MW" => Ok(Mw), + "MX" => Ok(Mx), + "MY" => Ok(My), + "MZ" => Ok(Mz), + "NA" => Ok(Na), + "NC" => Ok(Nc), + "NE" => Ok(Ne), + "NG" => Ok(Ng), + "NI" => Ok(Ni), + "NL" => Ok(Nl), + "NO" => Ok(No), + "NP" => Ok(Np), + "NR" => Ok(Nr), + "NU" => Ok(Nu), + "NZ" => Ok(Nz), + "OM" => Ok(Om), + "PA" => Ok(Pa), + "PE" => Ok(Pe), + "PF" => Ok(Pf), + "PG" => Ok(Pg), + "PH" => Ok(Ph), + "PK" => Ok(Pk), + "PL" => Ok(Pl), + "PM" => Ok(Pm), + "PN" => Ok(Pn), + "PR" => Ok(Pr), + "PS" => Ok(Ps), + "PT" => Ok(Pt), + "PY" => Ok(Py), + "QA" => Ok(Qa), + "RE" => Ok(Re), + "RO" => Ok(Ro), + "RS" => Ok(Rs), + "RU" => Ok(Ru), + "RW" => Ok(Rw), + "SA" => Ok(Sa), + "SB" => Ok(Sb), + "SC" => Ok(Sc), + "SE" => Ok(Se), + "SG" => Ok(Sg), + "SH" => Ok(Sh), + "SI" => Ok(Si), + "SJ" => Ok(Sj), + "SK" => Ok(Sk), + "SL" => Ok(Sl), + "SM" => Ok(Sm), + "SN" => Ok(Sn), + "SO" => Ok(So), + "SR" => Ok(Sr), + "SS" => Ok(Ss), + "ST" => Ok(St), + "SV" => Ok(Sv), + "SX" => Ok(Sx), + "SZ" => Ok(Sz), + "TA" => Ok(Ta), + "TC" => Ok(Tc), + "TD" => Ok(Td), + "TF" => Ok(Tf), + "TG" => Ok(Tg), + "TH" => Ok(Th), + "TJ" => Ok(Tj), + "TK" => Ok(Tk), + "TL" => Ok(Tl), + "TM" => Ok(Tm), + "TN" => Ok(Tn), + "TO" => Ok(To), + "TR" => Ok(Tr), + "TT" => Ok(Tt), + "TV" => Ok(Tv), + "TW" => Ok(Tw), + "TZ" => Ok(Tz), + "UA" => Ok(Ua), + "UG" => Ok(Ug), + "US" => Ok(Us), + "UY" => Ok(Uy), + "UZ" => Ok(Uz), + "VA" => Ok(Va), + "VC" => Ok(Vc), + "VE" => Ok(Ve), + "VG" => Ok(Vg), + "VN" => Ok(Vn), + "VU" => Ok(Vu), + "WF" => Ok(Wf), + "WS" => Ok(Ws), + "XK" => Ok(Xk), + "YE" => Ok(Ye), + "YT" => Ok(Yt), + "ZA" => Ok(Za), + "ZM" => Ok(Zm), + "ZW" => Ok(Zw), + "ZZ" => Ok(Zz), + _ => Err(()), + } + } +} +impl AsRef for PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or( + PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Unknown, + )) + } +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_cost/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_cost/mod.rs new file mode 100644 index 000000000..c67ca42a5 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_cost/mod.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionShippingCost { + /// Total shipping cost before any discounts or taxes are applied. + pub amount_subtotal: i64, + /// Total tax amount applied due to shipping costs. + /// + /// If no tax was applied, defaults to 0. + pub amount_tax: i64, + /// Total shipping cost after discounts and taxes are applied. + pub amount_total: i64, + /// The ID of the ShippingRate for this order. + pub shipping_rate: Option>, + /// The taxes applied to the shipping rate. + #[serde(skip_serializing_if = "Option::is_none")] + pub taxes: Option>, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_option/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_option/mod.rs new file mode 100644 index 000000000..fb75b3a88 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_option/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionShippingOption { + /// A non-negative integer in cents representing how much to charge. + pub shipping_amount: i64, + /// The shipping rate. + pub shipping_rate: stripe_types::Expandable, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_tax_id/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_tax_id/mod.rs new file mode 100644 index 000000000..4ddbb9c12 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_tax_id/mod.rs @@ -0,0 +1,263 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionTaxId { + /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. + #[serde(rename = "type")] + pub type_: PaymentPagesCheckoutSessionTaxIdType, + /// The value of the tax ID. + pub value: Option, +} +/// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionTaxIdType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + Unknown, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, +} +impl PaymentPagesCheckoutSessionTaxIdType { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionTaxIdType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + Unknown => "unknown", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionTaxIdType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionTaxIdType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "unknown" => Ok(Unknown), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl AsRef for PaymentPagesCheckoutSessionTaxIdType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionTaxIdType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionTaxIdType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentPagesCheckoutSessionTaxIdType") + }) + } +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_tax_id_collection/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_tax_id_collection/mod.rs new file mode 100644 index 000000000..4493b5dca --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_tax_id_collection/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionTaxIdCollection { + /// Indicates whether tax ID collection is enabled for the session. + pub enabled: bool, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_total_details/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_total_details/mod.rs new file mode 100644 index 000000000..14888f396 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_total_details/mod.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionTotalDetails { + /// This is the sum of all the discounts. + pub amount_discount: i64, + /// This is the sum of all the shipping amounts. + pub amount_shipping: Option, + /// This is the sum of all the tax amounts. + pub amount_tax: i64, + #[serde(skip_serializing_if = "Option::is_none")] + pub breakdown: + Option, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_total_details_resource_breakdown/mod.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_total_details_resource_breakdown/mod.rs new file mode 100644 index 000000000..241560592 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_total_details_resource_breakdown/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionTotalDetailsResourceBreakdown { + /// The aggregated discounts. + pub discounts: Vec, + /// The aggregated tax amounts by rate. + pub taxes: Vec, +} diff --git a/generated/stripe_checkout/src/session/mod.rs b/generated/stripe_checkout/src/session/mod.rs new file mode 100644 index 000000000..379582eb7 --- /dev/null +++ b/generated/stripe_checkout/src/session/mod.rs @@ -0,0 +1,908 @@ +/// A Checkout Session represents your customer's session as they pay for +/// one-time purchases or subscriptions through [Checkout](https://stripe.com/docs/payments/checkout) +/// or [Payment Links](https://stripe.com/docs/payments/payment-links). +/// +/// We recommend creating a new Session each time your customer attempts to pay. Once payment is successful, the Checkout Session will contain a reference to the [Customer](https://stripe.com/docs/api/customers), and either the successful [PaymentIntent](https://stripe.com/docs/api/payment_intents) or an active [Subscription](https://stripe.com/docs/api/subscriptions). You can create a Checkout Session on your server and redirect to its URL to begin Checkout. Related guide: [Checkout quickstart](https://stripe.com/docs/checkout/quickstart) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Session { + /// When set, provides configuration for actions to take if this Checkout Session expires. + pub after_expiration: Option, + /// Enables user redeemable promotion codes. + pub allow_promotion_codes: Option, + /// Total of all items before discounts or taxes are applied. + pub amount_subtotal: Option, + /// Total of all items after discounts and taxes are applied. + pub amount_total: Option, + pub automatic_tax: stripe_checkout::PaymentPagesCheckoutSessionAutomaticTax, + /// Describes whether Checkout should collect the customer's billing address. + pub billing_address_collection: Option, + /// If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. + pub cancel_url: Option, + /// A unique string to reference the Checkout Session. + /// + /// This can be a customer ID, a cart ID, or similar, and can be used to reconcile the Session with your internal systems. + pub client_reference_id: Option, + /// Client secret to be used when initializing Stripe.js embedded checkout. + pub client_secret: Option, + /// Results of `consent_collection` for this session. + pub consent: Option, + /// When set, provides configuration for the Checkout Session to gather active consent from customers. + pub consent_collection: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: Option, + /// Currency conversion details for automatic currency conversion sessions. + pub currency_conversion: Option, + /// Collect additional information from your customer using custom fields. + /// + /// Up to 2 fields are supported. + pub custom_fields: Vec, + pub custom_text: stripe_checkout::PaymentPagesCheckoutSessionCustomText, + /// The ID of the customer for this Session. + /// For Checkout Sessions in `subscription` mode or Checkout Sessions with `customer_creation` set as `always` in `payment` mode, Checkout + /// will create a new customer object based on information provided + /// during the payment flow unless an existing customer was provided when + /// the Session was created. + pub customer: Option>, + /// Configure whether a Checkout Session creates a Customer when the Checkout Session completes. + pub customer_creation: Option, + /// The customer details including the customer's tax exempt status and the customer's tax IDs. + /// + /// Only the customer's email is present on Sessions in `setup` mode. + pub customer_details: Option, + /// If provided, this value will be used when the Customer object is created. + /// If not provided, customers will be asked to enter their email address. + /// Use this parameter to prefill customer data if you already have an email + /// on file. + /// + /// To access information about the customer once the payment flow is complete, use the `customer` attribute. + pub customer_email: Option, + /// The timestamp at which the Checkout Session will expire. + pub expires_at: stripe_types::Timestamp, + /// Unique identifier for the object. + pub id: stripe_checkout::session::CheckoutSessionId, + /// ID of the invoice created by the Checkout Session, if it exists. + pub invoice: Option>, + /// Details on the state of invoice creation for the Checkout Session. + pub invoice_creation: Option, + /// The line items purchased by the customer. + #[serde(default)] + pub line_items: stripe_types::List, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The IETF language tag of the locale Checkout is displayed in. + /// + /// If blank or `auto`, the browser's locale is used. + pub locale: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// The mode of the Checkout Session. + pub mode: SessionMode, + /// The ID of the PaymentIntent for Checkout Sessions in `payment` mode. + pub payment_intent: Option>, + /// The ID of the Payment Link that created this Session. + pub payment_link: Option>, + /// Configure whether a Checkout Session should collect a payment method. + pub payment_method_collection: Option, + /// Information about the payment method configuration used for this Checkout session if using dynamic payment methods. + pub payment_method_configuration_details: + Option, + /// Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. + pub payment_method_options: Option, + /// A list of the types of payment methods (e.g. + /// + /// card) this Checkout Session is allowed to accept. + pub payment_method_types: Vec, + /// The payment status of the Checkout Session, one of `paid`, `unpaid`, or `no_payment_required`. + /// You can use this value to decide when to fulfill your customer's order. + pub payment_status: SessionPaymentStatus, + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_number_collection: + Option, + /// The ID of the original expired Checkout Session that triggered the recovery flow. + pub recovered_from: Option, + /// Applies to Checkout Sessions with `ui_mode: embedded`. + /// + /// By default, Stripe will always redirect to your return_url after a successful confirmation. + /// If you set `redirect_on_completion: 'if_required'`, then we will only redirect if your user chooses a redirect-based payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect_on_completion: Option, + /// Applies to Checkout Sessions with `ui_mode: embedded`. + /// + /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option, + /// The ID of the SetupIntent for Checkout Sessions in `setup` mode. + pub setup_intent: Option>, + /// When set, provides configuration for Checkout to collect a shipping address from a customer. + pub shipping_address_collection: + Option, + /// The details of the customer cost of shipping, including the customer chosen ShippingRate. + pub shipping_cost: Option, + /// Shipping information for this Checkout Session. + pub shipping_details: Option, + /// The shipping rate options applied to this Session. + pub shipping_options: Vec, + /// The status of the Checkout Session, one of `open`, `complete`, or `expired`. + pub status: Option, + /// Describes the type of transaction being performed by Checkout in order to customize + /// relevant text on the page, such as the submit button. + /// + /// `submit_type` can only be specified on Checkout Sessions in `payment` mode, but not Checkout Sessions in `subscription` or `setup` mode. + pub submit_type: Option, + /// The ID of the subscription for Checkout Sessions in `subscription` mode. + pub subscription: Option>, + /// The URL the customer will be directed to after the payment or + /// subscription creation is successful. + pub success_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_collection: Option, + /// Tax and discount details for the computed total amount. + pub total_details: Option, + /// The UI mode of the Session. + /// + /// Can be `hosted` (default) or `embedded`. + pub ui_mode: Option, + /// The URL to the Checkout Session. + /// + /// Redirect customers to this URL to take them to Checkout. + /// If you’re using [Custom Domains](https://stripe.com/docs/payments/checkout/custom-domains), the URL will use your subdomain. + /// Otherwise, it’ll use `checkout.stripe.com.` This value is only present when the session is active. + pub url: Option, +} +/// Describes whether Checkout should collect the customer's billing address. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SessionBillingAddressCollection { + Auto, + Required, +} +impl SessionBillingAddressCollection { + pub fn as_str(self) -> &'static str { + use SessionBillingAddressCollection::*; + match self { + Auto => "auto", + Required => "required", + } + } +} + +impl std::str::FromStr for SessionBillingAddressCollection { + type Err = (); + fn from_str(s: &str) -> Result { + use SessionBillingAddressCollection::*; + match s { + "auto" => Ok(Auto), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl AsRef for SessionBillingAddressCollection { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SessionBillingAddressCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SessionBillingAddressCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SessionBillingAddressCollection { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SessionBillingAddressCollection { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for SessionBillingAddressCollection") + }) + } +} +/// Configure whether a Checkout Session creates a Customer when the Checkout Session completes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SessionCustomerCreation { + Always, + IfRequired, +} +impl SessionCustomerCreation { + pub fn as_str(self) -> &'static str { + use SessionCustomerCreation::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for SessionCustomerCreation { + type Err = (); + fn from_str(s: &str) -> Result { + use SessionCustomerCreation::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl AsRef for SessionCustomerCreation { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SessionCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SessionCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SessionCustomerCreation { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SessionCustomerCreation { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SessionCustomerCreation")) + } +} +/// The IETF language tag of the locale Checkout is displayed in. +/// +/// If blank or `auto`, the browser's locale is used. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum SessionLocale { + Auto, + Bg, + Cs, + Da, + De, + El, + En, + EnMinusGb, + Es, + EsMinus419, + Et, + Fi, + Fil, + Fr, + FrMinusCa, + Hr, + Hu, + Id, + It, + Ja, + Ko, + Lt, + Lv, + Ms, + Mt, + Nb, + Nl, + Pl, + Pt, + PtMinusBr, + Ro, + Ru, + Sk, + Sl, + Sv, + Th, + Tr, + Vi, + Zh, + ZhMinusHk, + ZhMinusTw, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl SessionLocale { + pub fn as_str(self) -> &'static str { + use SessionLocale::*; + match self { + Auto => "auto", + Bg => "bg", + Cs => "cs", + Da => "da", + De => "de", + El => "el", + En => "en", + EnMinusGb => "en-GB", + Es => "es", + EsMinus419 => "es-419", + Et => "et", + Fi => "fi", + Fil => "fil", + Fr => "fr", + FrMinusCa => "fr-CA", + Hr => "hr", + Hu => "hu", + Id => "id", + It => "it", + Ja => "ja", + Ko => "ko", + Lt => "lt", + Lv => "lv", + Ms => "ms", + Mt => "mt", + Nb => "nb", + Nl => "nl", + Pl => "pl", + Pt => "pt", + PtMinusBr => "pt-BR", + Ro => "ro", + Ru => "ru", + Sk => "sk", + Sl => "sl", + Sv => "sv", + Th => "th", + Tr => "tr", + Vi => "vi", + Zh => "zh", + ZhMinusHk => "zh-HK", + ZhMinusTw => "zh-TW", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for SessionLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use SessionLocale::*; + match s { + "auto" => Ok(Auto), + "bg" => Ok(Bg), + "cs" => Ok(Cs), + "da" => Ok(Da), + "de" => Ok(De), + "el" => Ok(El), + "en" => Ok(En), + "en-GB" => Ok(EnMinusGb), + "es" => Ok(Es), + "es-419" => Ok(EsMinus419), + "et" => Ok(Et), + "fi" => Ok(Fi), + "fil" => Ok(Fil), + "fr" => Ok(Fr), + "fr-CA" => Ok(FrMinusCa), + "hr" => Ok(Hr), + "hu" => Ok(Hu), + "id" => Ok(Id), + "it" => Ok(It), + "ja" => Ok(Ja), + "ko" => Ok(Ko), + "lt" => Ok(Lt), + "lv" => Ok(Lv), + "ms" => Ok(Ms), + "mt" => Ok(Mt), + "nb" => Ok(Nb), + "nl" => Ok(Nl), + "pl" => Ok(Pl), + "pt" => Ok(Pt), + "pt-BR" => Ok(PtMinusBr), + "ro" => Ok(Ro), + "ru" => Ok(Ru), + "sk" => Ok(Sk), + "sl" => Ok(Sl), + "sv" => Ok(Sv), + "th" => Ok(Th), + "tr" => Ok(Tr), + "vi" => Ok(Vi), + "zh" => Ok(Zh), + "zh-HK" => Ok(ZhMinusHk), + "zh-TW" => Ok(ZhMinusTw), + _ => Err(()), + } + } +} +impl AsRef for SessionLocale { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SessionLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SessionLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SessionLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SessionLocale { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(SessionLocale::Unknown)) + } +} +/// The mode of the Checkout Session. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SessionMode { + Payment, + Setup, + Subscription, +} +impl SessionMode { + pub fn as_str(self) -> &'static str { + use SessionMode::*; + match self { + Payment => "payment", + Setup => "setup", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for SessionMode { + type Err = (); + fn from_str(s: &str) -> Result { + use SessionMode::*; + match s { + "payment" => Ok(Payment), + "setup" => Ok(Setup), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl AsRef for SessionMode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SessionMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SessionMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SessionMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SessionMode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for SessionMode")) + } +} +/// Configure whether a Checkout Session should collect a payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SessionPaymentMethodCollection { + Always, + IfRequired, +} +impl SessionPaymentMethodCollection { + pub fn as_str(self) -> &'static str { + use SessionPaymentMethodCollection::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for SessionPaymentMethodCollection { + type Err = (); + fn from_str(s: &str) -> Result { + use SessionPaymentMethodCollection::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl AsRef for SessionPaymentMethodCollection { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SessionPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SessionPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SessionPaymentMethodCollection { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SessionPaymentMethodCollection { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for SessionPaymentMethodCollection") + }) + } +} +/// The payment status of the Checkout Session, one of `paid`, `unpaid`, or `no_payment_required`. +/// You can use this value to decide when to fulfill your customer's order. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SessionPaymentStatus { + NoPaymentRequired, + Paid, + Unpaid, +} +impl SessionPaymentStatus { + pub fn as_str(self) -> &'static str { + use SessionPaymentStatus::*; + match self { + NoPaymentRequired => "no_payment_required", + Paid => "paid", + Unpaid => "unpaid", + } + } +} + +impl std::str::FromStr for SessionPaymentStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use SessionPaymentStatus::*; + match s { + "no_payment_required" => Ok(NoPaymentRequired), + "paid" => Ok(Paid), + "unpaid" => Ok(Unpaid), + _ => Err(()), + } + } +} +impl AsRef for SessionPaymentStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SessionPaymentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SessionPaymentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SessionPaymentStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SessionPaymentStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SessionPaymentStatus")) + } +} +/// Applies to Checkout Sessions with `ui_mode: embedded`. +/// +/// By default, Stripe will always redirect to your return_url after a successful confirmation. +/// If you set `redirect_on_completion: 'if_required'`, then we will only redirect if your user chooses a redirect-based payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SessionRedirectOnCompletion { + Always, + IfRequired, + Never, +} +impl SessionRedirectOnCompletion { + pub fn as_str(self) -> &'static str { + use SessionRedirectOnCompletion::*; + match self { + Always => "always", + IfRequired => "if_required", + Never => "never", + } + } +} + +impl std::str::FromStr for SessionRedirectOnCompletion { + type Err = (); + fn from_str(s: &str) -> Result { + use SessionRedirectOnCompletion::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for SessionRedirectOnCompletion { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SessionRedirectOnCompletion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SessionRedirectOnCompletion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SessionRedirectOnCompletion { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SessionRedirectOnCompletion { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SessionRedirectOnCompletion")) + } +} +/// The status of the Checkout Session, one of `open`, `complete`, or `expired`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SessionStatus { + Complete, + Expired, + Open, +} +impl SessionStatus { + pub fn as_str(self) -> &'static str { + use SessionStatus::*; + match self { + Complete => "complete", + Expired => "expired", + Open => "open", + } + } +} + +impl std::str::FromStr for SessionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use SessionStatus::*; + match s { + "complete" => Ok(Complete), + "expired" => Ok(Expired), + "open" => Ok(Open), + _ => Err(()), + } + } +} +impl AsRef for SessionStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SessionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SessionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SessionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SessionStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for SessionStatus")) + } +} +/// Describes the type of transaction being performed by Checkout in order to customize +/// relevant text on the page, such as the submit button. +/// +/// `submit_type` can only be specified on Checkout Sessions in `payment` mode, but not Checkout Sessions in `subscription` or `setup` mode. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SessionSubmitType { + Auto, + Book, + Donate, + Pay, +} +impl SessionSubmitType { + pub fn as_str(self) -> &'static str { + use SessionSubmitType::*; + match self { + Auto => "auto", + Book => "book", + Donate => "donate", + Pay => "pay", + } + } +} + +impl std::str::FromStr for SessionSubmitType { + type Err = (); + fn from_str(s: &str) -> Result { + use SessionSubmitType::*; + match s { + "auto" => Ok(Auto), + "book" => Ok(Book), + "donate" => Ok(Donate), + "pay" => Ok(Pay), + _ => Err(()), + } + } +} +impl AsRef for SessionSubmitType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SessionSubmitType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SessionSubmitType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SessionSubmitType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SessionSubmitType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SessionSubmitType")) + } +} +/// The UI mode of the Session. +/// +/// Can be `hosted` (default) or `embedded`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SessionUiMode { + Embedded, + Hosted, +} +impl SessionUiMode { + pub fn as_str(self) -> &'static str { + use SessionUiMode::*; + match self { + Embedded => "embedded", + Hosted => "hosted", + } + } +} + +impl std::str::FromStr for SessionUiMode { + type Err = (); + fn from_str(s: &str) -> Result { + use SessionUiMode::*; + match s { + "embedded" => Ok(Embedded), + "hosted" => Ok(Hosted), + _ => Err(()), + } + } +} +impl AsRef for SessionUiMode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SessionUiMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SessionUiMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SessionUiMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SessionUiMode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for SessionUiMode")) + } +} +impl stripe_types::Object for Session { + type Id = stripe_checkout::session::CheckoutSessionId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(CheckoutSessionId, "cs_"); +#[cfg(feature = "session")] +mod requests; +#[cfg(feature = "session")] +pub use requests::*; diff --git a/generated/stripe_checkout/src/session/requests.rs b/generated/stripe_checkout/src/session/requests.rs new file mode 100644 index 000000000..1bb93735f --- /dev/null +++ b/generated/stripe_checkout/src/session/requests.rs @@ -0,0 +1,7112 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListSession<'a> { + /// Only return the Checkout Sessions for the Customer specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Only return the Checkout Sessions for the Customer details specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_details: Option>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return the Checkout Session for the PaymentIntent specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option<&'a str>, + /// Only return the Checkout Sessions for the Payment Link specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_link: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return the Checkout Sessions matching the given status. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Only return the Checkout Session for the subscription specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription: Option<&'a str>, +} +impl<'a> ListSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Only return the Checkout Sessions for the Customer details specified. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListSessionCustomerDetails<'a> { + /// Customer's email address. + pub email: &'a str, +} +impl<'a> ListSessionCustomerDetails<'a> { + pub fn new(email: &'a str) -> Self { + Self { email } + } +} +/// Only return the Checkout Sessions matching the given status. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListSessionStatus { + Complete, + Expired, + Open, +} +impl ListSessionStatus { + pub fn as_str(self) -> &'static str { + use ListSessionStatus::*; + match self { + Complete => "complete", + Expired => "expired", + Open => "open", + } + } +} + +impl std::str::FromStr for ListSessionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListSessionStatus::*; + match s { + "complete" => Ok(Complete), + "expired" => Ok(Expired), + "open" => Ok(Open), + _ => Err(()), + } + } +} +impl AsRef for ListSessionStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListSessionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListSessionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListSessionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListSession<'a> { + /// Returns a list of Checkout Sessions. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/checkout/sessions", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/checkout/sessions", self) + } +} +impl<'a> stripe::PaginationParams for ListSession<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveSession<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveSession<'a> { + /// Retrieves a Session object. + pub fn send( + &self, + client: &stripe::Client, + session: &stripe_checkout::session::CheckoutSessionId, + ) -> stripe::Response { + client.get_query(&format!("/checkout/sessions/{session}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSession<'a> { + /// Configure actions after a Checkout Session has expired. + #[serde(skip_serializing_if = "Option::is_none")] + pub after_expiration: Option, + /// Enables user redeemable promotion codes. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_promotion_codes: Option, + /// Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// Specify whether Checkout should collect the customer's billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_address_collection: Option, + /// If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancel_url: Option<&'a str>, + /// A unique string to reference the Checkout Session. + /// + /// This can be a customer ID, a cart ID, or similar, and can be used to reconcile the session with your internal systems. + #[serde(skip_serializing_if = "Option::is_none")] + pub client_reference_id: Option<&'a str>, + /// Configure fields for the Checkout Session to gather active consent from customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub consent_collection: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + /// Required in `setup` mode when `payment_method_types` is not set. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Collect additional information from your customer using custom fields. + /// + /// Up to 2 fields are supported. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [CreateSessionCustomFields<'a>]>, + /// Display additional text for your customers using custom text. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_text: Option>, + /// ID of an existing Customer, if one exists. + /// + /// In `payment` mode, the customer’s most recently saved card payment method will be used to prefill the email, name, card details, and billing address on the Checkout page. + /// In `subscription` mode, the customer’s [default payment method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) will be used if it’s a card, otherwise the most recently saved card will be used. + /// A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details. If the Customer already has a valid [email](https://stripe.com/docs/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout. If the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer. If blank for Checkout Sessions in `subscription` mode or with `customer_creation` set as `always` in `payment` mode, Checkout will create a new Customer object based on information provided during the payment flow. You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation. + /// + /// When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout + /// with [customer_details](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_details). + /// + /// Sessions that don't create Customers instead are grouped by [guest customers](https://stripe.com/docs/payments/checkout/guest-customers) + /// in the Dashboard. + /// + /// Promotion codes limited to first time customers will return invalid for these Sessions. Can only be set in `payment` and `setup` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_creation: Option, + /// If provided, this value will be used when the Customer object is created. + /// If not provided, customers will be asked to enter their email address. + /// Use this parameter to prefill customer data if you already have an email + /// on file. + /// + /// To access information about the customer once a session is complete, use the `customer` field. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_email: Option<&'a str>, + /// Controls what fields on Customer can be updated by the Checkout Session. + /// + /// Can only be provided when `customer` is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_update: Option, + /// The coupon or promotion code to apply to this Session. + /// + /// Currently, only up to one may be specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [CreateSessionDiscounts<'a>]>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The Epoch time in seconds at which the Checkout Session will expire. + /// + /// It can be anywhere from 30 minutes to 24 hours after Checkout Session creation. + /// By default, this value is 24 hours from creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// Generate a post-purchase Invoice for one-time payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_creation: Option>, + /// A list of items the customer is purchasing. + /// + /// Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). For `payment` mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen. For `subscription` mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. + /// Line items with one-time Prices will be on the initial invoice only. + #[serde(skip_serializing_if = "Option::is_none")] + pub line_items: Option<&'a [CreateSessionLineItems<'a>]>, + /// The IETF language tag of the locale Checkout is displayed in. + /// + /// If blank or `auto`, the browser's locale is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub locale: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The mode of the Checkout Session. + /// + /// Pass `subscription` if the Checkout Session includes at least one recurring item. + #[serde(skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent_data: Option>, + /// Specify whether Checkout should collect a payment method. + /// + /// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. If you'd like information on how to collect a payment method outside of Checkout, read the guide on configuring [subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_collection: Option, + /// The ID of the payment method configuration to use with this Checkout session. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_configuration: Option<&'a str>, + /// Payment-method-specific configuration. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. + /// + /// You can omit this attribute to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + /// See [Dynamic Payment Methods](https://stripe.com/docs/payments/payment-methods/integration-options#using-dynamic-payment-methods) for more details. + /// + /// Read more about the supported payment methods and their requirements in our [payment + /// method details guide](/docs/payments/checkout/payment-methods). + /// + /// If multiple payment methods are passed, Checkout will dynamically reorder them to + /// prioritize the most relevant payment methods based on the customer's location and + /// other characteristics. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [CreateSessionPaymentMethodTypes]>, + /// Controls phone number collection settings for the session. + /// + /// We recommend that you review your privacy policy and check with your legal contacts + /// before using this feature. + /// + /// Learn more about [collecting phone numbers with Checkout](https://stripe.com/docs/payments/checkout/phone-numbers). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_number_collection: Option, + /// This parameter applies to `ui_mode: embedded`. + /// + /// By default, Stripe will always redirect to your return_url after a successful confirmation. + /// If you set `redirect_on_completion: 'if_required'`, then we will only redirect if your user chooses a redirect-based payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect_on_completion: Option, + /// The URL to redirect your customer back to after they authenticate or cancel their payment on the + /// payment method's app or site. + /// + /// This parameter is required if ui_mode is `embedded` and redirect-based payment methods are enabled on the session. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, + /// A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_intent_data: Option>, + /// When set, provides configuration for Checkout to collect a shipping address from a customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_address_collection: Option>, + /// The shipping rate options to apply to this Session. + /// + /// Up to a maximum of 5. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_options: Option<&'a [CreateSessionShippingOptions<'a>]>, + /// Describes the type of transaction being performed by Checkout in order to customize + /// relevant text on the page, such as the submit button. + /// + /// `submit_type` can only be specified on Checkout Sessions in `payment` mode, but not Checkout Sessions in `subscription` or `setup` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub submit_type: Option, + /// A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_data: Option>, + /// The URL to which Stripe should send customers when payment or setup + /// is complete. + /// This parameter is not allowed if ui_mode is `embedded`. + /// + /// If you’d like to use information from the successful Checkout Session on your page, read the guide on [customizing your success page](https://stripe.com/docs/payments/checkout/custom-success-page). + #[serde(skip_serializing_if = "Option::is_none")] + pub success_url: Option<&'a str>, + /// Controls tax ID collection settings for the session. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_collection: Option, + /// `ui_mode` can be `hosted` or `embedded`. + /// + /// The default is `hosted`. + #[serde(skip_serializing_if = "Option::is_none")] + pub ui_mode: Option, +} +impl<'a> CreateSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configure actions after a Checkout Session has expired. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionAfterExpiration { + /// Configure a Checkout Session that can be used to recover an expired session. + #[serde(skip_serializing_if = "Option::is_none")] + pub recovery: Option, +} +impl CreateSessionAfterExpiration { + pub fn new() -> Self { + Self::default() + } +} +/// Configure a Checkout Session that can be used to recover an expired session. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionAfterExpirationRecovery { + /// Enables user redeemable promotion codes on the recovered Checkout Sessions. + /// + /// Defaults to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_promotion_codes: Option, + /// If `true`, a recovery URL will be generated to recover this Checkout Session if it + /// expires before a successful transaction is completed. + /// + /// It will be attached to the Checkout Session object upon expiration. + pub enabled: bool, +} +impl CreateSessionAfterExpirationRecovery { + pub fn new(enabled: bool) -> Self { + Self { allow_promotion_codes: Default::default(), enabled } + } +} +/// Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionAutomaticTax { + /// Set to true to enable automatic taxes. + pub enabled: bool, +} +impl CreateSessionAutomaticTax { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Specify whether Checkout should collect the customer's billing address. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionBillingAddressCollection { + Auto, + Required, +} +impl CreateSessionBillingAddressCollection { + pub fn as_str(self) -> &'static str { + use CreateSessionBillingAddressCollection::*; + match self { + Auto => "auto", + Required => "required", + } + } +} + +impl std::str::FromStr for CreateSessionBillingAddressCollection { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionBillingAddressCollection::*; + match s { + "auto" => Ok(Auto), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionBillingAddressCollection { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionBillingAddressCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionBillingAddressCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionBillingAddressCollection { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configure fields for the Checkout Session to gather active consent from customers. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionConsentCollection { + /// If set to `auto`, enables the collection of customer consent for promotional communications. + /// + /// The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. + /// Only available to US merchants. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotions: Option, + /// If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. + /// There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). + #[serde(skip_serializing_if = "Option::is_none")] + pub terms_of_service: Option, +} +impl CreateSessionConsentCollection { + pub fn new() -> Self { + Self::default() + } +} +/// If set to `auto`, enables the collection of customer consent for promotional communications. +/// +/// The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. +/// Only available to US merchants. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionConsentCollectionPromotions { + Auto, + None, +} +impl CreateSessionConsentCollectionPromotions { + pub fn as_str(self) -> &'static str { + use CreateSessionConsentCollectionPromotions::*; + match self { + Auto => "auto", + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionConsentCollectionPromotions { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionConsentCollectionPromotions::*; + match s { + "auto" => Ok(Auto), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionConsentCollectionPromotions { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionConsentCollectionPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionConsentCollectionPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionConsentCollectionPromotions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. +/// There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionConsentCollectionTermsOfService { + None, + Required, +} +impl CreateSessionConsentCollectionTermsOfService { + pub fn as_str(self) -> &'static str { + use CreateSessionConsentCollectionTermsOfService::*; + match self { + None => "none", + Required => "required", + } + } +} + +impl std::str::FromStr for CreateSessionConsentCollectionTermsOfService { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionConsentCollectionTermsOfService::*; + match s { + "none" => Ok(None), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionConsentCollectionTermsOfService { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionConsentCollectionTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionConsentCollectionTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionConsentCollectionTermsOfService { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Collect additional information from your customer using custom fields. +/// +/// Up to 2 fields are supported. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionCustomFields<'a> { + /// Configuration for `type=dropdown` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub dropdown: Option>, + /// String of your choice that your integration can use to reconcile this field. + /// + /// Must be unique to this field, alphanumeric, and up to 200 characters. + pub key: &'a str, + /// The label for the field, displayed to the customer. + pub label: CreateSessionCustomFieldsLabel<'a>, + /// Configuration for `type=numeric` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub numeric: Option, + /// Whether the customer is required to complete the field before completing the Checkout Session. + /// + /// Defaults to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub optional: Option, + /// Configuration for `type=text` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub text: Option, + /// The type of the field. + #[serde(rename = "type")] + pub type_: CreateSessionCustomFieldsType, +} +impl<'a> CreateSessionCustomFields<'a> { + pub fn new( + key: &'a str, + label: CreateSessionCustomFieldsLabel<'a>, + type_: CreateSessionCustomFieldsType, + ) -> Self { + Self { + dropdown: Default::default(), + key, + label, + numeric: Default::default(), + optional: Default::default(), + text: Default::default(), + type_, + } + } +} +/// Configuration for `type=dropdown` fields. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionCustomFieldsDropdown<'a> { + /// The options available for the customer to select. + /// + /// Up to 200 options allowed. + pub options: &'a [CreateSessionCustomFieldsDropdownOptions<'a>], +} +impl<'a> CreateSessionCustomFieldsDropdown<'a> { + pub fn new(options: &'a [CreateSessionCustomFieldsDropdownOptions<'a>]) -> Self { + Self { options } + } +} +/// The options available for the customer to select. +/// +/// Up to 200 options allowed. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionCustomFieldsDropdownOptions<'a> { + /// The label for the option, displayed to the customer. + /// + /// Up to 100 characters. + pub label: &'a str, + /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. + /// + /// Must be unique to this option, alphanumeric, and up to 100 characters. + pub value: &'a str, +} +impl<'a> CreateSessionCustomFieldsDropdownOptions<'a> { + pub fn new(label: &'a str, value: &'a str) -> Self { + Self { label, value } + } +} +/// The label for the field, displayed to the customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionCustomFieldsLabel<'a> { + /// Custom text for the label, displayed to the customer. + /// + /// Up to 50 characters. + pub custom: &'a str, + /// The type of the label. + #[serde(rename = "type")] + pub type_: CreateSessionCustomFieldsLabelType, +} +impl<'a> CreateSessionCustomFieldsLabel<'a> { + pub fn new(custom: &'a str, type_: CreateSessionCustomFieldsLabelType) -> Self { + Self { custom, type_ } + } +} +/// The type of the label. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionCustomFieldsLabelType { + Custom, +} +impl CreateSessionCustomFieldsLabelType { + pub fn as_str(self) -> &'static str { + use CreateSessionCustomFieldsLabelType::*; + match self { + Custom => "custom", + } + } +} + +impl std::str::FromStr for CreateSessionCustomFieldsLabelType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionCustomFieldsLabelType::*; + match s { + "custom" => Ok(Custom), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionCustomFieldsLabelType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionCustomFieldsLabelType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for `type=numeric` fields. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionCustomFieldsNumeric { + /// The maximum character length constraint for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_length: Option, +} +impl CreateSessionCustomFieldsNumeric { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for `type=text` fields. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionCustomFieldsText { + /// The maximum character length constraint for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_length: Option, +} +impl CreateSessionCustomFieldsText { + pub fn new() -> Self { + Self::default() + } +} +/// The type of the field. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionCustomFieldsType { + Dropdown, + Numeric, + Text, +} +impl CreateSessionCustomFieldsType { + pub fn as_str(self) -> &'static str { + use CreateSessionCustomFieldsType::*; + match self { + Dropdown => "dropdown", + Numeric => "numeric", + Text => "text", + } + } +} + +impl std::str::FromStr for CreateSessionCustomFieldsType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionCustomFieldsType::*; + match s { + "dropdown" => Ok(Dropdown), + "numeric" => Ok(Numeric), + "text" => Ok(Text), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionCustomFieldsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionCustomFieldsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Display additional text for your customers using custom text. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionCustomText<'a> { + /// Custom text that should be displayed alongside shipping address collection. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_address: Option>, + /// Custom text that should be displayed alongside the payment confirmation button. + #[serde(skip_serializing_if = "Option::is_none")] + pub submit: Option>, + /// Custom text that should be displayed in place of the default terms of service agreement text. + #[serde(skip_serializing_if = "Option::is_none")] + pub terms_of_service_acceptance: Option>, +} +impl<'a> CreateSessionCustomText<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Custom text that should be displayed alongside shipping address collection. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionCustomTextShippingAddress<'a> { + /// Text may be up to 1200 characters in length. + pub message: &'a str, +} +impl<'a> CreateSessionCustomTextShippingAddress<'a> { + pub fn new(message: &'a str) -> Self { + Self { message } + } +} +/// Custom text that should be displayed alongside the payment confirmation button. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionCustomTextSubmit<'a> { + /// Text may be up to 1200 characters in length. + pub message: &'a str, +} +impl<'a> CreateSessionCustomTextSubmit<'a> { + pub fn new(message: &'a str) -> Self { + Self { message } + } +} +/// Custom text that should be displayed in place of the default terms of service agreement text. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionCustomTextTermsOfServiceAcceptance<'a> { + /// Text may be up to 1200 characters in length. + pub message: &'a str, +} +impl<'a> CreateSessionCustomTextTermsOfServiceAcceptance<'a> { + pub fn new(message: &'a str) -> Self { + Self { message } + } +} +/// Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation. +/// +/// When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout +/// with [customer_details](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_details). +/// +/// Sessions that don't create Customers instead are grouped by [guest customers](https://stripe.com/docs/payments/checkout/guest-customers) +/// in the Dashboard. +/// +/// Promotion codes limited to first time customers will return invalid for these Sessions. Can only be set in `payment` and `setup` mode. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionCustomerCreation { + Always, + IfRequired, +} +impl CreateSessionCustomerCreation { + pub fn as_str(self) -> &'static str { + use CreateSessionCustomerCreation::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for CreateSessionCustomerCreation { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionCustomerCreation::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionCustomerCreation { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionCustomerCreation { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Controls what fields on Customer can be updated by the Checkout Session. +/// +/// Can only be provided when `customer` is provided. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionCustomerUpdate { + /// Describes whether Checkout saves the billing address onto `customer.address`. + /// To always collect a full billing address, use `billing_address_collection`. + /// + /// Defaults to `never`. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option, + /// Describes whether Checkout saves the name onto `customer.name`. + /// + /// Defaults to `never`. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Describes whether Checkout saves shipping information onto `customer.shipping`. + /// To collect shipping information, use `shipping_address_collection`. + /// + /// Defaults to `never`. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option, +} +impl CreateSessionCustomerUpdate { + pub fn new() -> Self { + Self::default() + } +} +/// Describes whether Checkout saves the billing address onto `customer.address`. +/// To always collect a full billing address, use `billing_address_collection`. +/// +/// Defaults to `never`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionCustomerUpdateAddress { + Auto, + Never, +} +impl CreateSessionCustomerUpdateAddress { + pub fn as_str(self) -> &'static str { + use CreateSessionCustomerUpdateAddress::*; + match self { + Auto => "auto", + Never => "never", + } + } +} + +impl std::str::FromStr for CreateSessionCustomerUpdateAddress { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionCustomerUpdateAddress::*; + match s { + "auto" => Ok(Auto), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionCustomerUpdateAddress { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionCustomerUpdateAddress { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionCustomerUpdateAddress { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionCustomerUpdateAddress { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Describes whether Checkout saves the name onto `customer.name`. +/// +/// Defaults to `never`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionCustomerUpdateName { + Auto, + Never, +} +impl CreateSessionCustomerUpdateName { + pub fn as_str(self) -> &'static str { + use CreateSessionCustomerUpdateName::*; + match self { + Auto => "auto", + Never => "never", + } + } +} + +impl std::str::FromStr for CreateSessionCustomerUpdateName { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionCustomerUpdateName::*; + match s { + "auto" => Ok(Auto), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionCustomerUpdateName { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionCustomerUpdateName { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionCustomerUpdateName { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionCustomerUpdateName { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Describes whether Checkout saves shipping information onto `customer.shipping`. +/// To collect shipping information, use `shipping_address_collection`. +/// +/// Defaults to `never`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionCustomerUpdateShipping { + Auto, + Never, +} +impl CreateSessionCustomerUpdateShipping { + pub fn as_str(self) -> &'static str { + use CreateSessionCustomerUpdateShipping::*; + match self { + Auto => "auto", + Never => "never", + } + } +} + +impl std::str::FromStr for CreateSessionCustomerUpdateShipping { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionCustomerUpdateShipping::*; + match s { + "auto" => Ok(Auto), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionCustomerUpdateShipping { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionCustomerUpdateShipping { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionCustomerUpdateShipping { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionCustomerUpdateShipping { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The coupon or promotion code to apply to this Session. +/// +/// Currently, only up to one may be specified. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionDiscounts<'a> { + /// The ID of the coupon to apply to this Session. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// The ID of a promotion code to apply to this Session. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option<&'a str>, +} +impl<'a> CreateSessionDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Generate a post-purchase Invoice for one-time payments. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionInvoiceCreation<'a> { + /// Set to `true` to enable invoice creation. + pub enabled: bool, + /// Parameters passed when creating invoices for payment-mode Checkout Sessions. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_data: Option>, +} +impl<'a> CreateSessionInvoiceCreation<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, invoice_data: Default::default() } + } +} +/// Parameters passed when creating invoices for payment-mode Checkout Sessions. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionInvoiceCreationInvoiceData<'a> { + /// The account tax IDs associated with the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option<&'a [&'a str]>, + /// Default custom fields to be displayed on invoices for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [CreateSessionInvoiceCreationInvoiceDataCustomFields<'a>]>, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Default footer to be displayed on invoices for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Default options for invoice PDF rendering for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering_options: Option, +} +impl<'a> CreateSessionInvoiceCreationInvoiceData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Default custom fields to be displayed on invoices for this customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionInvoiceCreationInvoiceDataCustomFields<'a> { + /// The name of the custom field. + /// + /// This may be up to 30 characters. + pub name: &'a str, + /// The value of the custom field. + /// + /// This may be up to 30 characters. + pub value: &'a str, +} +impl<'a> CreateSessionInvoiceCreationInvoiceDataCustomFields<'a> { + pub fn new(name: &'a str, value: &'a str) -> Self { + Self { name, value } + } +} +/// Default options for invoice PDF rendering for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionInvoiceCreationInvoiceDataRenderingOptions { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: + Option, +} +impl CreateSessionInvoiceCreationInvoiceDataRenderingOptions { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl CreateSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use CreateSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr for CreateSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A list of items the customer is purchasing. +/// +/// Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). For `payment` mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen. For `subscription` mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. +/// Line items with one-time Prices will be on the initial invoice only. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionLineItems<'a> { + /// When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout. + #[serde(skip_serializing_if = "Option::is_none")] + pub adjustable_quantity: Option, + /// The [tax rates](https://stripe.com/docs/api/tax_rates) that will be applied to this line item depending on the customer's billing/shipping address. + /// + /// We currently support the following countries: US, GB, AU, and all countries in the EU. + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_tax_rates: Option<&'a [&'a str]>, + /// The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. + /// + /// One of `price` or `price_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + /// + /// One of `price` or `price_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// The quantity of the line item being purchased. + /// + /// Quantity should not be defined when `recurring.usage_type=metered`. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The [tax rates](https://stripe.com/docs/api/tax_rates) which apply to this line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> CreateSessionLineItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionLineItemsAdjustableQuantity { + /// Set to true if the quantity can be adjusted to any non-negative integer. + /// + /// By default customers will be able to remove the line item by setting the quantity to 0. + pub enabled: bool, + /// The maximum quantity the customer can purchase for the Checkout Session. + /// + /// By default this value is 99. + /// You can specify a value up to 999999. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option, + /// The minimum quantity the customer must purchase for the Checkout Session. + /// + /// By default this value is 0. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option, +} +impl CreateSessionLineItemsAdjustableQuantity { + pub fn new(enabled: bool) -> Self { + Self { enabled, maximum: Default::default(), minimum: Default::default() } + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +/// +/// One of `price` or `price_data` is required. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionLineItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + /// + /// One of `product` or `product_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub product: Option<&'a str>, + /// Data used to generate a new product object inline. + /// + /// One of `product` or `product_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_data: Option>, + /// The recurring components of a price such as `interval` and `interval_count`. + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring: Option, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A non-negative integer in cents (or local equivalent) representing how much to charge. + /// + /// One of `unit_amount` or `unit_amount_decimal` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateSessionLineItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency) -> Self { + Self { + currency, + product: Default::default(), + product_data: Default::default(), + recurring: Default::default(), + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// Data used to generate a new product object inline. +/// +/// One of `product` or `product_data` is required. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionLineItemsPriceDataProductData<'a> { + /// The product's description, meant to be displayable to the customer. + /// + /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub images: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The product's name, meant to be displayable to the customer. + pub name: &'a str, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, +} +impl<'a> CreateSessionLineItemsPriceDataProductData<'a> { + pub fn new(name: &'a str) -> Self { + Self { + description: Default::default(), + images: Default::default(), + metadata: Default::default(), + name, + tax_code: Default::default(), + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionLineItemsPriceDataRecurring { + /// Specifies billing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + pub interval: CreateSessionLineItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl CreateSessionLineItemsPriceDataRecurring { + pub fn new(interval: CreateSessionLineItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: Default::default() } + } +} +/// Specifies billing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionLineItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl CreateSessionLineItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use CreateSessionLineItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreateSessionLineItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionLineItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionLineItemsPriceDataRecurringInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionLineItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionLineItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionLineItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionLineItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateSessionLineItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateSessionLineItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateSessionLineItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionLineItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionLineItemsPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionLineItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionLineItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionLineItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The IETF language tag of the locale Checkout is displayed in. +/// +/// If blank or `auto`, the browser's locale is used. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateSessionLocale { + Auto, + Bg, + Cs, + Da, + De, + El, + En, + EnMinusGb, + Es, + EsMinus419, + Et, + Fi, + Fil, + Fr, + FrMinusCa, + Hr, + Hu, + Id, + It, + Ja, + Ko, + Lt, + Lv, + Ms, + Mt, + Nb, + Nl, + Pl, + Pt, + PtMinusBr, + Ro, + Ru, + Sk, + Sl, + Sv, + Th, + Tr, + Vi, + Zh, + ZhMinusHk, + ZhMinusTw, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateSessionLocale { + pub fn as_str(self) -> &'static str { + use CreateSessionLocale::*; + match self { + Auto => "auto", + Bg => "bg", + Cs => "cs", + Da => "da", + De => "de", + El => "el", + En => "en", + EnMinusGb => "en-GB", + Es => "es", + EsMinus419 => "es-419", + Et => "et", + Fi => "fi", + Fil => "fil", + Fr => "fr", + FrMinusCa => "fr-CA", + Hr => "hr", + Hu => "hu", + Id => "id", + It => "it", + Ja => "ja", + Ko => "ko", + Lt => "lt", + Lv => "lv", + Ms => "ms", + Mt => "mt", + Nb => "nb", + Nl => "nl", + Pl => "pl", + Pt => "pt", + PtMinusBr => "pt-BR", + Ro => "ro", + Ru => "ru", + Sk => "sk", + Sl => "sl", + Sv => "sv", + Th => "th", + Tr => "tr", + Vi => "vi", + Zh => "zh", + ZhMinusHk => "zh-HK", + ZhMinusTw => "zh-TW", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateSessionLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionLocale::*; + match s { + "auto" => Ok(Auto), + "bg" => Ok(Bg), + "cs" => Ok(Cs), + "da" => Ok(Da), + "de" => Ok(De), + "el" => Ok(El), + "en" => Ok(En), + "en-GB" => Ok(EnMinusGb), + "es" => Ok(Es), + "es-419" => Ok(EsMinus419), + "et" => Ok(Et), + "fi" => Ok(Fi), + "fil" => Ok(Fil), + "fr" => Ok(Fr), + "fr-CA" => Ok(FrMinusCa), + "hr" => Ok(Hr), + "hu" => Ok(Hu), + "id" => Ok(Id), + "it" => Ok(It), + "ja" => Ok(Ja), + "ko" => Ok(Ko), + "lt" => Ok(Lt), + "lv" => Ok(Lv), + "ms" => Ok(Ms), + "mt" => Ok(Mt), + "nb" => Ok(Nb), + "nl" => Ok(Nl), + "pl" => Ok(Pl), + "pt" => Ok(Pt), + "pt-BR" => Ok(PtMinusBr), + "ro" => Ok(Ro), + "ru" => Ok(Ru), + "sk" => Ok(Sk), + "sl" => Ok(Sl), + "sv" => Ok(Sv), + "th" => Ok(Th), + "tr" => Ok(Tr), + "vi" => Ok(Vi), + "zh" => Ok(Zh), + "zh-HK" => Ok(ZhMinusHk), + "zh-TW" => Ok(ZhMinusTw), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionLocale { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The mode of the Checkout Session. +/// +/// Pass `subscription` if the Checkout Session includes at least one recurring item. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionMode { + Payment, + Setup, + Subscription, +} +impl CreateSessionMode { + pub fn as_str(self) -> &'static str { + use CreateSessionMode::*; + match self { + Payment => "payment", + Setup => "setup", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for CreateSessionMode { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionMode::*; + match s { + "payment" => Ok(Payment), + "setup" => Ok(Setup), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionMode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentIntentData<'a> { + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// + /// The amount of the application fee collected will be capped at the total payment amount. + /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The Stripe account ID for which these funds are intended. + /// + /// For details, see the PaymentIntents [use case for connected accounts](/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// Email address that the receipt for the resulting payment will be sent to. + /// + /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt_email: Option<&'a str>, + /// Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment + /// method collected by this Checkout Session. + /// + /// When setting this to `on_session`, Checkout will show a notice to the + /// customer that their payment details will be saved. + /// + /// When setting this to `off_session`, Checkout will show a notice to the + /// customer that their payment details will be saved and used for future + /// payments. + /// + /// If a Customer has been provided or Checkout creates a new Customer, + /// Checkout will attach the payment method to the Customer. + /// + /// If Checkout does not create a Customer, the payment method is not attached + /// to a Customer. + /// + /// To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Shipping information for this payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// Extra information about the payment. + /// + /// This will appear on your customer's statement when this payment succeeds in creating a charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// Provides information about the charge that customers see on their statements. + /// + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters for the concatenated descriptor. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix: Option<&'a str>, + /// The parameters used to automatically create a Transfer when the payment succeeds. + /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, + /// A string that identifies the resulting payment as part of a group. + /// + /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> CreateSessionPaymentIntentData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentIntentDataCaptureMethod { + Automatic, + AutomaticAsync, + Manual, +} +impl CreateSessionPaymentIntentDataCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentIntentDataCaptureMethod::*; + match self { + Automatic => "automatic", + AutomaticAsync => "automatic_async", + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentIntentDataCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentIntentDataCaptureMethod::*; + match s { + "automatic" => Ok(Automatic), + "automatic_async" => Ok(AutomaticAsync), + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentIntentDataCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentIntentDataCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentIntentDataCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentIntentDataCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment +/// method collected by this Checkout Session. +/// +/// When setting this to `on_session`, Checkout will show a notice to the +/// customer that their payment details will be saved. +/// +/// When setting this to `off_session`, Checkout will show a notice to the +/// customer that their payment details will be saved and used for future +/// payments. +/// +/// If a Customer has been provided or Checkout creates a new Customer, +/// Checkout will attach the payment method to the Customer. +/// +/// If Checkout does not create a Customer, the payment method is not attached +/// to a Customer. +/// +/// To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentIntentDataSetupFutureUsage { + OffSession, + OnSession, +} +impl CreateSessionPaymentIntentDataSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentIntentDataSetupFutureUsage::*; + match self { + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentIntentDataSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentIntentDataSetupFutureUsage::*; + match s { + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentIntentDataSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentIntentDataSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentIntentDataSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentIntentDataSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Shipping information for this payment. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionPaymentIntentDataShipping<'a> { + /// Shipping address. + pub address: CreateSessionPaymentIntentDataShippingAddress<'a>, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// Recipient name. + pub name: &'a str, + /// Recipient phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The tracking number for a physical product, obtained from the delivery service. + /// + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub tracking_number: Option<&'a str>, +} +impl<'a> CreateSessionPaymentIntentDataShipping<'a> { + pub fn new(address: CreateSessionPaymentIntentDataShippingAddress<'a>, name: &'a str) -> Self { + Self { + address, + carrier: Default::default(), + name, + phone: Default::default(), + tracking_number: Default::default(), + } + } +} +/// Shipping address. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionPaymentIntentDataShippingAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + pub line1: &'a str, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateSessionPaymentIntentDataShippingAddress<'a> { + pub fn new(line1: &'a str) -> Self { + Self { + city: Default::default(), + country: Default::default(), + line1, + line2: Default::default(), + postal_code: Default::default(), + state: Default::default(), + } + } +} +/// The parameters used to automatically create a Transfer when the payment succeeds. +/// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionPaymentIntentDataTransferData<'a> { + /// The amount that will be transferred automatically when a charge succeeds. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// If specified, successful charges will be attributed to the destination + /// account for tax reporting, and the funds from charges will be transferred + /// to the destination account. + /// + /// The ID of the resulting transfer will be returned on the successful charge's `transfer` field. + pub destination: &'a str, +} +impl<'a> CreateSessionPaymentIntentDataTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount: Default::default(), destination } + } +} +/// Specify whether Checkout should collect a payment method. +/// +/// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. If you'd like information on how to collect a payment method outside of Checkout, read the guide on configuring [subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodCollection { + Always, + IfRequired, +} +impl CreateSessionPaymentMethodCollection { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodCollection::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodCollection { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodCollection::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodCollection { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodCollection { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment-method-specific configuration. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptions<'a> { + /// contains details about the ACSS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// contains details about the Affirm payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option, + /// contains details about the Afterpay Clearpay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option, + /// contains details about the Alipay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + /// contains details about the AU Becs Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + /// contains details about the Bacs Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + /// contains details about the Bancontact payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// contains details about the Boleto payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + /// contains details about the Card payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// contains details about the Cashapp Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// contains details about the Customer Balance payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option>, + /// contains details about the EPS payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// contains details about the FPX payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// contains details about the Giropay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + /// contains details about the Grabpay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + /// contains details about the Ideal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// contains details about the Klarna payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// contains details about the Konbini payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option, + /// contains details about the Link payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + /// contains details about the OXXO payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + /// contains details about the P24 payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// contains details about the PayNow payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + /// contains details about the PayPal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option>, + /// contains details about the Pix payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option, + /// contains details about the RevolutPay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + /// contains details about the Sepa Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + /// contains details about the Sofort payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// contains details about the Us Bank Account payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// contains details about the WeChat Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option>, +} +impl<'a> CreateSessionPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// contains details about the ACSS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsAcssDebit<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + /// This is only accepted for Checkout Sessions in `setup` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option, +} +impl<'a> CreateSessionPaymentMethodOptionsAcssDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. +/// +/// Must be a [supported currency](https://stripe.com/docs/currencies). +/// This is only accepted for Checkout Sessions in `setup` mode. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsAcssDebitCurrency { + Cad, + Usd, +} +impl CreateSessionPaymentMethodOptionsAcssDebitCurrency { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsAcssDebitCurrency::*; + match self { + Cad => "cad", + Usd => "usd", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsAcssDebitCurrency { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsAcssDebitCurrency::*; + match s { + "cad" => Ok(Cad), + "usd" => Ok(Usd), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsAcssDebitCurrency { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsAcssDebitCurrency { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for Mandate creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsAcssDebitMandateOptions<'a> { + /// A URL for custom mandate text to render during confirmation step. + /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option<&'a str>, + /// List of Stripe products where this mandate can be selected automatically. + /// + /// Only usable in `setup` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for: + Option<&'a [CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor]>, + /// Description of the mandate interval. + /// + /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_description: Option<&'a str>, + /// Payment schedule for the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_schedule: + Option, + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: + Option, +} +impl<'a> CreateSessionPaymentMethodOptionsAcssDebitMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// List of Stripe products where this mandate can be selected automatically. +/// +/// Only usable in `setup` mode. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + Invoice, + Subscription, +} +impl CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*; + match self { + Invoice => "invoice", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*; + match s { + "invoice" => Ok(Invoice), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreateSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreateSessionPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsAcssDebitVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Affirm payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsAffirm { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsAffirm { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsAffirmSetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsAffirmSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsAffirmSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsAffirmSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsAffirmSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsAffirmSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsAffirmSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Afterpay Clearpay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsAfterpayClearpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreateSessionPaymentMethodOptionsAfterpayClearpay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Alipay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsAlipay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsAlipay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsAlipaySetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsAlipaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsAlipaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsAlipaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsAlipaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsAlipaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsAlipaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the AU Becs Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsAuBecsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsAuBecsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Bacs Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsBacsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsBacsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreateSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Bancontact payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsBancontact { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsBancontactSetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsBancontactSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsBancontactSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsBancontactSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsBancontactSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsBancontactSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsBancontactSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Boleto payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsBoleto { + /// The number of calendar days before a Boleto voucher expires. + /// + /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsBoleto { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsBoletoSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreateSessionPaymentMethodOptionsBoletoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsBoletoSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsBoletoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsBoletoSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsBoletoSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsBoletoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Card payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsCard<'a> { + /// Installment options for card payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub installments: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Provides information about a card payment that customers see on their statements. + /// + /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kana: Option<&'a str>, + /// Provides information about a card payment that customers see on their statements. + /// + /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 17 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kanji: Option<&'a str>, +} +impl<'a> CreateSessionPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Installment options for card payments. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsCardInstallments { + /// Setting to true enables installments for this Checkout Session. + /// Setting to false will prevent any installment plan from applying to a payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} +impl CreateSessionPaymentMethodOptionsCardInstallments { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsCardSetupFutureUsage { + OffSession, + OnSession, +} +impl CreateSessionPaymentMethodOptionsCardSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsCardSetupFutureUsage::*; + match self { + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsCardSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsCardSetupFutureUsage::*; + match s { + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsCardSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsCardSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Cashapp Pay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsCashapp { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsCashapp { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsCashappSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreateSessionPaymentMethodOptionsCashappSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsCashappSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsCashappSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsCashappSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsCashappSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsCashappSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Customer Balance payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsCustomerBalance<'a> { + /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: Option>, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// + /// Permitted values include: `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub funding_type: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> CreateSessionPaymentMethodOptionsCustomerBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + /// Configuration for eu_bank_transfer funding type. + #[serde(skip_serializing_if = "Option::is_none")] + pub eu_bank_transfer: + Option>, + /// List of address types that should be returned in the financial_addresses response. + /// + /// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested_address_types: Option< + &'a [CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes], + >, + /// The list of bank transfer types that this PaymentIntent is allowed to use for funding. + #[serde(rename = "type")] + pub type_: CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferType, +} +impl<'a> CreateSessionPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + pub fn new(type_: CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferType) -> Self { + Self { + eu_bank_transfer: Default::default(), + requested_address_types: Default::default(), + type_, + } + } +} +/// Configuration for eu_bank_transfer funding type. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer<'a> { + /// The desired country code of the bank account information. + /// + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: &'a str, +} +impl<'a> CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer<'a> { + pub fn new(country: &'a str) -> Self { + Self { country } + } +} +/// List of address types that should be returned in the financial_addresses response. +/// +/// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + Aba, + Iban, + Sepa, + SortCode, + Spei, + Swift, + Zengin, +} +impl CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match self { + Aba => "aba", + Iban => "iban", + Sepa => "sepa", + SortCode => "sort_code", + Spei => "spei", + Swift => "swift", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr + for CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match s { + "aba" => Ok(Aba), + "iban" => Ok(Iban), + "sepa" => Ok(Sepa), + "sort_code" => Ok(SortCode), + "spei" => Ok(Spei), + "swift" => Ok(Swift), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl AsRef + for CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of bank transfer types that this PaymentIntent is allowed to use for funding. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferType { + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferType { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "gb_bank_transfer" => Ok(GbBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + "mx_bank_transfer" => Ok(MxBankTransfer), + "us_bank_transfer" => Ok(UsBankTransfer), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsCustomerBalanceBankTransferType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The funding method type to be used when there are not enough funds in the customer balance. +/// +/// Permitted values include: `bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsCustomerBalanceFundingType { + BankTransfer, +} +impl CreateSessionPaymentMethodOptionsCustomerBalanceFundingType { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsCustomerBalanceFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsCustomerBalanceFundingType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsCustomerBalanceFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsCustomerBalanceFundingType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsCustomerBalanceFundingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the EPS payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsEps { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsEps { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsEpsSetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsEpsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsEpsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsEpsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsEpsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsEpsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsEpsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the FPX payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsFpx { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsFpx { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsFpxSetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsFpxSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsFpxSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsFpxSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsFpxSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsFpxSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsFpxSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Giropay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsGiropay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsGiropay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsGiropaySetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsGiropaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsGiropaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsGiropaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsGiropaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsGiropaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsGiropaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Grabpay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsGrabpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsGrabpay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsGrabpaySetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsGrabpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsGrabpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsGrabpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsGrabpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsGrabpaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsGrabpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Ideal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsIdeal { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsIdealSetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsIdealSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsIdealSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsIdealSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsIdealSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsIdealSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsIdealSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Klarna payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsKlarna { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsKlarnaSetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsKlarnaSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsKlarnaSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsKlarnaSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsKlarnaSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsKlarnaSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsKlarnaSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Konbini payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsKonbini { + /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. + /// + /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. + /// Defaults to 3 days. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsKonbini { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsKonbiniSetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsKonbiniSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsKonbiniSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsKonbiniSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsKonbiniSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsKonbiniSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsKonbiniSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Link payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsLink { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsLink { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsLinkSetupFutureUsage { + None, + OffSession, +} +impl CreateSessionPaymentMethodOptionsLinkSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsLinkSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsLinkSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsLinkSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsLinkSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsLinkSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the OXXO payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsOxxo { + /// The number of calendar days before an OXXO voucher expires. + /// + /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsOxxo { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsOxxoSetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsOxxoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsOxxoSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsOxxoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsOxxoSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsOxxoSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsOxxoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the P24 payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsP24 { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Confirm that the payer has accepted the P24 terms and conditions. + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_shown_and_accepted: Option, +} +impl CreateSessionPaymentMethodOptionsP24 { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsP24SetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsP24SetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsP24SetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsP24SetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsP24SetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsP24SetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsP24SetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the PayNow payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsPaynow { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsPaynow { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsPaynowSetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsPaynowSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsPaynowSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsPaynowSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsPaynowSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsPaynowSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsPaynowSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the PayPal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsPaypal<'a> { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. + /// + /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// The risk correlation ID for an on-session payment using a saved PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub risk_correlation_id: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> CreateSessionPaymentMethodOptionsPaypal<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsPaypalCaptureMethod { + Manual, +} +impl CreateSessionPaymentMethodOptionsPaypalCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsPaypalCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsPaypalCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsPaypalCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsPaypalCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsPaypalCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateSessionPaymentMethodOptionsPaypalPreferredLocale { + CsMinusCz, + DaMinusDk, + DeMinusAt, + DeMinusDe, + DeMinusLu, + ElMinusGr, + EnMinusGb, + EnMinusUs, + EsMinusEs, + FiMinusFi, + FrMinusBe, + FrMinusFr, + FrMinusLu, + HuMinusHu, + ItMinusIt, + NlMinusBe, + NlMinusNl, + PlMinusPl, + PtMinusPt, + SkMinusSk, + SvMinusSe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateSessionPaymentMethodOptionsPaypalPreferredLocale { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsPaypalPreferredLocale::*; + match self { + CsMinusCz => "cs-CZ", + DaMinusDk => "da-DK", + DeMinusAt => "de-AT", + DeMinusDe => "de-DE", + DeMinusLu => "de-LU", + ElMinusGr => "el-GR", + EnMinusGb => "en-GB", + EnMinusUs => "en-US", + EsMinusEs => "es-ES", + FiMinusFi => "fi-FI", + FrMinusBe => "fr-BE", + FrMinusFr => "fr-FR", + FrMinusLu => "fr-LU", + HuMinusHu => "hu-HU", + ItMinusIt => "it-IT", + NlMinusBe => "nl-BE", + NlMinusNl => "nl-NL", + PlMinusPl => "pl-PL", + PtMinusPt => "pt-PT", + SkMinusSk => "sk-SK", + SvMinusSe => "sv-SE", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsPaypalPreferredLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsPaypalPreferredLocale::*; + match s { + "cs-CZ" => Ok(CsMinusCz), + "da-DK" => Ok(DaMinusDk), + "de-AT" => Ok(DeMinusAt), + "de-DE" => Ok(DeMinusDe), + "de-LU" => Ok(DeMinusLu), + "el-GR" => Ok(ElMinusGr), + "en-GB" => Ok(EnMinusGb), + "en-US" => Ok(EnMinusUs), + "es-ES" => Ok(EsMinusEs), + "fi-FI" => Ok(FiMinusFi), + "fr-BE" => Ok(FrMinusBe), + "fr-FR" => Ok(FrMinusFr), + "fr-LU" => Ok(FrMinusLu), + "hu-HU" => Ok(HuMinusHu), + "it-IT" => Ok(ItMinusIt), + "nl-BE" => Ok(NlMinusBe), + "nl-NL" => Ok(NlMinusNl), + "pl-PL" => Ok(PlMinusPl), + "pt-PT" => Ok(PtMinusPt), + "sk-SK" => Ok(SkMinusSk), + "sv-SE" => Ok(SvMinusSe), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsPaypalPreferredLocale { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsPaypalPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsPaypalPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsPaypalPreferredLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsPaypalSetupFutureUsage { + None, + OffSession, +} +impl CreateSessionPaymentMethodOptionsPaypalSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsPaypalSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsPaypalSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsPaypalSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsPaypalSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsPaypalSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Pix payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsPix { + /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. + /// + /// Defaults to 86400 seconds. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_seconds: Option, +} +impl CreateSessionPaymentMethodOptionsPix { + pub fn new() -> Self { + Self::default() + } +} +/// contains details about the RevolutPay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsRevolutPay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsRevolutPay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { + None, + OffSession, +} +impl CreateSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsRevolutPaySetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsRevolutPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Sepa Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsSepaDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsSepaDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreateSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Sofort payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsSofort { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateSessionPaymentMethodOptionsSofort { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsSofortSetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsSofortSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsSofortSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsSofortSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsSofortSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsSofortSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsSofortSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Us Bank Account payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: + Option>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> CreateSessionPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: + Option<&'a [CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions]>, + /// List of data features that you would like to retrieve upon account creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prefetch: + Option<&'a [CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch]>, +} +impl<'a> CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, +} +impl CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + } + } +} + +impl std::str::FromStr + for CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreateSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, +} +impl CreateSessionPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsUsBankAccountVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the WeChat Pay payment method options. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionPaymentMethodOptionsWechatPay<'a> { + /// The app ID registered with WeChat Pay. + /// + /// Only required when client is ios or android. + #[serde(skip_serializing_if = "Option::is_none")] + pub app_id: Option<&'a str>, + /// The client type that the end customer will pay from. + pub client: CreateSessionPaymentMethodOptionsWechatPayClient, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> CreateSessionPaymentMethodOptionsWechatPay<'a> { + pub fn new(client: CreateSessionPaymentMethodOptionsWechatPayClient) -> Self { + Self { app_id: Default::default(), client, setup_future_usage: Default::default() } + } +} +/// The client type that the end customer will pay from. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsWechatPayClient { + Android, + Ios, + Web, +} +impl CreateSessionPaymentMethodOptionsWechatPayClient { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsWechatPayClient::*; + match self { + Android => "android", + Ios => "ios", + Web => "web", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsWechatPayClient { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsWechatPayClient::*; + match s { + "android" => Ok(Android), + "ios" => Ok(Ios), + "web" => Ok(Web), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsWechatPayClient { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsWechatPayClient { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionPaymentMethodOptionsWechatPaySetupFutureUsage { + None, +} +impl CreateSessionPaymentMethodOptionsWechatPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodOptionsWechatPaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodOptionsWechatPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodOptionsWechatPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodOptionsWechatPaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodOptionsWechatPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. +/// +/// You can omit this attribute to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). +/// See [Dynamic Payment Methods](https://stripe.com/docs/payments/payment-methods/integration-options#using-dynamic-payment-methods) for more details. +/// +/// Read more about the supported payment methods and their requirements in our [payment +/// method details guide](/docs/payments/checkout/payment-methods). +/// +/// If multiple payment methods are passed, Checkout will dynamically reorder them to +/// prioritize the most relevant payment methods based on the customer's location and +/// other characteristics. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateSessionPaymentMethodTypes { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Card, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateSessionPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use CreateSessionPaymentMethodTypes::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateSessionPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionPaymentMethodTypes::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionPaymentMethodTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Controls phone number collection settings for the session. +/// +/// We recommend that you review your privacy policy and check with your legal contacts +/// before using this feature. +/// +/// Learn more about [collecting phone numbers with Checkout](https://stripe.com/docs/payments/checkout/phone-numbers). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionPhoneNumberCollection { + /// Set to `true` to enable phone number collection. + pub enabled: bool, +} +impl CreateSessionPhoneNumberCollection { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// This parameter applies to `ui_mode: embedded`. +/// +/// By default, Stripe will always redirect to your return_url after a successful confirmation. +/// If you set `redirect_on_completion: 'if_required'`, then we will only redirect if your user chooses a redirect-based payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionRedirectOnCompletion { + Always, + IfRequired, + Never, +} +impl CreateSessionRedirectOnCompletion { + pub fn as_str(self) -> &'static str { + use CreateSessionRedirectOnCompletion::*; + match self { + Always => "always", + IfRequired => "if_required", + Never => "never", + } + } +} + +impl std::str::FromStr for CreateSessionRedirectOnCompletion { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionRedirectOnCompletion::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionRedirectOnCompletion { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionRedirectOnCompletion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionRedirectOnCompletion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionRedirectOnCompletion { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionSetupIntentData<'a> { + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The Stripe account for which the setup is intended. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, +} +impl<'a> CreateSessionSetupIntentData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// When set, provides configuration for Checkout to collect a shipping address from a customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionShippingAddressCollection<'a> { + /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for + /// shipping locations. + /// + /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + pub allowed_countries: &'a [CreateSessionShippingAddressCollectionAllowedCountries], +} +impl<'a> CreateSessionShippingAddressCollection<'a> { + pub fn new( + allowed_countries: &'a [CreateSessionShippingAddressCollectionAllowedCountries], + ) -> Self { + Self { allowed_countries } + } +} +/// An array of two-letter ISO country codes representing which countries Checkout should provide as options for +/// shipping locations. +/// +/// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateSessionShippingAddressCollectionAllowedCountries { + Ac, + Ad, + Ae, + Af, + Ag, + Ai, + Al, + Am, + Ao, + Aq, + Ar, + At, + Au, + Aw, + Ax, + Az, + Ba, + Bb, + Bd, + Be, + Bf, + Bg, + Bh, + Bi, + Bj, + Bl, + Bm, + Bn, + Bo, + Bq, + Br, + Bs, + Bt, + Bv, + Bw, + By, + Bz, + Ca, + Cd, + Cf, + Cg, + Ch, + Ci, + Ck, + Cl, + Cm, + Cn, + Co, + Cr, + Cv, + Cw, + Cy, + Cz, + De, + Dj, + Dk, + Dm, + Do, + Dz, + Ec, + Ee, + Eg, + Eh, + Er, + Es, + Et, + Fi, + Fj, + Fk, + Fo, + Fr, + Ga, + Gb, + Gd, + Ge, + Gf, + Gg, + Gh, + Gi, + Gl, + Gm, + Gn, + Gp, + Gq, + Gr, + Gs, + Gt, + Gu, + Gw, + Gy, + Hk, + Hn, + Hr, + Ht, + Hu, + Id, + Ie, + Il, + Im, + In, + Io, + Iq, + Is, + It, + Je, + Jm, + Jo, + Jp, + Ke, + Kg, + Kh, + Ki, + Km, + Kn, + Kr, + Kw, + Ky, + Kz, + La, + Lb, + Lc, + Li, + Lk, + Lr, + Ls, + Lt, + Lu, + Lv, + Ly, + Ma, + Mc, + Md, + Me, + Mf, + Mg, + Mk, + Ml, + Mm, + Mn, + Mo, + Mq, + Mr, + Ms, + Mt, + Mu, + Mv, + Mw, + Mx, + My, + Mz, + Na, + Nc, + Ne, + Ng, + Ni, + Nl, + No, + Np, + Nr, + Nu, + Nz, + Om, + Pa, + Pe, + Pf, + Pg, + Ph, + Pk, + Pl, + Pm, + Pn, + Pr, + Ps, + Pt, + Py, + Qa, + Re, + Ro, + Rs, + Ru, + Rw, + Sa, + Sb, + Sc, + Se, + Sg, + Sh, + Si, + Sj, + Sk, + Sl, + Sm, + Sn, + So, + Sr, + Ss, + St, + Sv, + Sx, + Sz, + Ta, + Tc, + Td, + Tf, + Tg, + Th, + Tj, + Tk, + Tl, + Tm, + Tn, + To, + Tr, + Tt, + Tv, + Tw, + Tz, + Ua, + Ug, + Us, + Uy, + Uz, + Va, + Vc, + Ve, + Vg, + Vn, + Vu, + Wf, + Ws, + Xk, + Ye, + Yt, + Za, + Zm, + Zw, + Zz, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateSessionShippingAddressCollectionAllowedCountries { + pub fn as_str(self) -> &'static str { + use CreateSessionShippingAddressCollectionAllowedCountries::*; + match self { + Ac => "AC", + Ad => "AD", + Ae => "AE", + Af => "AF", + Ag => "AG", + Ai => "AI", + Al => "AL", + Am => "AM", + Ao => "AO", + Aq => "AQ", + Ar => "AR", + At => "AT", + Au => "AU", + Aw => "AW", + Ax => "AX", + Az => "AZ", + Ba => "BA", + Bb => "BB", + Bd => "BD", + Be => "BE", + Bf => "BF", + Bg => "BG", + Bh => "BH", + Bi => "BI", + Bj => "BJ", + Bl => "BL", + Bm => "BM", + Bn => "BN", + Bo => "BO", + Bq => "BQ", + Br => "BR", + Bs => "BS", + Bt => "BT", + Bv => "BV", + Bw => "BW", + By => "BY", + Bz => "BZ", + Ca => "CA", + Cd => "CD", + Cf => "CF", + Cg => "CG", + Ch => "CH", + Ci => "CI", + Ck => "CK", + Cl => "CL", + Cm => "CM", + Cn => "CN", + Co => "CO", + Cr => "CR", + Cv => "CV", + Cw => "CW", + Cy => "CY", + Cz => "CZ", + De => "DE", + Dj => "DJ", + Dk => "DK", + Dm => "DM", + Do => "DO", + Dz => "DZ", + Ec => "EC", + Ee => "EE", + Eg => "EG", + Eh => "EH", + Er => "ER", + Es => "ES", + Et => "ET", + Fi => "FI", + Fj => "FJ", + Fk => "FK", + Fo => "FO", + Fr => "FR", + Ga => "GA", + Gb => "GB", + Gd => "GD", + Ge => "GE", + Gf => "GF", + Gg => "GG", + Gh => "GH", + Gi => "GI", + Gl => "GL", + Gm => "GM", + Gn => "GN", + Gp => "GP", + Gq => "GQ", + Gr => "GR", + Gs => "GS", + Gt => "GT", + Gu => "GU", + Gw => "GW", + Gy => "GY", + Hk => "HK", + Hn => "HN", + Hr => "HR", + Ht => "HT", + Hu => "HU", + Id => "ID", + Ie => "IE", + Il => "IL", + Im => "IM", + In => "IN", + Io => "IO", + Iq => "IQ", + Is => "IS", + It => "IT", + Je => "JE", + Jm => "JM", + Jo => "JO", + Jp => "JP", + Ke => "KE", + Kg => "KG", + Kh => "KH", + Ki => "KI", + Km => "KM", + Kn => "KN", + Kr => "KR", + Kw => "KW", + Ky => "KY", + Kz => "KZ", + La => "LA", + Lb => "LB", + Lc => "LC", + Li => "LI", + Lk => "LK", + Lr => "LR", + Ls => "LS", + Lt => "LT", + Lu => "LU", + Lv => "LV", + Ly => "LY", + Ma => "MA", + Mc => "MC", + Md => "MD", + Me => "ME", + Mf => "MF", + Mg => "MG", + Mk => "MK", + Ml => "ML", + Mm => "MM", + Mn => "MN", + Mo => "MO", + Mq => "MQ", + Mr => "MR", + Ms => "MS", + Mt => "MT", + Mu => "MU", + Mv => "MV", + Mw => "MW", + Mx => "MX", + My => "MY", + Mz => "MZ", + Na => "NA", + Nc => "NC", + Ne => "NE", + Ng => "NG", + Ni => "NI", + Nl => "NL", + No => "NO", + Np => "NP", + Nr => "NR", + Nu => "NU", + Nz => "NZ", + Om => "OM", + Pa => "PA", + Pe => "PE", + Pf => "PF", + Pg => "PG", + Ph => "PH", + Pk => "PK", + Pl => "PL", + Pm => "PM", + Pn => "PN", + Pr => "PR", + Ps => "PS", + Pt => "PT", + Py => "PY", + Qa => "QA", + Re => "RE", + Ro => "RO", + Rs => "RS", + Ru => "RU", + Rw => "RW", + Sa => "SA", + Sb => "SB", + Sc => "SC", + Se => "SE", + Sg => "SG", + Sh => "SH", + Si => "SI", + Sj => "SJ", + Sk => "SK", + Sl => "SL", + Sm => "SM", + Sn => "SN", + So => "SO", + Sr => "SR", + Ss => "SS", + St => "ST", + Sv => "SV", + Sx => "SX", + Sz => "SZ", + Ta => "TA", + Tc => "TC", + Td => "TD", + Tf => "TF", + Tg => "TG", + Th => "TH", + Tj => "TJ", + Tk => "TK", + Tl => "TL", + Tm => "TM", + Tn => "TN", + To => "TO", + Tr => "TR", + Tt => "TT", + Tv => "TV", + Tw => "TW", + Tz => "TZ", + Ua => "UA", + Ug => "UG", + Us => "US", + Uy => "UY", + Uz => "UZ", + Va => "VA", + Vc => "VC", + Ve => "VE", + Vg => "VG", + Vn => "VN", + Vu => "VU", + Wf => "WF", + Ws => "WS", + Xk => "XK", + Ye => "YE", + Yt => "YT", + Za => "ZA", + Zm => "ZM", + Zw => "ZW", + Zz => "ZZ", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateSessionShippingAddressCollectionAllowedCountries { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionShippingAddressCollectionAllowedCountries::*; + match s { + "AC" => Ok(Ac), + "AD" => Ok(Ad), + "AE" => Ok(Ae), + "AF" => Ok(Af), + "AG" => Ok(Ag), + "AI" => Ok(Ai), + "AL" => Ok(Al), + "AM" => Ok(Am), + "AO" => Ok(Ao), + "AQ" => Ok(Aq), + "AR" => Ok(Ar), + "AT" => Ok(At), + "AU" => Ok(Au), + "AW" => Ok(Aw), + "AX" => Ok(Ax), + "AZ" => Ok(Az), + "BA" => Ok(Ba), + "BB" => Ok(Bb), + "BD" => Ok(Bd), + "BE" => Ok(Be), + "BF" => Ok(Bf), + "BG" => Ok(Bg), + "BH" => Ok(Bh), + "BI" => Ok(Bi), + "BJ" => Ok(Bj), + "BL" => Ok(Bl), + "BM" => Ok(Bm), + "BN" => Ok(Bn), + "BO" => Ok(Bo), + "BQ" => Ok(Bq), + "BR" => Ok(Br), + "BS" => Ok(Bs), + "BT" => Ok(Bt), + "BV" => Ok(Bv), + "BW" => Ok(Bw), + "BY" => Ok(By), + "BZ" => Ok(Bz), + "CA" => Ok(Ca), + "CD" => Ok(Cd), + "CF" => Ok(Cf), + "CG" => Ok(Cg), + "CH" => Ok(Ch), + "CI" => Ok(Ci), + "CK" => Ok(Ck), + "CL" => Ok(Cl), + "CM" => Ok(Cm), + "CN" => Ok(Cn), + "CO" => Ok(Co), + "CR" => Ok(Cr), + "CV" => Ok(Cv), + "CW" => Ok(Cw), + "CY" => Ok(Cy), + "CZ" => Ok(Cz), + "DE" => Ok(De), + "DJ" => Ok(Dj), + "DK" => Ok(Dk), + "DM" => Ok(Dm), + "DO" => Ok(Do), + "DZ" => Ok(Dz), + "EC" => Ok(Ec), + "EE" => Ok(Ee), + "EG" => Ok(Eg), + "EH" => Ok(Eh), + "ER" => Ok(Er), + "ES" => Ok(Es), + "ET" => Ok(Et), + "FI" => Ok(Fi), + "FJ" => Ok(Fj), + "FK" => Ok(Fk), + "FO" => Ok(Fo), + "FR" => Ok(Fr), + "GA" => Ok(Ga), + "GB" => Ok(Gb), + "GD" => Ok(Gd), + "GE" => Ok(Ge), + "GF" => Ok(Gf), + "GG" => Ok(Gg), + "GH" => Ok(Gh), + "GI" => Ok(Gi), + "GL" => Ok(Gl), + "GM" => Ok(Gm), + "GN" => Ok(Gn), + "GP" => Ok(Gp), + "GQ" => Ok(Gq), + "GR" => Ok(Gr), + "GS" => Ok(Gs), + "GT" => Ok(Gt), + "GU" => Ok(Gu), + "GW" => Ok(Gw), + "GY" => Ok(Gy), + "HK" => Ok(Hk), + "HN" => Ok(Hn), + "HR" => Ok(Hr), + "HT" => Ok(Ht), + "HU" => Ok(Hu), + "ID" => Ok(Id), + "IE" => Ok(Ie), + "IL" => Ok(Il), + "IM" => Ok(Im), + "IN" => Ok(In), + "IO" => Ok(Io), + "IQ" => Ok(Iq), + "IS" => Ok(Is), + "IT" => Ok(It), + "JE" => Ok(Je), + "JM" => Ok(Jm), + "JO" => Ok(Jo), + "JP" => Ok(Jp), + "KE" => Ok(Ke), + "KG" => Ok(Kg), + "KH" => Ok(Kh), + "KI" => Ok(Ki), + "KM" => Ok(Km), + "KN" => Ok(Kn), + "KR" => Ok(Kr), + "KW" => Ok(Kw), + "KY" => Ok(Ky), + "KZ" => Ok(Kz), + "LA" => Ok(La), + "LB" => Ok(Lb), + "LC" => Ok(Lc), + "LI" => Ok(Li), + "LK" => Ok(Lk), + "LR" => Ok(Lr), + "LS" => Ok(Ls), + "LT" => Ok(Lt), + "LU" => Ok(Lu), + "LV" => Ok(Lv), + "LY" => Ok(Ly), + "MA" => Ok(Ma), + "MC" => Ok(Mc), + "MD" => Ok(Md), + "ME" => Ok(Me), + "MF" => Ok(Mf), + "MG" => Ok(Mg), + "MK" => Ok(Mk), + "ML" => Ok(Ml), + "MM" => Ok(Mm), + "MN" => Ok(Mn), + "MO" => Ok(Mo), + "MQ" => Ok(Mq), + "MR" => Ok(Mr), + "MS" => Ok(Ms), + "MT" => Ok(Mt), + "MU" => Ok(Mu), + "MV" => Ok(Mv), + "MW" => Ok(Mw), + "MX" => Ok(Mx), + "MY" => Ok(My), + "MZ" => Ok(Mz), + "NA" => Ok(Na), + "NC" => Ok(Nc), + "NE" => Ok(Ne), + "NG" => Ok(Ng), + "NI" => Ok(Ni), + "NL" => Ok(Nl), + "NO" => Ok(No), + "NP" => Ok(Np), + "NR" => Ok(Nr), + "NU" => Ok(Nu), + "NZ" => Ok(Nz), + "OM" => Ok(Om), + "PA" => Ok(Pa), + "PE" => Ok(Pe), + "PF" => Ok(Pf), + "PG" => Ok(Pg), + "PH" => Ok(Ph), + "PK" => Ok(Pk), + "PL" => Ok(Pl), + "PM" => Ok(Pm), + "PN" => Ok(Pn), + "PR" => Ok(Pr), + "PS" => Ok(Ps), + "PT" => Ok(Pt), + "PY" => Ok(Py), + "QA" => Ok(Qa), + "RE" => Ok(Re), + "RO" => Ok(Ro), + "RS" => Ok(Rs), + "RU" => Ok(Ru), + "RW" => Ok(Rw), + "SA" => Ok(Sa), + "SB" => Ok(Sb), + "SC" => Ok(Sc), + "SE" => Ok(Se), + "SG" => Ok(Sg), + "SH" => Ok(Sh), + "SI" => Ok(Si), + "SJ" => Ok(Sj), + "SK" => Ok(Sk), + "SL" => Ok(Sl), + "SM" => Ok(Sm), + "SN" => Ok(Sn), + "SO" => Ok(So), + "SR" => Ok(Sr), + "SS" => Ok(Ss), + "ST" => Ok(St), + "SV" => Ok(Sv), + "SX" => Ok(Sx), + "SZ" => Ok(Sz), + "TA" => Ok(Ta), + "TC" => Ok(Tc), + "TD" => Ok(Td), + "TF" => Ok(Tf), + "TG" => Ok(Tg), + "TH" => Ok(Th), + "TJ" => Ok(Tj), + "TK" => Ok(Tk), + "TL" => Ok(Tl), + "TM" => Ok(Tm), + "TN" => Ok(Tn), + "TO" => Ok(To), + "TR" => Ok(Tr), + "TT" => Ok(Tt), + "TV" => Ok(Tv), + "TW" => Ok(Tw), + "TZ" => Ok(Tz), + "UA" => Ok(Ua), + "UG" => Ok(Ug), + "US" => Ok(Us), + "UY" => Ok(Uy), + "UZ" => Ok(Uz), + "VA" => Ok(Va), + "VC" => Ok(Vc), + "VE" => Ok(Ve), + "VG" => Ok(Vg), + "VN" => Ok(Vn), + "VU" => Ok(Vu), + "WF" => Ok(Wf), + "WS" => Ok(Ws), + "XK" => Ok(Xk), + "YE" => Ok(Ye), + "YT" => Ok(Yt), + "ZA" => Ok(Za), + "ZM" => Ok(Zm), + "ZW" => Ok(Zw), + "ZZ" => Ok(Zz), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionShippingAddressCollectionAllowedCountries { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionShippingAddressCollectionAllowedCountries { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The shipping rate options to apply to this Session. +/// +/// Up to a maximum of 5. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionShippingOptions<'a> { + /// The ID of the Shipping Rate to use for this shipping option. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option<&'a str>, + /// Parameters to be passed to Shipping Rate creation for this shipping option. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate_data: Option>, +} +impl<'a> CreateSessionShippingOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Parameters to be passed to Shipping Rate creation for this shipping option. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionShippingOptionsShippingRateData<'a> { + /// The estimated range for how long shipping will take, meant to be displayable to the customer. + /// + /// This will appear on CheckoutSessions. + #[serde(skip_serializing_if = "Option::is_none")] + pub delivery_estimate: Option, + /// The name of the shipping rate, meant to be displayable to the customer. + /// + /// This will appear on CheckoutSessions. + pub display_name: &'a str, + /// Describes a fixed amount to charge for shipping. + /// + /// Must be present if type is `fixed_amount`. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amount: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + /// + /// The Shipping tax code is `txcd_92010001`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// The type of calculation to use on the shipping rate. + /// + /// Can only be `fixed_amount` for now. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> CreateSessionShippingOptionsShippingRateData<'a> { + pub fn new(display_name: &'a str) -> Self { + Self { + delivery_estimate: Default::default(), + display_name, + fixed_amount: Default::default(), + metadata: Default::default(), + tax_behavior: Default::default(), + tax_code: Default::default(), + type_: Default::default(), + } + } +} +/// The estimated range for how long shipping will take, meant to be displayable to the customer. +/// +/// This will appear on CheckoutSessions. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionShippingOptionsShippingRateDataDeliveryEstimate { + /// The upper bound of the estimated range. + /// + /// If empty, represents no upper bound i.e., infinite. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option, + /// The lower bound of the estimated range. + /// + /// If empty, represents no lower bound. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option, +} +impl CreateSessionShippingOptionsShippingRateDataDeliveryEstimate { + pub fn new() -> Self { + Self::default() + } +} +/// The upper bound of the estimated range. +/// +/// If empty, represents no upper bound i.e., infinite. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum { + /// A unit of time. + pub unit: CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit, + /// Must be greater than 0. + pub value: i64, +} +impl CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum { + pub fn new( + unit: CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit, + value: i64, + ) -> Self { + Self { unit, value } + } +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit { + pub fn as_str(self) -> &'static str { + use CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr for CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The lower bound of the estimated range. +/// +/// If empty, represents no lower bound. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum { + /// A unit of time. + pub unit: CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit, + /// Must be greater than 0. + pub value: i64, +} +impl CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum { + pub fn new( + unit: CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit, + value: i64, + ) -> Self { + Self { unit, value } + } +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit { + pub fn as_str(self) -> &'static str { + use CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr for CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Describes a fixed amount to charge for shipping. +/// +/// Must be present if type is `fixed_amount`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionShippingOptionsShippingRateDataFixedAmount<'a> { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Shipping rates defined in each available currency option. + /// + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + &'a std::collections::HashMap< + stripe_types::Currency, + CreateSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions, + >, + >, +} +impl<'a> CreateSessionShippingOptionsShippingRateDataFixedAmount<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { amount, currency, currency_options: Default::default() } + } +} +/// Shipping rates defined in each available currency option. +/// +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: + Option, +} +impl CreateSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions { + pub fn new(amount: i64) -> Self { + Self { amount, tax_behavior: Default::default() } + } +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr + for CreateSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef + for CreateSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionShippingOptionsShippingRateDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateSessionShippingOptionsShippingRateDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateSessionShippingOptionsShippingRateDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateSessionShippingOptionsShippingRateDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionShippingOptionsShippingRateDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionShippingOptionsShippingRateDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionShippingOptionsShippingRateDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionShippingOptionsShippingRateDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionShippingOptionsShippingRateDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of calculation to use on the shipping rate. +/// +/// Can only be `fixed_amount` for now. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionShippingOptionsShippingRateDataType { + FixedAmount, +} +impl CreateSessionShippingOptionsShippingRateDataType { + pub fn as_str(self) -> &'static str { + use CreateSessionShippingOptionsShippingRateDataType::*; + match self { + FixedAmount => "fixed_amount", + } + } +} + +impl std::str::FromStr for CreateSessionShippingOptionsShippingRateDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionShippingOptionsShippingRateDataType::*; + match s { + "fixed_amount" => Ok(FixedAmount), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionShippingOptionsShippingRateDataType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionShippingOptionsShippingRateDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionShippingOptionsShippingRateDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionShippingOptionsShippingRateDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Describes the type of transaction being performed by Checkout in order to customize +/// relevant text on the page, such as the submit button. +/// +/// `submit_type` can only be specified on Checkout Sessions in `payment` mode, but not Checkout Sessions in `subscription` or `setup` mode. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionSubmitType { + Auto, + Book, + Donate, + Pay, +} +impl CreateSessionSubmitType { + pub fn as_str(self) -> &'static str { + use CreateSessionSubmitType::*; + match self { + Auto => "auto", + Book => "book", + Donate => "donate", + Pay => "pay", + } + } +} + +impl std::str::FromStr for CreateSessionSubmitType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionSubmitType::*; + match s { + "auto" => Ok(Auto), + "book" => Ok(Book), + "donate" => Ok(Donate), + "pay" => Ok(Pay), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionSubmitType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionSubmitType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionSubmitType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionSubmitType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSessionSubscriptionData<'a> { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// To use an application fee percent, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. + /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// A future timestamp to anchor the subscription's billing cycle for new subscriptions. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_cycle_anchor: Option, + /// The tax rates that will apply to any subscription item that does not have + /// `tax_rates` set. + /// + /// Invoices created will have their `default_tax_rates` populated from the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// The subscription's description, meant to be displayable to the customer. + /// Use this field to optionally store an explanation of the subscription + /// for rendering in the [customer portal](https://stripe.com/docs/customer-management). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The account on behalf of which to charge, for each of the subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// Determines how to handle prorations resulting from the `billing_cycle_anchor`. + /// + /// If no value is passed, the default is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, + /// Unix timestamp representing the end of the trial period the customer + /// will get before being charged for the first time. + /// + /// Has to be at least 48 hours in the future. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_end: Option, + /// Integer representing the number of trial period days before the + /// customer is charged for the first time. + /// + /// Has to be at least 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_period_days: Option, + /// Settings related to subscription trials. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_settings: Option, +} +impl<'a> CreateSessionSubscriptionData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Determines how to handle prorations resulting from the `billing_cycle_anchor`. +/// +/// If no value is passed, the default is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionSubscriptionDataProrationBehavior { + CreateProrations, + None, +} +impl CreateSessionSubscriptionDataProrationBehavior { + pub fn as_str(self) -> &'static str { + use CreateSessionSubscriptionDataProrationBehavior::*; + match self { + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for CreateSessionSubscriptionDataProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionSubscriptionDataProrationBehavior::*; + match s { + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionSubscriptionDataProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionSubscriptionDataProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionSubscriptionDataProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionSubscriptionDataProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionSubscriptionDataTransferData<'a> { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. + /// By default, the entire amount is transferred to the destination. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_percent: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> CreateSessionSubscriptionDataTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount_percent: Default::default(), destination } + } +} +/// Settings related to subscription trials. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionSubscriptionDataTrialSettings { + /// Defines how the subscription should behave when the user's free trial ends. + pub end_behavior: CreateSessionSubscriptionDataTrialSettingsEndBehavior, +} +impl CreateSessionSubscriptionDataTrialSettings { + pub fn new(end_behavior: CreateSessionSubscriptionDataTrialSettingsEndBehavior) -> Self { + Self { end_behavior } + } +} +/// Defines how the subscription should behave when the user's free trial ends. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionSubscriptionDataTrialSettingsEndBehavior { + /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + pub missing_payment_method: + CreateSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod, +} +impl CreateSessionSubscriptionDataTrialSettingsEndBehavior { + pub fn new( + missing_payment_method: CreateSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod, + ) -> Self { + Self { missing_payment_method } + } +} +/// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { + Cancel, + CreateInvoice, + Pause, +} +impl CreateSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { + pub fn as_str(self) -> &'static str { + use CreateSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::*; + match self { + Cancel => "cancel", + CreateInvoice => "create_invoice", + Pause => "pause", + } + } +} + +impl std::str::FromStr + for CreateSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::*; + match s { + "cancel" => Ok(Cancel), + "create_invoice" => Ok(CreateInvoice), + "pause" => Ok(Pause), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Controls tax ID collection settings for the session. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSessionTaxIdCollection { + /// Set to true to enable Tax ID collection. + pub enabled: bool, +} +impl CreateSessionTaxIdCollection { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// `ui_mode` can be `hosted` or `embedded`. +/// +/// The default is `hosted`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSessionUiMode { + Embedded, + Hosted, +} +impl CreateSessionUiMode { + pub fn as_str(self) -> &'static str { + use CreateSessionUiMode::*; + match self { + Embedded => "embedded", + Hosted => "hosted", + } + } +} + +impl std::str::FromStr for CreateSessionUiMode { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSessionUiMode::*; + match s { + "embedded" => Ok(Embedded), + "hosted" => Ok(Hosted), + _ => Err(()), + } + } +} +impl AsRef for CreateSessionUiMode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSessionUiMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSessionUiMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSessionUiMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateSession<'a> { + /// Creates a Session object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/checkout/sessions", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListLineItemsSession<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListLineItemsSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListLineItemsSession<'a> { + /// When retrieving a Checkout Session, there is an includable **line_items** property containing the first handful of those items. + /// + /// There is also a URL where you can retrieve the full (paginated) list of line items. + pub fn send( + &self, + client: &stripe::Client, + session: &str, + ) -> stripe::Response> { + client.get_query(&format!("/checkout/sessions/{session}/line_items"), self) + } + pub fn paginate(self, session: &str) -> stripe::ListPaginator { + stripe::ListPaginator::from_params( + &format!("/checkout/sessions/{session}/line_items"), + self, + ) + } +} +impl<'a> stripe::PaginationParams for ListLineItemsSession<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ExpireSession<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ExpireSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ExpireSession<'a> { + /// A Session can be expired when it is in one of these statuses: `open` + /// + /// After it expires, a customer can’t complete a Session and customers loading the Session see a message saying the Session is expired. + pub fn send( + &self, + client: &stripe::Client, + session: &str, + ) -> stripe::Response { + client.send_form( + &format!("/checkout/sessions/{session}/expire"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_connect/Cargo.toml b/generated/stripe_connect/Cargo.toml new file mode 100644 index 000000000..2d51b1dd5 --- /dev/null +++ b/generated/stripe_connect/Cargo.toml @@ -0,0 +1,67 @@ +[package] +name = "stripe_connect" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + +[dependencies] +serde.workspace = true +http-types.workspace = true +smol_str.workspace = true +serde_json.workspace = true +async-stripe = {path = "../../async-stripe"} + +stripe_types = {path = "../../stripe_types"} + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +account = [] +account_capability = [] +account_link = [] +connect_embedded_method_account_session_create_method_account_session = [] +country_spec = [] +external_account = [] +fee_refund = [] +login_link = [] +person = [] +platform_fee = [] +secret_service_resource_secret = [] +topup = [] +transfer = [] +transfer_reversal = [] + +full = ["account", +"account_capability", +"account_link", +"connect_embedded_method_account_session_create_method_account_session", +"country_spec", +"external_account", +"fee_refund", +"login_link", +"person", +"platform_fee", +"secret_service_resource_secret", +"topup", +"transfer", +"transfer_reversal"] + diff --git a/generated/stripe_connect/src/account/mod.rs b/generated/stripe_connect/src/account/mod.rs new file mode 100644 index 000000000..afb4eca99 --- /dev/null +++ b/generated/stripe_connect/src/account/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::account::*; +#[cfg(feature = "account")] +mod requests; +#[cfg(feature = "account")] +pub use requests::*; diff --git a/generated/stripe_connect/src/account/requests.rs b/generated/stripe_connect/src/account/requests.rs new file mode 100644 index 000000000..34ecd8688 --- /dev/null +++ b/generated/stripe_connect/src/account/requests.rs @@ -0,0 +1,4521 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveForMyAccountAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveForMyAccountAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveForMyAccountAccount<'a> { + /// Retrieves the details of an account. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.get_query("/account", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveAccount<'a> { + /// Retrieves the details of an account. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + ) -> stripe::Response { + client.get_query(&format!("/accounts/{account}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccount<'a> { + /// An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_token: Option<&'a str>, + /// Business information about the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub business_profile: Option>, + /// The business type. + #[serde(skip_serializing_if = "Option::is_none")] + pub business_type: Option, + /// Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. + /// + /// whether it has been requested or not). + /// Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. + /// An account may have some of its requested capabilities be active and some be inactive. + #[serde(skip_serializing_if = "Option::is_none")] + pub capabilities: Option, + /// Information about the company or business. + /// + /// This field is available for any `business_type`. + #[serde(skip_serializing_if = "Option::is_none")] + pub company: Option>, + /// Three-letter ISO currency code representing the default currency for the account. + /// + /// This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). + #[serde(skip_serializing_if = "Option::is_none")] + pub default_currency: Option, + /// Documents that may be submitted to satisfy various informational requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub documents: Option>, + /// The email address of the account holder. + /// + /// This is only to make the account easier to identify to you. + /// Stripe only emails Custom accounts with your consent. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won’t be able to use it for top-ups). + /// + /// You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. + /// By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. + /// To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub external_account: Option<&'a str>, + /// Information about the person represented by the account. + /// + /// This field is null unless `business_type` is set to `individual`. + #[serde(skip_serializing_if = "Option::is_none")] + pub individual: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Options for customizing how the account functions within Stripe. + #[serde(skip_serializing_if = "Option::is_none")] + pub settings: Option>, + /// Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_acceptance: Option>, +} +impl<'a> UpdateAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Business information about the account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountBusinessProfile<'a> { + /// [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). + /// + /// MCCs are used to classify businesses based on the goods or services they provide. + #[serde(skip_serializing_if = "Option::is_none")] + pub mcc: Option<&'a str>, + /// An estimate of the monthly revenue of the business. + /// + /// Only accepted for accounts in Brazil and India. + #[serde(skip_serializing_if = "Option::is_none")] + pub monthly_estimated_revenue: Option, + /// The customer-facing business name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Internal-only description of the product sold by, or service provided by, the business. + /// + /// Used by Stripe for risk and underwriting purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// A publicly available mailing address for sending support issues to. + #[serde(skip_serializing_if = "Option::is_none")] + pub support_address: Option>, + /// A publicly available email address for sending support issues to. + #[serde(skip_serializing_if = "Option::is_none")] + pub support_email: Option<&'a str>, + /// A publicly available phone number to call with support issues. + #[serde(skip_serializing_if = "Option::is_none")] + pub support_phone: Option<&'a str>, + /// A publicly available website for handling support issues. + #[serde(skip_serializing_if = "Option::is_none")] + pub support_url: Option<&'a str>, + /// The business's publicly available website. + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option<&'a str>, +} +impl<'a> UpdateAccountBusinessProfile<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An estimate of the monthly revenue of the business. +/// +/// Only accepted for accounts in Brazil and India. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateAccountBusinessProfileMonthlyEstimatedRevenue { + /// A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, +} +impl UpdateAccountBusinessProfileMonthlyEstimatedRevenue { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { amount, currency } + } +} +/// A publicly available mailing address for sending support issues to. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountBusinessProfileSupportAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateAccountBusinessProfileSupportAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The business type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateAccountBusinessType { + Company, + GovernmentEntity, + Individual, + NonProfit, +} +impl UpdateAccountBusinessType { + pub fn as_str(self) -> &'static str { + use UpdateAccountBusinessType::*; + match self { + Company => "company", + GovernmentEntity => "government_entity", + Individual => "individual", + NonProfit => "non_profit", + } + } +} + +impl std::str::FromStr for UpdateAccountBusinessType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateAccountBusinessType::*; + match s { + "company" => Ok(Company), + "government_entity" => Ok(GovernmentEntity), + "individual" => Ok(Individual), + "non_profit" => Ok(NonProfit), + _ => Err(()), + } + } +} +impl AsRef for UpdateAccountBusinessType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateAccountBusinessType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateAccountBusinessType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateAccountBusinessType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. +/// +/// whether it has been requested or not). +/// Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. +/// An account may have some of its requested capabilities be active and some be inactive. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilities { + /// The acss_debit_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit_payments: Option, + /// The affirm_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm_payments: Option, + /// The afterpay_clearpay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay_payments: Option, + /// The au_becs_debit_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit_payments: Option, + /// The bacs_debit_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit_payments: Option, + /// The bancontact_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact_payments: Option, + /// The bank_transfer_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer_payments: Option, + /// The blik_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik_payments: Option, + /// The boleto_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto_payments: Option, + /// The card_issuing capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option, + /// The card_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_payments: Option, + /// The cartes_bancaires_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub cartes_bancaires_payments: Option, + /// The cashapp_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp_payments: Option, + /// The eps_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps_payments: Option, + /// The fpx_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx_payments: Option, + /// The giropay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay_payments: Option, + /// The grabpay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay_payments: Option, + /// The ideal_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal_payments: Option, + /// The india_international_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub india_international_payments: Option, + /// The jcb_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub jcb_payments: Option, + /// The klarna_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna_payments: Option, + /// The konbini_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini_payments: Option, + /// The legacy_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub legacy_payments: Option, + /// The link_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub link_payments: Option, + /// The oxxo_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo_payments: Option, + /// The p24_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24_payments: Option, + /// The paynow_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow_payments: Option, + /// The promptpay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay_payments: Option, + /// The revolut_pay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay_payments: Option, + /// The sepa_debit_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit_payments: Option, + /// The sofort_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort_payments: Option, + /// The tax_reporting_us_1099_k capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_reporting_us_1099_k: Option, + /// The tax_reporting_us_1099_misc capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_reporting_us_1099_misc: Option, + /// The transfers capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfers: Option, + /// The treasury capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option, + /// The us_bank_account_ach_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account_ach_payments: Option, + /// The zip_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip_payments: Option, +} +impl UpdateAccountCapabilities { + pub fn new() -> Self { + Self::default() + } +} +/// The acss_debit_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesAcssDebitPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesAcssDebitPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The affirm_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesAffirmPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesAffirmPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The afterpay_clearpay_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesAfterpayClearpayPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesAfterpayClearpayPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The au_becs_debit_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesAuBecsDebitPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesAuBecsDebitPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The bacs_debit_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesBacsDebitPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesBacsDebitPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The bancontact_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesBancontactPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesBancontactPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The bank_transfer_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesBankTransferPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesBankTransferPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The blik_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesBlikPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesBlikPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The boleto_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesBoletoPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesBoletoPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The card_issuing capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesCardIssuing { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesCardIssuing { + pub fn new() -> Self { + Self::default() + } +} +/// The card_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesCardPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesCardPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The cartes_bancaires_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesCartesBancairesPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesCartesBancairesPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The cashapp_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesCashappPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesCashappPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The eps_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesEpsPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesEpsPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The fpx_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesFpxPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesFpxPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The giropay_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesGiropayPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesGiropayPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The grabpay_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesGrabpayPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesGrabpayPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The ideal_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesIdealPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesIdealPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The india_international_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesIndiaInternationalPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesIndiaInternationalPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The jcb_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesJcbPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesJcbPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The klarna_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesKlarnaPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesKlarnaPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The konbini_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesKonbiniPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesKonbiniPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The legacy_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesLegacyPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesLegacyPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The link_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesLinkPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesLinkPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The oxxo_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesOxxoPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesOxxoPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The p24_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesP24Payments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesP24Payments { + pub fn new() -> Self { + Self::default() + } +} +/// The paynow_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesPaynowPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesPaynowPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The promptpay_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesPromptpayPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesPromptpayPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The revolut_pay_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesRevolutPayPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesRevolutPayPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The sepa_debit_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesSepaDebitPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesSepaDebitPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The sofort_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesSofortPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesSofortPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The tax_reporting_us_1099_k capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesTaxReportingUs1099K { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesTaxReportingUs1099K { + pub fn new() -> Self { + Self::default() + } +} +/// The tax_reporting_us_1099_misc capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesTaxReportingUs1099Misc { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesTaxReportingUs1099Misc { + pub fn new() -> Self { + Self::default() + } +} +/// The transfers capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesTransfers { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesTransfers { + pub fn new() -> Self { + Self::default() + } +} +/// The treasury capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesTreasury { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesTreasury { + pub fn new() -> Self { + Self::default() + } +} +/// The us_bank_account_ach_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesUsBankAccountAchPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesUsBankAccountAchPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The zip_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapabilitiesZipPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl UpdateAccountCapabilitiesZipPayments { + pub fn new() -> Self { + Self::default() + } +} +/// Information about the company or business. +/// +/// This field is available for any `business_type`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCompany<'a> { + /// The company's primary address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the company's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the company's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// Whether the company's directors have been provided. + /// + /// Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. + /// This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub directors_provided: Option, + /// Whether the company's executives have been provided. + /// + /// Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. + #[serde(skip_serializing_if = "Option::is_none")] + pub executives_provided: Option, + /// The export license ID number of the company, also referred as Import Export Code (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_license_id: Option<&'a str>, + /// The purpose code to use for export transactions (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_purpose_code: Option<&'a str>, + /// The company's legal name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// The Kana variation of the company's legal name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub name_kana: Option<&'a str>, + /// The Kanji variation of the company's legal name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub name_kanji: Option<&'a str>, + /// Whether the company's owners have been provided. + /// + /// Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. + #[serde(skip_serializing_if = "Option::is_none")] + pub owners_provided: Option, + /// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. + #[serde(skip_serializing_if = "Option::is_none")] + pub ownership_declaration: Option>, + /// The company's phone number (used for verification). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. + /// + /// (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). + #[serde(skip_serializing_if = "Option::is_none")] + pub registration_number: Option<&'a str>, + /// The category identifying the legal structure of the company or legal entity. + /// + /// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub structure: Option, + /// The business ID number of the company, as appropriate for the company’s country. + /// + /// (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.). + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id: Option<&'a str>, + /// The jurisdiction in which the `tax_id` is registered (Germany-based companies only). + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_registrar: Option<&'a str>, + /// The VAT number of the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub vat_id: Option<&'a str>, + /// Information on the verification state of the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> UpdateAccountCompany<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The company's primary address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCompanyAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateAccountCompanyAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the company's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCompanyAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> UpdateAccountCompanyAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the company's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCompanyAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> UpdateAccountCompanyAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCompanyOwnershipDeclaration<'a> { + /// The Unix timestamp marking when the beneficial owner attestation was made. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the beneficial owner attestation was made. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the beneficial owner attestation was made. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> UpdateAccountCompanyOwnershipDeclaration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The category identifying the legal structure of the company or legal entity. +/// +/// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateAccountCompanyStructure { + FreeZoneEstablishment, + FreeZoneLlc, + GovernmentInstrumentality, + GovernmentalUnit, + IncorporatedNonProfit, + IncorporatedPartnership, + LimitedLiabilityPartnership, + Llc, + MultiMemberLlc, + PrivateCompany, + PrivateCorporation, + PrivatePartnership, + PublicCompany, + PublicCorporation, + PublicPartnership, + SingleMemberLlc, + SoleEstablishment, + SoleProprietorship, + TaxExemptGovernmentInstrumentality, + UnincorporatedAssociation, + UnincorporatedNonProfit, + UnincorporatedPartnership, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateAccountCompanyStructure { + pub fn as_str(self) -> &'static str { + use UpdateAccountCompanyStructure::*; + match self { + FreeZoneEstablishment => "free_zone_establishment", + FreeZoneLlc => "free_zone_llc", + GovernmentInstrumentality => "government_instrumentality", + GovernmentalUnit => "governmental_unit", + IncorporatedNonProfit => "incorporated_non_profit", + IncorporatedPartnership => "incorporated_partnership", + LimitedLiabilityPartnership => "limited_liability_partnership", + Llc => "llc", + MultiMemberLlc => "multi_member_llc", + PrivateCompany => "private_company", + PrivateCorporation => "private_corporation", + PrivatePartnership => "private_partnership", + PublicCompany => "public_company", + PublicCorporation => "public_corporation", + PublicPartnership => "public_partnership", + SingleMemberLlc => "single_member_llc", + SoleEstablishment => "sole_establishment", + SoleProprietorship => "sole_proprietorship", + TaxExemptGovernmentInstrumentality => "tax_exempt_government_instrumentality", + UnincorporatedAssociation => "unincorporated_association", + UnincorporatedNonProfit => "unincorporated_non_profit", + UnincorporatedPartnership => "unincorporated_partnership", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateAccountCompanyStructure { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateAccountCompanyStructure::*; + match s { + "free_zone_establishment" => Ok(FreeZoneEstablishment), + "free_zone_llc" => Ok(FreeZoneLlc), + "government_instrumentality" => Ok(GovernmentInstrumentality), + "governmental_unit" => Ok(GovernmentalUnit), + "incorporated_non_profit" => Ok(IncorporatedNonProfit), + "incorporated_partnership" => Ok(IncorporatedPartnership), + "limited_liability_partnership" => Ok(LimitedLiabilityPartnership), + "llc" => Ok(Llc), + "multi_member_llc" => Ok(MultiMemberLlc), + "private_company" => Ok(PrivateCompany), + "private_corporation" => Ok(PrivateCorporation), + "private_partnership" => Ok(PrivatePartnership), + "public_company" => Ok(PublicCompany), + "public_corporation" => Ok(PublicCorporation), + "public_partnership" => Ok(PublicPartnership), + "single_member_llc" => Ok(SingleMemberLlc), + "sole_establishment" => Ok(SoleEstablishment), + "sole_proprietorship" => Ok(SoleProprietorship), + "tax_exempt_government_instrumentality" => Ok(TaxExemptGovernmentInstrumentality), + "unincorporated_association" => Ok(UnincorporatedAssociation), + "unincorporated_non_profit" => Ok(UnincorporatedNonProfit), + "unincorporated_partnership" => Ok(UnincorporatedPartnership), + _ => Err(()), + } + } +} +impl AsRef for UpdateAccountCompanyStructure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateAccountCompanyStructure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateAccountCompanyStructure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateAccountCompanyStructure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information on the verification state of the company. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCompanyVerification<'a> { + /// A document verifying the business. + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> UpdateAccountCompanyVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A document verifying the business. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCompanyVerificationDocument<'a> { + /// The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> UpdateAccountCompanyVerificationDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Documents that may be submitted to satisfy various informational requests. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountDocuments<'a> { + /// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. + /// + /// Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_account_ownership_verification: + Option>, + /// One or more documents that demonstrate proof of a company's license to operate. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_license: Option>, + /// One or more documents showing the company's Memorandum of Association. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_memorandum_of_association: + Option>, + /// (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_ministerial_decree: Option>, + /// One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_registration_verification: + Option>, + /// One or more documents that demonstrate proof of a company's tax ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_tax_id_verification: Option>, + /// One or more documents showing the company’s proof of registration with the national business registry. + #[serde(skip_serializing_if = "Option::is_none")] + pub proof_of_registration: Option>, +} +impl<'a> UpdateAccountDocuments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. +/// +/// Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountDocumentsBankAccountOwnershipVerification<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> UpdateAccountDocumentsBankAccountOwnershipVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents that demonstrate proof of a company's license to operate. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountDocumentsCompanyLicense<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> UpdateAccountDocumentsCompanyLicense<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents showing the company's Memorandum of Association. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountDocumentsCompanyMemorandumOfAssociation<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> UpdateAccountDocumentsCompanyMemorandumOfAssociation<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountDocumentsCompanyMinisterialDecree<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> UpdateAccountDocumentsCompanyMinisterialDecree<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountDocumentsCompanyRegistrationVerification<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> UpdateAccountDocumentsCompanyRegistrationVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents that demonstrate proof of a company's tax ID. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountDocumentsCompanyTaxIdVerification<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> UpdateAccountDocumentsCompanyTaxIdVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents showing the company’s proof of registration with the national business registry. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountDocumentsProofOfRegistration<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> UpdateAccountDocumentsProofOfRegistration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about the person represented by the account. +/// +/// This field is null unless `business_type` is set to `individual`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountIndividual<'a> { + /// The individual's primary address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the the individual's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the the individual's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// The individual's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, + /// The individual's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// The individual's first name. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option<&'a str>, + /// The Kana variation of the the individual's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kana: Option<&'a str>, + /// The Kanji variation of the individual's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kanji: Option<&'a str>, + /// A list of alternate names or aliases that the individual is known by. + #[serde(skip_serializing_if = "Option::is_none")] + pub full_name_aliases: Option<&'a [&'a str]>, + /// The individual's gender (International regulations require either "male" or "female"). + #[serde(skip_serializing_if = "Option::is_none")] + pub gender: Option<&'a str>, + /// The government-issued ID number of the individual, as appropriate for the representative's country. + /// + /// (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). + /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option<&'a str>, + /// The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. + /// + /// In Thailand, this would be the laser code found on the back of an ID card. + /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number_secondary: Option<&'a str>, + /// The individual's last name. + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option<&'a str>, + /// The Kana variation of the individual's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kana: Option<&'a str>, + /// The Kanji variation of the individual's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kanji: Option<&'a str>, + /// The individual's maiden name. + #[serde(skip_serializing_if = "Option::is_none")] + pub maiden_name: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The individual's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + #[serde(skip_serializing_if = "Option::is_none")] + pub political_exposure: Option, + /// The individual's registered address. + #[serde(skip_serializing_if = "Option::is_none")] + pub registered_address: Option>, + /// The last four digits of the individual's Social Security Number (U.S. + /// + /// only). + #[serde(skip_serializing_if = "Option::is_none")] + pub ssn_last_4: Option<&'a str>, + /// The individual's verification document information. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> UpdateAccountIndividual<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The individual's primary address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountIndividualAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateAccountIndividualAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the the individual's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountIndividualAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> UpdateAccountIndividualAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the the individual's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountIndividualAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> UpdateAccountIndividualAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The individual's date of birth. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateAccountIndividualDob { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl UpdateAccountIndividualDob { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +/// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateAccountIndividualPoliticalExposure { + Existing, + None, +} +impl UpdateAccountIndividualPoliticalExposure { + pub fn as_str(self) -> &'static str { + use UpdateAccountIndividualPoliticalExposure::*; + match self { + Existing => "existing", + None => "none", + } + } +} + +impl std::str::FromStr for UpdateAccountIndividualPoliticalExposure { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateAccountIndividualPoliticalExposure::*; + match s { + "existing" => Ok(Existing), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdateAccountIndividualPoliticalExposure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateAccountIndividualPoliticalExposure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateAccountIndividualPoliticalExposure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateAccountIndividualPoliticalExposure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The individual's registered address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountIndividualRegisteredAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateAccountIndividualRegisteredAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The individual's verification document information. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountIndividualVerification<'a> { + /// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_document: Option>, + /// An identifying document, either a passport or local ID card. + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> UpdateAccountIndividualVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountIndividualVerificationAdditionalDocument<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> UpdateAccountIndividualVerificationAdditionalDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An identifying document, either a passport or local ID card. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountIndividualVerificationDocument<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> UpdateAccountIndividualVerificationDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Options for customizing how the account functions within Stripe. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountSettings<'a> { + /// Settings specific to Bacs Direct Debit payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit_payments: Option>, + /// Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. + #[serde(skip_serializing_if = "Option::is_none")] + pub branding: Option>, + /// Settings specific to the account's use of the Card Issuing product. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option>, + /// Settings specific to card charging on the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_payments: Option>, + /// Settings that apply across payment methods for charging on the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub payments: Option>, + /// Settings specific to the account's payouts. + #[serde(skip_serializing_if = "Option::is_none")] + pub payouts: Option>, + /// Settings specific to the account's Treasury FinancialAccounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option>, +} +impl<'a> UpdateAccountSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings specific to Bacs Direct Debit payments. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountSettingsBacsDebitPayments<'a> { + /// The Bacs Direct Debit Display Name for this account. + /// + /// For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. + /// Mobile banking apps display it as the name of the business. + /// To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. + /// Custom branding incurs an additional monthly fee for the platform. + /// If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_name: Option<&'a str>, +} +impl<'a> UpdateAccountSettingsBacsDebitPayments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountSettingsBranding<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. + /// + /// Must be square and at least 128px x 128px. + #[serde(skip_serializing_if = "Option::is_none")] + pub icon: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. + /// + /// Must be at least 128px x 128px. + #[serde(skip_serializing_if = "Option::is_none")] + pub logo: Option<&'a str>, + /// A CSS hex color value representing the primary branding color for this account. + #[serde(skip_serializing_if = "Option::is_none")] + pub primary_color: Option<&'a str>, + /// A CSS hex color value representing the secondary branding color for this account. + #[serde(skip_serializing_if = "Option::is_none")] + pub secondary_color: Option<&'a str>, +} +impl<'a> UpdateAccountSettingsBranding<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings specific to the account's use of the Card Issuing product. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountSettingsCardIssuing<'a> { + /// Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_acceptance: Option>, +} +impl<'a> UpdateAccountSettingsCardIssuing<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountSettingsCardIssuingTosAcceptance<'a> { + /// The Unix timestamp marking when the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> UpdateAccountSettingsCardIssuingTosAcceptance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings specific to card charging on the account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountSettingsCardPayments<'a> { + /// Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub decline_on: Option, + /// The default text that appears on credit card statements when a charge is made. + /// + /// This field prefixes any dynamic `statement_descriptor` specified on the charge. + /// `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_prefix: Option<&'a str>, + /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + /// + /// This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. + /// `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_prefix_kana: Option<&'a str>, + /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + /// + /// This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. + /// `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_prefix_kanji: Option<&'a str>, +} +impl<'a> UpdateAccountSettingsCardPayments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountSettingsCardPaymentsDeclineOn { + /// Whether Stripe automatically declines charges with an incorrect ZIP or postal code. + /// + /// This setting only applies when a ZIP or postal code is provided and they fail bank verification. + #[serde(skip_serializing_if = "Option::is_none")] + pub avs_failure: Option, + /// Whether Stripe automatically declines charges with an incorrect CVC. + /// + /// This setting only applies when a CVC is provided and it fails bank verification. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc_failure: Option, +} +impl UpdateAccountSettingsCardPaymentsDeclineOn { + pub fn new() -> Self { + Self::default() + } +} +/// Settings that apply across payment methods for charging on the account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountSettingsPayments<'a> { + /// The default text that appears on credit card statements when a charge is made. + /// + /// This field prefixes any dynamic `statement_descriptor` specified on the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_kana: Option<&'a str>, + /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_kanji: Option<&'a str>, +} +impl<'a> UpdateAccountSettingsPayments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings specific to the account's payouts. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountSettingsPayouts<'a> { + /// A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. + /// + /// For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). + #[serde(skip_serializing_if = "Option::is_none")] + pub debit_negative_balances: Option, + /// Details on when funds from charges are available, and when they are paid out to an external account. + /// + /// For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. + #[serde(skip_serializing_if = "Option::is_none")] + pub schedule: Option, + /// The text that appears on the bank account statement for payouts. + /// + /// If not set, this defaults to the platform's bank descriptor as set in the Dashboard. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, +} +impl<'a> UpdateAccountSettingsPayouts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on when funds from charges are available, and when they are paid out to an external account. +/// +/// For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountSettingsPayoutsSchedule { + /// The number of days charge funds are held before being paid out. + /// + /// May also be set to `minimum`, representing the lowest available value for the account country. + /// Default is `minimum`. + /// The `delay_days` parameter remains at the last configured value if `interval` is `manual`. + /// [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule). + #[serde(skip_serializing_if = "Option::is_none")] + pub delay_days: Option, + /// How frequently available funds are paid out. + /// + /// One of: `daily`, `manual`, `weekly`, or `monthly`. + /// Default is `daily`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval: Option, + /// The day of the month when available funds are paid out, specified as a number between 1--31. + /// + /// Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. + /// Required and applicable only if `interval` is `monthly`. + #[serde(skip_serializing_if = "Option::is_none")] + pub monthly_anchor: Option, + /// The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. + /// + /// (required and applicable only if `interval` is `weekly`.). + #[serde(skip_serializing_if = "Option::is_none")] + pub weekly_anchor: Option, +} +impl UpdateAccountSettingsPayoutsSchedule { + pub fn new() -> Self { + Self::default() + } +} +/// The number of days charge funds are held before being paid out. +/// +/// May also be set to `minimum`, representing the lowest available value for the account country. +/// Default is `minimum`. +/// The `delay_days` parameter remains at the last configured value if `interval` is `manual`. +/// [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule). +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateAccountSettingsPayoutsScheduleDelayDays { + Minimum, + U32(u32), +} +/// How frequently available funds are paid out. +/// +/// One of: `daily`, `manual`, `weekly`, or `monthly`. +/// Default is `daily`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateAccountSettingsPayoutsScheduleInterval { + Daily, + Manual, + Monthly, + Weekly, +} +impl UpdateAccountSettingsPayoutsScheduleInterval { + pub fn as_str(self) -> &'static str { + use UpdateAccountSettingsPayoutsScheduleInterval::*; + match self { + Daily => "daily", + Manual => "manual", + Monthly => "monthly", + Weekly => "weekly", + } + } +} + +impl std::str::FromStr for UpdateAccountSettingsPayoutsScheduleInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateAccountSettingsPayoutsScheduleInterval::*; + match s { + "daily" => Ok(Daily), + "manual" => Ok(Manual), + "monthly" => Ok(Monthly), + "weekly" => Ok(Weekly), + _ => Err(()), + } + } +} +impl AsRef for UpdateAccountSettingsPayoutsScheduleInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateAccountSettingsPayoutsScheduleInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateAccountSettingsPayoutsScheduleInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateAccountSettingsPayoutsScheduleInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. +/// +/// (required and applicable only if `interval` is `weekly`.). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateAccountSettingsPayoutsScheduleWeeklyAnchor { + Friday, + Monday, + Saturday, + Sunday, + Thursday, + Tuesday, + Wednesday, +} +impl UpdateAccountSettingsPayoutsScheduleWeeklyAnchor { + pub fn as_str(self) -> &'static str { + use UpdateAccountSettingsPayoutsScheduleWeeklyAnchor::*; + match self { + Friday => "friday", + Monday => "monday", + Saturday => "saturday", + Sunday => "sunday", + Thursday => "thursday", + Tuesday => "tuesday", + Wednesday => "wednesday", + } + } +} + +impl std::str::FromStr for UpdateAccountSettingsPayoutsScheduleWeeklyAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateAccountSettingsPayoutsScheduleWeeklyAnchor::*; + match s { + "friday" => Ok(Friday), + "monday" => Ok(Monday), + "saturday" => Ok(Saturday), + "sunday" => Ok(Sunday), + "thursday" => Ok(Thursday), + "tuesday" => Ok(Tuesday), + "wednesday" => Ok(Wednesday), + _ => Err(()), + } + } +} +impl AsRef for UpdateAccountSettingsPayoutsScheduleWeeklyAnchor { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateAccountSettingsPayoutsScheduleWeeklyAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateAccountSettingsPayoutsScheduleWeeklyAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateAccountSettingsPayoutsScheduleWeeklyAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Settings specific to the account's Treasury FinancialAccounts. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountSettingsTreasury<'a> { + /// Details on the account's acceptance of the Stripe Treasury Services Agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_acceptance: Option>, +} +impl<'a> UpdateAccountSettingsTreasury<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on the account's acceptance of the Stripe Treasury Services Agreement. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountSettingsTreasuryTosAcceptance<'a> { + /// The Unix timestamp marking when the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> UpdateAccountSettingsTreasuryTosAcceptance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountTosAcceptance<'a> { + /// The Unix timestamp marking when the account representative accepted their service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the account representative accepted their service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user's service agreement type. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_agreement: Option<&'a str>, + /// The user agent of the browser from which the account representative accepted their service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> UpdateAccountTosAcceptance<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateAccount<'a> { + /// Updates a [connected account](https://stripe.com/docs/connect/accounts) by setting the values of the parameters passed. + /// + /// Any parameters not provided are left unchanged. For Custom accounts, you can update any information on the account. + /// For other accounts, you can update all information until that account has started to go through Connect Onboarding. + /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) for a Standard or Express account, some parameters can no longer be changed. + /// These are marked as **Custom Only** or **Custom and Express** below. To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). + /// Refer to our [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + ) -> stripe::Response { + client.send_form(&format!("/accounts/{account}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListAccount<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListAccount<'a> { + /// Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). + /// + /// If you’re not a platform, the list is empty. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/accounts", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/accounts", self) + } +} +impl<'a> stripe::PaginationParams for ListAccount<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccount<'a> { + /// An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_token: Option<&'a str>, + /// Business information about the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub business_profile: Option>, + /// The business type. + #[serde(skip_serializing_if = "Option::is_none")] + pub business_type: Option, + /// Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. + /// + /// whether it has been requested or not). + /// Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. + /// An account may have some of its requested capabilities be active and some be inactive. + #[serde(skip_serializing_if = "Option::is_none")] + pub capabilities: Option, + /// Information about the company or business. + /// + /// This field is available for any `business_type`. + #[serde(skip_serializing_if = "Option::is_none")] + pub company: Option>, + /// The country in which the account holder resides, or in which the business is legally established. + /// + /// This should be an ISO 3166-1 alpha-2 country code. + /// For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. + /// Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported. + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Three-letter ISO currency code representing the default currency for the account. + /// + /// This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). + #[serde(skip_serializing_if = "Option::is_none")] + pub default_currency: Option, + /// Documents that may be submitted to satisfy various informational requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub documents: Option>, + /// The email address of the account holder. + /// + /// This is only to make the account easier to identify to you. + /// Stripe only emails Custom accounts with your consent. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won’t be able to use it for top-ups). + /// + /// You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. + /// By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. + /// To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub external_account: Option<&'a str>, + /// Information about the person represented by the account. + /// + /// This field is null unless `business_type` is set to `individual`. + #[serde(skip_serializing_if = "Option::is_none")] + pub individual: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Options for customizing how the account functions within Stripe. + #[serde(skip_serializing_if = "Option::is_none")] + pub settings: Option>, + /// Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_acceptance: Option>, + /// The type of Stripe account to create. + /// + /// May be one of `custom`, `express` or `standard`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> CreateAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Business information about the account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountBusinessProfile<'a> { + /// [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). + /// + /// MCCs are used to classify businesses based on the goods or services they provide. + #[serde(skip_serializing_if = "Option::is_none")] + pub mcc: Option<&'a str>, + /// An estimate of the monthly revenue of the business. + /// + /// Only accepted for accounts in Brazil and India. + #[serde(skip_serializing_if = "Option::is_none")] + pub monthly_estimated_revenue: Option, + /// The customer-facing business name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Internal-only description of the product sold by, or service provided by, the business. + /// + /// Used by Stripe for risk and underwriting purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// A publicly available mailing address for sending support issues to. + #[serde(skip_serializing_if = "Option::is_none")] + pub support_address: Option>, + /// A publicly available email address for sending support issues to. + #[serde(skip_serializing_if = "Option::is_none")] + pub support_email: Option<&'a str>, + /// A publicly available phone number to call with support issues. + #[serde(skip_serializing_if = "Option::is_none")] + pub support_phone: Option<&'a str>, + /// A publicly available website for handling support issues. + #[serde(skip_serializing_if = "Option::is_none")] + pub support_url: Option<&'a str>, + /// The business's publicly available website. + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option<&'a str>, +} +impl<'a> CreateAccountBusinessProfile<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An estimate of the monthly revenue of the business. +/// +/// Only accepted for accounts in Brazil and India. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateAccountBusinessProfileMonthlyEstimatedRevenue { + /// A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, +} +impl CreateAccountBusinessProfileMonthlyEstimatedRevenue { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { amount, currency } + } +} +/// A publicly available mailing address for sending support issues to. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountBusinessProfileSupportAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateAccountBusinessProfileSupportAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The business type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateAccountBusinessType { + Company, + GovernmentEntity, + Individual, + NonProfit, +} +impl CreateAccountBusinessType { + pub fn as_str(self) -> &'static str { + use CreateAccountBusinessType::*; + match self { + Company => "company", + GovernmentEntity => "government_entity", + Individual => "individual", + NonProfit => "non_profit", + } + } +} + +impl std::str::FromStr for CreateAccountBusinessType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateAccountBusinessType::*; + match s { + "company" => Ok(Company), + "government_entity" => Ok(GovernmentEntity), + "individual" => Ok(Individual), + "non_profit" => Ok(NonProfit), + _ => Err(()), + } + } +} +impl AsRef for CreateAccountBusinessType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateAccountBusinessType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateAccountBusinessType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateAccountBusinessType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. +/// +/// whether it has been requested or not). +/// Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. +/// An account may have some of its requested capabilities be active and some be inactive. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilities { + /// The acss_debit_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit_payments: Option, + /// The affirm_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm_payments: Option, + /// The afterpay_clearpay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay_payments: Option, + /// The au_becs_debit_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit_payments: Option, + /// The bacs_debit_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit_payments: Option, + /// The bancontact_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact_payments: Option, + /// The bank_transfer_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer_payments: Option, + /// The blik_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik_payments: Option, + /// The boleto_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto_payments: Option, + /// The card_issuing capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option, + /// The card_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_payments: Option, + /// The cartes_bancaires_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub cartes_bancaires_payments: Option, + /// The cashapp_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp_payments: Option, + /// The eps_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps_payments: Option, + /// The fpx_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx_payments: Option, + /// The giropay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay_payments: Option, + /// The grabpay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay_payments: Option, + /// The ideal_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal_payments: Option, + /// The india_international_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub india_international_payments: Option, + /// The jcb_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub jcb_payments: Option, + /// The klarna_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna_payments: Option, + /// The konbini_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini_payments: Option, + /// The legacy_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub legacy_payments: Option, + /// The link_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub link_payments: Option, + /// The oxxo_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo_payments: Option, + /// The p24_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24_payments: Option, + /// The paynow_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow_payments: Option, + /// The promptpay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay_payments: Option, + /// The revolut_pay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay_payments: Option, + /// The sepa_debit_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit_payments: Option, + /// The sofort_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort_payments: Option, + /// The tax_reporting_us_1099_k capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_reporting_us_1099_k: Option, + /// The tax_reporting_us_1099_misc capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_reporting_us_1099_misc: Option, + /// The transfers capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfers: Option, + /// The treasury capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option, + /// The us_bank_account_ach_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account_ach_payments: Option, + /// The zip_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip_payments: Option, +} +impl CreateAccountCapabilities { + pub fn new() -> Self { + Self::default() + } +} +/// The acss_debit_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesAcssDebitPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesAcssDebitPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The affirm_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesAffirmPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesAffirmPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The afterpay_clearpay_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesAfterpayClearpayPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesAfterpayClearpayPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The au_becs_debit_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesAuBecsDebitPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesAuBecsDebitPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The bacs_debit_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesBacsDebitPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesBacsDebitPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The bancontact_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesBancontactPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesBancontactPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The bank_transfer_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesBankTransferPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesBankTransferPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The blik_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesBlikPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesBlikPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The boleto_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesBoletoPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesBoletoPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The card_issuing capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesCardIssuing { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesCardIssuing { + pub fn new() -> Self { + Self::default() + } +} +/// The card_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesCardPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesCardPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The cartes_bancaires_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesCartesBancairesPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesCartesBancairesPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The cashapp_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesCashappPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesCashappPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The eps_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesEpsPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesEpsPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The fpx_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesFpxPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesFpxPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The giropay_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesGiropayPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesGiropayPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The grabpay_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesGrabpayPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesGrabpayPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The ideal_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesIdealPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesIdealPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The india_international_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesIndiaInternationalPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesIndiaInternationalPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The jcb_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesJcbPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesJcbPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The klarna_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesKlarnaPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesKlarnaPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The konbini_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesKonbiniPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesKonbiniPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The legacy_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesLegacyPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesLegacyPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The link_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesLinkPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesLinkPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The oxxo_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesOxxoPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesOxxoPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The p24_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesP24Payments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesP24Payments { + pub fn new() -> Self { + Self::default() + } +} +/// The paynow_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesPaynowPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesPaynowPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The promptpay_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesPromptpayPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesPromptpayPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The revolut_pay_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesRevolutPayPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesRevolutPayPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The sepa_debit_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesSepaDebitPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesSepaDebitPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The sofort_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesSofortPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesSofortPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The tax_reporting_us_1099_k capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesTaxReportingUs1099K { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesTaxReportingUs1099K { + pub fn new() -> Self { + Self::default() + } +} +/// The tax_reporting_us_1099_misc capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesTaxReportingUs1099Misc { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesTaxReportingUs1099Misc { + pub fn new() -> Self { + Self::default() + } +} +/// The transfers capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesTransfers { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesTransfers { + pub fn new() -> Self { + Self::default() + } +} +/// The treasury capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesTreasury { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesTreasury { + pub fn new() -> Self { + Self::default() + } +} +/// The us_bank_account_ach_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesUsBankAccountAchPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesUsBankAccountAchPayments { + pub fn new() -> Self { + Self::default() + } +} +/// The zip_payments capability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCapabilitiesZipPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CreateAccountCapabilitiesZipPayments { + pub fn new() -> Self { + Self::default() + } +} +/// Information about the company or business. +/// +/// This field is available for any `business_type`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCompany<'a> { + /// The company's primary address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the company's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the company's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// Whether the company's directors have been provided. + /// + /// Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. + /// This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub directors_provided: Option, + /// Whether the company's executives have been provided. + /// + /// Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. + #[serde(skip_serializing_if = "Option::is_none")] + pub executives_provided: Option, + /// The export license ID number of the company, also referred as Import Export Code (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_license_id: Option<&'a str>, + /// The purpose code to use for export transactions (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_purpose_code: Option<&'a str>, + /// The company's legal name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// The Kana variation of the company's legal name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub name_kana: Option<&'a str>, + /// The Kanji variation of the company's legal name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub name_kanji: Option<&'a str>, + /// Whether the company's owners have been provided. + /// + /// Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. + #[serde(skip_serializing_if = "Option::is_none")] + pub owners_provided: Option, + /// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. + #[serde(skip_serializing_if = "Option::is_none")] + pub ownership_declaration: Option>, + /// The company's phone number (used for verification). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. + /// + /// (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). + #[serde(skip_serializing_if = "Option::is_none")] + pub registration_number: Option<&'a str>, + /// The category identifying the legal structure of the company or legal entity. + /// + /// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub structure: Option, + /// The business ID number of the company, as appropriate for the company’s country. + /// + /// (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.). + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id: Option<&'a str>, + /// The jurisdiction in which the `tax_id` is registered (Germany-based companies only). + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_registrar: Option<&'a str>, + /// The VAT number of the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub vat_id: Option<&'a str>, + /// Information on the verification state of the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> CreateAccountCompany<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The company's primary address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCompanyAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateAccountCompanyAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the company's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCompanyAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateAccountCompanyAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the company's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCompanyAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateAccountCompanyAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCompanyOwnershipDeclaration<'a> { + /// The Unix timestamp marking when the beneficial owner attestation was made. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the beneficial owner attestation was made. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the beneficial owner attestation was made. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> CreateAccountCompanyOwnershipDeclaration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The category identifying the legal structure of the company or legal entity. +/// +/// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateAccountCompanyStructure { + FreeZoneEstablishment, + FreeZoneLlc, + GovernmentInstrumentality, + GovernmentalUnit, + IncorporatedNonProfit, + IncorporatedPartnership, + LimitedLiabilityPartnership, + Llc, + MultiMemberLlc, + PrivateCompany, + PrivateCorporation, + PrivatePartnership, + PublicCompany, + PublicCorporation, + PublicPartnership, + SingleMemberLlc, + SoleEstablishment, + SoleProprietorship, + TaxExemptGovernmentInstrumentality, + UnincorporatedAssociation, + UnincorporatedNonProfit, + UnincorporatedPartnership, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateAccountCompanyStructure { + pub fn as_str(self) -> &'static str { + use CreateAccountCompanyStructure::*; + match self { + FreeZoneEstablishment => "free_zone_establishment", + FreeZoneLlc => "free_zone_llc", + GovernmentInstrumentality => "government_instrumentality", + GovernmentalUnit => "governmental_unit", + IncorporatedNonProfit => "incorporated_non_profit", + IncorporatedPartnership => "incorporated_partnership", + LimitedLiabilityPartnership => "limited_liability_partnership", + Llc => "llc", + MultiMemberLlc => "multi_member_llc", + PrivateCompany => "private_company", + PrivateCorporation => "private_corporation", + PrivatePartnership => "private_partnership", + PublicCompany => "public_company", + PublicCorporation => "public_corporation", + PublicPartnership => "public_partnership", + SingleMemberLlc => "single_member_llc", + SoleEstablishment => "sole_establishment", + SoleProprietorship => "sole_proprietorship", + TaxExemptGovernmentInstrumentality => "tax_exempt_government_instrumentality", + UnincorporatedAssociation => "unincorporated_association", + UnincorporatedNonProfit => "unincorporated_non_profit", + UnincorporatedPartnership => "unincorporated_partnership", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateAccountCompanyStructure { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateAccountCompanyStructure::*; + match s { + "free_zone_establishment" => Ok(FreeZoneEstablishment), + "free_zone_llc" => Ok(FreeZoneLlc), + "government_instrumentality" => Ok(GovernmentInstrumentality), + "governmental_unit" => Ok(GovernmentalUnit), + "incorporated_non_profit" => Ok(IncorporatedNonProfit), + "incorporated_partnership" => Ok(IncorporatedPartnership), + "limited_liability_partnership" => Ok(LimitedLiabilityPartnership), + "llc" => Ok(Llc), + "multi_member_llc" => Ok(MultiMemberLlc), + "private_company" => Ok(PrivateCompany), + "private_corporation" => Ok(PrivateCorporation), + "private_partnership" => Ok(PrivatePartnership), + "public_company" => Ok(PublicCompany), + "public_corporation" => Ok(PublicCorporation), + "public_partnership" => Ok(PublicPartnership), + "single_member_llc" => Ok(SingleMemberLlc), + "sole_establishment" => Ok(SoleEstablishment), + "sole_proprietorship" => Ok(SoleProprietorship), + "tax_exempt_government_instrumentality" => Ok(TaxExemptGovernmentInstrumentality), + "unincorporated_association" => Ok(UnincorporatedAssociation), + "unincorporated_non_profit" => Ok(UnincorporatedNonProfit), + "unincorporated_partnership" => Ok(UnincorporatedPartnership), + _ => Err(()), + } + } +} +impl AsRef for CreateAccountCompanyStructure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateAccountCompanyStructure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateAccountCompanyStructure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateAccountCompanyStructure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information on the verification state of the company. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCompanyVerification<'a> { + /// A document verifying the business. + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> CreateAccountCompanyVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A document verifying the business. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCompanyVerificationDocument<'a> { + /// The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> CreateAccountCompanyVerificationDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Documents that may be submitted to satisfy various informational requests. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountDocuments<'a> { + /// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. + /// + /// Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_account_ownership_verification: + Option>, + /// One or more documents that demonstrate proof of a company's license to operate. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_license: Option>, + /// One or more documents showing the company's Memorandum of Association. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_memorandum_of_association: + Option>, + /// (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_ministerial_decree: Option>, + /// One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_registration_verification: + Option>, + /// One or more documents that demonstrate proof of a company's tax ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_tax_id_verification: Option>, + /// One or more documents showing the company’s proof of registration with the national business registry. + #[serde(skip_serializing_if = "Option::is_none")] + pub proof_of_registration: Option>, +} +impl<'a> CreateAccountDocuments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. +/// +/// Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountDocumentsBankAccountOwnershipVerification<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> CreateAccountDocumentsBankAccountOwnershipVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents that demonstrate proof of a company's license to operate. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountDocumentsCompanyLicense<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> CreateAccountDocumentsCompanyLicense<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents showing the company's Memorandum of Association. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountDocumentsCompanyMemorandumOfAssociation<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> CreateAccountDocumentsCompanyMemorandumOfAssociation<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountDocumentsCompanyMinisterialDecree<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> CreateAccountDocumentsCompanyMinisterialDecree<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountDocumentsCompanyRegistrationVerification<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> CreateAccountDocumentsCompanyRegistrationVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents that demonstrate proof of a company's tax ID. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountDocumentsCompanyTaxIdVerification<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> CreateAccountDocumentsCompanyTaxIdVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents showing the company’s proof of registration with the national business registry. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountDocumentsProofOfRegistration<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> CreateAccountDocumentsProofOfRegistration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about the person represented by the account. +/// +/// This field is null unless `business_type` is set to `individual`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountIndividual<'a> { + /// The individual's primary address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the the individual's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the the individual's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// The individual's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, + /// The individual's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// The individual's first name. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option<&'a str>, + /// The Kana variation of the the individual's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kana: Option<&'a str>, + /// The Kanji variation of the individual's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kanji: Option<&'a str>, + /// A list of alternate names or aliases that the individual is known by. + #[serde(skip_serializing_if = "Option::is_none")] + pub full_name_aliases: Option<&'a [&'a str]>, + /// The individual's gender (International regulations require either "male" or "female"). + #[serde(skip_serializing_if = "Option::is_none")] + pub gender: Option<&'a str>, + /// The government-issued ID number of the individual, as appropriate for the representative's country. + /// + /// (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). + /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option<&'a str>, + /// The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. + /// + /// In Thailand, this would be the laser code found on the back of an ID card. + /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number_secondary: Option<&'a str>, + /// The individual's last name. + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option<&'a str>, + /// The Kana variation of the individual's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kana: Option<&'a str>, + /// The Kanji variation of the individual's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kanji: Option<&'a str>, + /// The individual's maiden name. + #[serde(skip_serializing_if = "Option::is_none")] + pub maiden_name: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The individual's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + #[serde(skip_serializing_if = "Option::is_none")] + pub political_exposure: Option, + /// The individual's registered address. + #[serde(skip_serializing_if = "Option::is_none")] + pub registered_address: Option>, + /// The last four digits of the individual's Social Security Number (U.S. + /// + /// only). + #[serde(skip_serializing_if = "Option::is_none")] + pub ssn_last_4: Option<&'a str>, + /// The individual's verification document information. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> CreateAccountIndividual<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The individual's primary address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountIndividualAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateAccountIndividualAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the the individual's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountIndividualAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateAccountIndividualAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the the individual's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountIndividualAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateAccountIndividualAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The individual's date of birth. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateAccountIndividualDob { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl CreateAccountIndividualDob { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +/// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateAccountIndividualPoliticalExposure { + Existing, + None, +} +impl CreateAccountIndividualPoliticalExposure { + pub fn as_str(self) -> &'static str { + use CreateAccountIndividualPoliticalExposure::*; + match self { + Existing => "existing", + None => "none", + } + } +} + +impl std::str::FromStr for CreateAccountIndividualPoliticalExposure { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateAccountIndividualPoliticalExposure::*; + match s { + "existing" => Ok(Existing), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateAccountIndividualPoliticalExposure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateAccountIndividualPoliticalExposure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateAccountIndividualPoliticalExposure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateAccountIndividualPoliticalExposure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The individual's registered address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountIndividualRegisteredAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateAccountIndividualRegisteredAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The individual's verification document information. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountIndividualVerification<'a> { + /// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_document: Option>, + /// An identifying document, either a passport or local ID card. + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> CreateAccountIndividualVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountIndividualVerificationAdditionalDocument<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> CreateAccountIndividualVerificationAdditionalDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An identifying document, either a passport or local ID card. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountIndividualVerificationDocument<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> CreateAccountIndividualVerificationDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Options for customizing how the account functions within Stripe. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountSettings<'a> { + /// Settings specific to Bacs Direct Debit. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit_payments: Option>, + /// Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. + #[serde(skip_serializing_if = "Option::is_none")] + pub branding: Option>, + /// Settings specific to the account's use of the Card Issuing product. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option>, + /// Settings specific to card charging on the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_payments: Option>, + /// Settings that apply across payment methods for charging on the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub payments: Option>, + /// Settings specific to the account's payouts. + #[serde(skip_serializing_if = "Option::is_none")] + pub payouts: Option>, + /// Settings specific to the account's Treasury FinancialAccounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option>, +} +impl<'a> CreateAccountSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings specific to Bacs Direct Debit. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountSettingsBacsDebitPayments<'a> { + /// The Bacs Direct Debit Display Name for this account. + /// + /// For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. + /// Mobile banking apps display it as the name of the business. + /// To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. + /// Custom branding incurs an additional monthly fee for the platform. + /// If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_name: Option<&'a str>, +} +impl<'a> CreateAccountSettingsBacsDebitPayments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountSettingsBranding<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. + /// + /// Must be square and at least 128px x 128px. + #[serde(skip_serializing_if = "Option::is_none")] + pub icon: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. + /// + /// Must be at least 128px x 128px. + #[serde(skip_serializing_if = "Option::is_none")] + pub logo: Option<&'a str>, + /// A CSS hex color value representing the primary branding color for this account. + #[serde(skip_serializing_if = "Option::is_none")] + pub primary_color: Option<&'a str>, + /// A CSS hex color value representing the secondary branding color for this account. + #[serde(skip_serializing_if = "Option::is_none")] + pub secondary_color: Option<&'a str>, +} +impl<'a> CreateAccountSettingsBranding<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings specific to the account's use of the Card Issuing product. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountSettingsCardIssuing<'a> { + /// Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_acceptance: Option>, +} +impl<'a> CreateAccountSettingsCardIssuing<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountSettingsCardIssuingTosAcceptance<'a> { + /// The Unix timestamp marking when the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> CreateAccountSettingsCardIssuingTosAcceptance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings specific to card charging on the account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountSettingsCardPayments<'a> { + /// Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub decline_on: Option, + /// The default text that appears on credit card statements when a charge is made. + /// + /// This field prefixes any dynamic `statement_descriptor` specified on the charge. + /// `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_prefix: Option<&'a str>, + /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + /// + /// This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. + /// `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_prefix_kana: Option<&'a str>, + /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + /// + /// This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. + /// `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_prefix_kanji: Option<&'a str>, +} +impl<'a> CreateAccountSettingsCardPayments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountSettingsCardPaymentsDeclineOn { + /// Whether Stripe automatically declines charges with an incorrect ZIP or postal code. + /// + /// This setting only applies when a ZIP or postal code is provided and they fail bank verification. + #[serde(skip_serializing_if = "Option::is_none")] + pub avs_failure: Option, + /// Whether Stripe automatically declines charges with an incorrect CVC. + /// + /// This setting only applies when a CVC is provided and it fails bank verification. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc_failure: Option, +} +impl CreateAccountSettingsCardPaymentsDeclineOn { + pub fn new() -> Self { + Self::default() + } +} +/// Settings that apply across payment methods for charging on the account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountSettingsPayments<'a> { + /// The default text that appears on credit card statements when a charge is made. + /// + /// This field prefixes any dynamic `statement_descriptor` specified on the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_kana: Option<&'a str>, + /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_kanji: Option<&'a str>, +} +impl<'a> CreateAccountSettingsPayments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings specific to the account's payouts. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountSettingsPayouts<'a> { + /// A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. + /// + /// For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). + #[serde(skip_serializing_if = "Option::is_none")] + pub debit_negative_balances: Option, + /// Details on when funds from charges are available, and when they are paid out to an external account. + /// + /// For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. + #[serde(skip_serializing_if = "Option::is_none")] + pub schedule: Option, + /// The text that appears on the bank account statement for payouts. + /// + /// If not set, this defaults to the platform's bank descriptor as set in the Dashboard. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, +} +impl<'a> CreateAccountSettingsPayouts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on when funds from charges are available, and when they are paid out to an external account. +/// +/// For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountSettingsPayoutsSchedule { + /// The number of days charge funds are held before being paid out. + /// + /// May also be set to `minimum`, representing the lowest available value for the account country. + /// Default is `minimum`. + /// The `delay_days` parameter remains at the last configured value if `interval` is `manual`. + /// [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule). + #[serde(skip_serializing_if = "Option::is_none")] + pub delay_days: Option, + /// How frequently available funds are paid out. + /// + /// One of: `daily`, `manual`, `weekly`, or `monthly`. + /// Default is `daily`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval: Option, + /// The day of the month when available funds are paid out, specified as a number between 1--31. + /// + /// Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. + /// Required and applicable only if `interval` is `monthly`. + #[serde(skip_serializing_if = "Option::is_none")] + pub monthly_anchor: Option, + /// The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. + /// + /// (required and applicable only if `interval` is `weekly`.). + #[serde(skip_serializing_if = "Option::is_none")] + pub weekly_anchor: Option, +} +impl CreateAccountSettingsPayoutsSchedule { + pub fn new() -> Self { + Self::default() + } +} +/// The number of days charge funds are held before being paid out. +/// +/// May also be set to `minimum`, representing the lowest available value for the account country. +/// Default is `minimum`. +/// The `delay_days` parameter remains at the last configured value if `interval` is `manual`. +/// [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule). +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreateAccountSettingsPayoutsScheduleDelayDays { + Minimum, + U32(u32), +} +/// How frequently available funds are paid out. +/// +/// One of: `daily`, `manual`, `weekly`, or `monthly`. +/// Default is `daily`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateAccountSettingsPayoutsScheduleInterval { + Daily, + Manual, + Monthly, + Weekly, +} +impl CreateAccountSettingsPayoutsScheduleInterval { + pub fn as_str(self) -> &'static str { + use CreateAccountSettingsPayoutsScheduleInterval::*; + match self { + Daily => "daily", + Manual => "manual", + Monthly => "monthly", + Weekly => "weekly", + } + } +} + +impl std::str::FromStr for CreateAccountSettingsPayoutsScheduleInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateAccountSettingsPayoutsScheduleInterval::*; + match s { + "daily" => Ok(Daily), + "manual" => Ok(Manual), + "monthly" => Ok(Monthly), + "weekly" => Ok(Weekly), + _ => Err(()), + } + } +} +impl AsRef for CreateAccountSettingsPayoutsScheduleInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateAccountSettingsPayoutsScheduleInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateAccountSettingsPayoutsScheduleInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateAccountSettingsPayoutsScheduleInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. +/// +/// (required and applicable only if `interval` is `weekly`.). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateAccountSettingsPayoutsScheduleWeeklyAnchor { + Friday, + Monday, + Saturday, + Sunday, + Thursday, + Tuesday, + Wednesday, +} +impl CreateAccountSettingsPayoutsScheduleWeeklyAnchor { + pub fn as_str(self) -> &'static str { + use CreateAccountSettingsPayoutsScheduleWeeklyAnchor::*; + match self { + Friday => "friday", + Monday => "monday", + Saturday => "saturday", + Sunday => "sunday", + Thursday => "thursday", + Tuesday => "tuesday", + Wednesday => "wednesday", + } + } +} + +impl std::str::FromStr for CreateAccountSettingsPayoutsScheduleWeeklyAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateAccountSettingsPayoutsScheduleWeeklyAnchor::*; + match s { + "friday" => Ok(Friday), + "monday" => Ok(Monday), + "saturday" => Ok(Saturday), + "sunday" => Ok(Sunday), + "thursday" => Ok(Thursday), + "tuesday" => Ok(Tuesday), + "wednesday" => Ok(Wednesday), + _ => Err(()), + } + } +} +impl AsRef for CreateAccountSettingsPayoutsScheduleWeeklyAnchor { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateAccountSettingsPayoutsScheduleWeeklyAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateAccountSettingsPayoutsScheduleWeeklyAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateAccountSettingsPayoutsScheduleWeeklyAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Settings specific to the account's Treasury FinancialAccounts. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountSettingsTreasury<'a> { + /// Details on the account's acceptance of the Stripe Treasury Services Agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_acceptance: Option>, +} +impl<'a> CreateAccountSettingsTreasury<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on the account's acceptance of the Stripe Treasury Services Agreement. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountSettingsTreasuryTosAcceptance<'a> { + /// The Unix timestamp marking when the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> CreateAccountSettingsTreasuryTosAcceptance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountTosAcceptance<'a> { + /// The Unix timestamp marking when the account representative accepted their service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the account representative accepted their service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user's service agreement type. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_agreement: Option<&'a str>, + /// The user agent of the browser from which the account representative accepted their service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> CreateAccountTosAcceptance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of Stripe account to create. +/// +/// May be one of `custom`, `express` or `standard`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateAccountType { + Custom, + Express, + Standard, +} +impl CreateAccountType { + pub fn as_str(self) -> &'static str { + use CreateAccountType::*; + match self { + Custom => "custom", + Express => "express", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateAccountType::*; + match s { + "custom" => Ok(Custom), + "express" => Ok(Express), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateAccount<'a> { + /// With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. + /// To do this, you’ll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). + /// + /// If you’ve already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when + /// creating the account. + /// + /// Connect Onboarding won’t ask for the prefilled information during account onboarding. You can prefill any information on the account. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/accounts", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteAccount {} +impl DeleteAccount { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteAccount { + /// With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + /// + /// Accounts created using test-mode keys can be deleted at any time. + /// + /// Standard accounts created using live-mode keys cannot be deleted. + /// Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + ) -> stripe::Response { + client.send_form(&format!("/accounts/{account}"), self, http_types::Method::Delete) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct RejectAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The reason for rejecting the account. + /// + /// Can be `fraud`, `terms_of_service`, or `other`. + pub reason: &'a str, +} +impl<'a> RejectAccount<'a> { + pub fn new(reason: &'a str) -> Self { + Self { expand: Default::default(), reason } + } +} +impl<'a> RejectAccount<'a> { + /// With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + /// + /// Test-mode Custom and Express accounts can be rejected at any time. + /// + /// Accounts created using live-mode keys may only be rejected once all balances are zero. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + ) -> stripe::Response { + client.send_form(&format!("/accounts/{account}/reject"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PersonsAccount<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Filters on the list of people returned based on the person's relationship to the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub relationship: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> PersonsAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Filters on the list of people returned based on the person's relationship to the account's company. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PersonsAccountRelationship { + /// A filter on the list of people returned based on whether these people are directors of the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub director: Option, + /// A filter on the list of people returned based on whether these people are executives of the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub executive: Option, + /// A filter on the list of people returned based on whether these people are legal guardians of the account's representative. + #[serde(skip_serializing_if = "Option::is_none")] + pub legal_guardian: Option, + /// A filter on the list of people returned based on whether these people are owners of the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option, + /// A filter on the list of people returned based on whether these people are the representative of the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub representative: Option, +} +impl PersonsAccountRelationship { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> PersonsAccount<'a> { + /// Returns a list of people associated with the account’s legal entity. + /// + /// The people are returned sorted by creation date, with the most recent people appearing first. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + ) -> stripe::Response> { + client.get_query(&format!("/accounts/{account}/persons"), self) + } + pub fn paginate( + self, + account: &stripe_types::account::AccountId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params(&format!("/accounts/{account}/persons"), self) + } +} +impl<'a> stripe::PaginationParams for PersonsAccount<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CapabilitiesAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CapabilitiesAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CapabilitiesAccount<'a> { + /// Returns a list of capabilities associated with the account. + /// + /// The capabilities are returned sorted by creation date, with the most recent capability appearing first. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + ) -> stripe::Response> { + client.get_query(&format!("/accounts/{account}/capabilities"), self) + } + pub fn paginate( + self, + account: &stripe_types::account::AccountId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params(&format!("/accounts/{account}/capabilities"), self) + } +} +impl<'a> stripe::PaginationParams for CapabilitiesAccount<'a> {} diff --git a/generated/stripe_connect/src/account_bacs_debit_payments_settings/mod.rs b/generated/stripe_connect/src/account_bacs_debit_payments_settings/mod.rs new file mode 100644 index 000000000..6dc292b53 --- /dev/null +++ b/generated/stripe_connect/src/account_bacs_debit_payments_settings/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_bacs_debit_payments_settings::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_branding_settings/mod.rs b/generated/stripe_connect/src/account_branding_settings/mod.rs new file mode 100644 index 000000000..22fce0ee7 --- /dev/null +++ b/generated/stripe_connect/src/account_branding_settings/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_branding_settings::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_business_profile/mod.rs b/generated/stripe_connect/src/account_business_profile/mod.rs new file mode 100644 index 000000000..bfb2c0859 --- /dev/null +++ b/generated/stripe_connect/src/account_business_profile/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_business_profile::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_capabilities/mod.rs b/generated/stripe_connect/src/account_capabilities/mod.rs new file mode 100644 index 000000000..300eb604f --- /dev/null +++ b/generated/stripe_connect/src/account_capabilities/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_capabilities::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_capability/mod.rs b/generated/stripe_connect/src/account_capability/mod.rs new file mode 100644 index 000000000..0363c0878 --- /dev/null +++ b/generated/stripe_connect/src/account_capability/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::account_capability::*; +#[cfg(feature = "account_capability")] +mod requests; +#[cfg(feature = "account_capability")] +pub use requests::*; diff --git a/generated/stripe_connect/src/account_capability/requests.rs b/generated/stripe_connect/src/account_capability/requests.rs new file mode 100644 index 000000000..e14fc1d34 --- /dev/null +++ b/generated/stripe_connect/src/account_capability/requests.rs @@ -0,0 +1,88 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListAccountCapability<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ListAccountCapability<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListAccountCapability<'a> { + /// Returns a list of capabilities associated with the account. + /// + /// The capabilities are returned sorted by creation date, with the most recent capability appearing first. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + ) -> stripe::Response> { + client.get_query(&format!("/accounts/{account}/capabilities"), self) + } + pub fn paginate( + self, + account: &stripe_types::account::AccountId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params(&format!("/accounts/{account}/capabilities"), self) + } +} +impl<'a> stripe::PaginationParams for ListAccountCapability<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveAccountCapability<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveAccountCapability<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveAccountCapability<'a> { + /// Retrieves information about the specified Account Capability. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + capability: &stripe_types::account_capability::CapabilityId, + ) -> stripe::Response { + client.get_query(&format!("/accounts/{account}/capabilities/{capability}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCapability<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// To request a new capability for an account, pass true. + /// + /// There can be a delay before the requested capability becomes active. + /// If the capability has any activation requirements, the response includes them in the `requirements` arrays. If a capability isn't permanent, you can remove it from the account by passing false. + /// Most capabilities are permanent after they've been requested. + /// Attempting to remove a permanent capability returns an error. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl<'a> UpdateAccountCapability<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateAccountCapability<'a> { + /// Updates an existing Account Capability. + /// + /// Request or remove a capability by updating its `requested` parameter. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + capability: &stripe_types::account_capability::CapabilityId, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/capabilities/{capability}"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_connect/src/account_capability_future_requirements/mod.rs b/generated/stripe_connect/src/account_capability_future_requirements/mod.rs new file mode 100644 index 000000000..7504c9775 --- /dev/null +++ b/generated/stripe_connect/src/account_capability_future_requirements/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_capability_future_requirements::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_capability_requirements/mod.rs b/generated/stripe_connect/src/account_capability_requirements/mod.rs new file mode 100644 index 000000000..5d6c5f0ca --- /dev/null +++ b/generated/stripe_connect/src/account_capability_requirements/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_capability_requirements::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_card_issuing_settings/mod.rs b/generated/stripe_connect/src/account_card_issuing_settings/mod.rs new file mode 100644 index 000000000..269e3f632 --- /dev/null +++ b/generated/stripe_connect/src/account_card_issuing_settings/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_card_issuing_settings::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_card_payments_settings/mod.rs b/generated/stripe_connect/src/account_card_payments_settings/mod.rs new file mode 100644 index 000000000..4feeca6a9 --- /dev/null +++ b/generated/stripe_connect/src/account_card_payments_settings/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_card_payments_settings::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_dashboard_settings/mod.rs b/generated/stripe_connect/src/account_dashboard_settings/mod.rs new file mode 100644 index 000000000..697cd0856 --- /dev/null +++ b/generated/stripe_connect/src/account_dashboard_settings/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_dashboard_settings::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_decline_charge_on/mod.rs b/generated/stripe_connect/src/account_decline_charge_on/mod.rs new file mode 100644 index 000000000..3dc331065 --- /dev/null +++ b/generated/stripe_connect/src/account_decline_charge_on/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_decline_charge_on::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_future_requirements/mod.rs b/generated/stripe_connect/src/account_future_requirements/mod.rs new file mode 100644 index 000000000..0cf963df0 --- /dev/null +++ b/generated/stripe_connect/src/account_future_requirements/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_future_requirements::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_link/mod.rs b/generated/stripe_connect/src/account_link/mod.rs new file mode 100644 index 000000000..ce211e565 --- /dev/null +++ b/generated/stripe_connect/src/account_link/mod.rs @@ -0,0 +1,21 @@ +/// Account Links are the means by which a Connect platform grants a connected account permission to access +/// Stripe-hosted applications, such as Connect Onboarding. +/// +/// Related guide: [Connect Onboarding](https://stripe.com/docs/connect/custom/hosted-onboarding) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountLink { + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The timestamp at which this account link will expire. + pub expires_at: stripe_types::Timestamp, + /// The URL for the account link. + pub url: String, +} +#[cfg(feature = "account_link")] +mod requests; +#[cfg(feature = "account_link")] +pub use requests::*; diff --git a/generated/stripe_connect/src/account_link/requests.rs b/generated/stripe_connect/src/account_link/requests.rs new file mode 100644 index 000000000..ed4499030 --- /dev/null +++ b/generated/stripe_connect/src/account_link/requests.rs @@ -0,0 +1,153 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateAccountLink<'a> { + /// The identifier of the account to create an account link for. + pub account: &'a str, + /// Which information the platform needs to collect from the user. + /// + /// One of `currently_due` or `eventually_due`. + /// Default is `currently_due`. + #[serde(skip_serializing_if = "Option::is_none")] + pub collect: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. + /// + /// The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link's URL so they can continue with Connect Onboarding. + /// If a new account link cannot be generated or the redirect fails you should display a useful error to the user. + #[serde(skip_serializing_if = "Option::is_none")] + pub refresh_url: Option<&'a str>, + /// The URL that the user will be redirected to upon leaving or completing the linked flow. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, + /// The type of account link the user is requesting. + /// + /// Possible values are `account_onboarding` or `account_update`. + #[serde(rename = "type")] + pub type_: CreateAccountLinkType, +} +impl<'a> CreateAccountLink<'a> { + pub fn new(account: &'a str, type_: CreateAccountLinkType) -> Self { + Self { + account, + collect: Default::default(), + expand: Default::default(), + refresh_url: Default::default(), + return_url: Default::default(), + type_, + } + } +} +/// Which information the platform needs to collect from the user. +/// +/// One of `currently_due` or `eventually_due`. +/// Default is `currently_due`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateAccountLinkCollect { + CurrentlyDue, + EventuallyDue, +} +impl CreateAccountLinkCollect { + pub fn as_str(self) -> &'static str { + use CreateAccountLinkCollect::*; + match self { + CurrentlyDue => "currently_due", + EventuallyDue => "eventually_due", + } + } +} + +impl std::str::FromStr for CreateAccountLinkCollect { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateAccountLinkCollect::*; + match s { + "currently_due" => Ok(CurrentlyDue), + "eventually_due" => Ok(EventuallyDue), + _ => Err(()), + } + } +} +impl AsRef for CreateAccountLinkCollect { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateAccountLinkCollect { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateAccountLinkCollect { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateAccountLinkCollect { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of account link the user is requesting. +/// +/// Possible values are `account_onboarding` or `account_update`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateAccountLinkType { + AccountOnboarding, + AccountUpdate, +} +impl CreateAccountLinkType { + pub fn as_str(self) -> &'static str { + use CreateAccountLinkType::*; + match self { + AccountOnboarding => "account_onboarding", + AccountUpdate => "account_update", + } + } +} + +impl std::str::FromStr for CreateAccountLinkType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateAccountLinkType::*; + match s { + "account_onboarding" => Ok(AccountOnboarding), + "account_update" => Ok(AccountUpdate), + _ => Err(()), + } + } +} +impl AsRef for CreateAccountLinkType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateAccountLinkType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateAccountLinkType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateAccountLinkType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateAccountLink<'a> { + /// Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/account_links", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_connect/src/account_monthly_estimated_revenue/mod.rs b/generated/stripe_connect/src/account_monthly_estimated_revenue/mod.rs new file mode 100644 index 000000000..48d881ce7 --- /dev/null +++ b/generated/stripe_connect/src/account_monthly_estimated_revenue/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_monthly_estimated_revenue::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_payments_settings/mod.rs b/generated/stripe_connect/src/account_payments_settings/mod.rs new file mode 100644 index 000000000..3563b5bb7 --- /dev/null +++ b/generated/stripe_connect/src/account_payments_settings/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_payments_settings::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_payout_settings/mod.rs b/generated/stripe_connect/src/account_payout_settings/mod.rs new file mode 100644 index 000000000..26cbb287c --- /dev/null +++ b/generated/stripe_connect/src/account_payout_settings/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_payout_settings::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_requirements/mod.rs b/generated/stripe_connect/src/account_requirements/mod.rs new file mode 100644 index 000000000..120443961 --- /dev/null +++ b/generated/stripe_connect/src/account_requirements/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_requirements::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_requirements_alternative/mod.rs b/generated/stripe_connect/src/account_requirements_alternative/mod.rs new file mode 100644 index 000000000..fc354370c --- /dev/null +++ b/generated/stripe_connect/src/account_requirements_alternative/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_requirements_alternative::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_requirements_error/mod.rs b/generated/stripe_connect/src/account_requirements_error/mod.rs new file mode 100644 index 000000000..bcf3795c2 --- /dev/null +++ b/generated/stripe_connect/src/account_requirements_error/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_requirements_error::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_sepa_debit_payments_settings/mod.rs b/generated/stripe_connect/src/account_sepa_debit_payments_settings/mod.rs new file mode 100644 index 000000000..bce80e8a1 --- /dev/null +++ b/generated/stripe_connect/src/account_sepa_debit_payments_settings/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_sepa_debit_payments_settings::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_settings/mod.rs b/generated/stripe_connect/src/account_settings/mod.rs new file mode 100644 index 000000000..181cff65c --- /dev/null +++ b/generated/stripe_connect/src/account_settings/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_settings::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_terms_of_service/mod.rs b/generated/stripe_connect/src/account_terms_of_service/mod.rs new file mode 100644 index 000000000..f5575245f --- /dev/null +++ b/generated/stripe_connect/src/account_terms_of_service/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_terms_of_service::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_tos_acceptance/mod.rs b/generated/stripe_connect/src/account_tos_acceptance/mod.rs new file mode 100644 index 000000000..18b83048a --- /dev/null +++ b/generated/stripe_connect/src/account_tos_acceptance/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_tos_acceptance::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_treasury_settings/mod.rs b/generated/stripe_connect/src/account_treasury_settings/mod.rs new file mode 100644 index 000000000..64ccaa685 --- /dev/null +++ b/generated/stripe_connect/src/account_treasury_settings/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_treasury_settings::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/account_unification_account_controller/mod.rs b/generated/stripe_connect/src/account_unification_account_controller/mod.rs new file mode 100644 index 000000000..840fcd183 --- /dev/null +++ b/generated/stripe_connect/src/account_unification_account_controller/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::account_unification_account_controller::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/application/mod.rs b/generated/stripe_connect/src/application/mod.rs new file mode 100644 index 000000000..0d9be892a --- /dev/null +++ b/generated/stripe_connect/src/application/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::application::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/connect_embedded_account_session_create_components/mod.rs b/generated/stripe_connect/src/connect_embedded_account_session_create_components/mod.rs new file mode 100644 index 000000000..de663eaa5 --- /dev/null +++ b/generated/stripe_connect/src/connect_embedded_account_session_create_components/mod.rs @@ -0,0 +1,4 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ConnectEmbeddedAccountSessionCreateComponents { + pub account_onboarding: stripe_connect::ConnectEmbeddedBaseConfigClaim, +} diff --git a/generated/stripe_connect/src/connect_embedded_base_config_claim/mod.rs b/generated/stripe_connect/src/connect_embedded_base_config_claim/mod.rs new file mode 100644 index 000000000..ce4ea0f44 --- /dev/null +++ b/generated/stripe_connect/src/connect_embedded_base_config_claim/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ConnectEmbeddedBaseConfigClaim { + /// Whether the embedded component is enabled. + pub enabled: bool, +} diff --git a/generated/stripe_connect/src/connect_embedded_method_account_session_create_method_account_session/mod.rs b/generated/stripe_connect/src/connect_embedded_method_account_session_create_method_account_session/mod.rs new file mode 100644 index 000000000..4ef2c4044 --- /dev/null +++ b/generated/stripe_connect/src/connect_embedded_method_account_session_create_method_account_session/mod.rs @@ -0,0 +1,26 @@ +/// An AccountSession allows a Connect platform to grant access to a connected account in Connect embedded components. +/// +/// We recommend that you create an AccountSession each time you need to display an embedded component +/// to your user. +/// +/// Do not save AccountSessions to your database as they expire relatively quickly, and cannot be used more than once. Related guide: [Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ConnectEmbeddedMethodAccountSessionCreateMethodAccountSession { + /// The ID of the account the AccountSession was created for. + pub account: String, + /// The client secret of this AccountSession. + /// + /// Used on the client to set up secure access to the given `account`. The client secret can be used to provide access to `account` from your frontend. + /// It should not be stored, logged, or exposed to anyone other than the connected account. + /// Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs to [setup Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components) and learn about how `client_secret` should be handled. + pub client_secret: String, + pub components: stripe_connect::ConnectEmbeddedAccountSessionCreateComponents, + /// The timestamp at which this AccountSession will expire. + pub expires_at: stripe_types::Timestamp, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, +} +#[cfg(feature = "connect_embedded_method_account_session_create_method_account_session")] +mod requests; +#[cfg(feature = "connect_embedded_method_account_session_create_method_account_session")] +pub use requests::*; diff --git a/generated/stripe_connect/src/connect_embedded_method_account_session_create_method_account_session/requests.rs b/generated/stripe_connect/src/connect_embedded_method_account_session_create_method_account_session/requests.rs new file mode 100644 index 000000000..131ab6568 --- /dev/null +++ b/generated/stripe_connect/src/connect_embedded_method_account_session_create_method_account_session/requests.rs @@ -0,0 +1,60 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateConnectEmbeddedMethodAccountSessionCreateMethodAccountSession<'a> { + /// The identifier of the account to create an Account Session for. + pub account: &'a str, + /// Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. + /// + /// whether it has been enabled or not). + pub components: CreateConnectEmbeddedMethodAccountSessionCreateMethodAccountSessionComponents, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CreateConnectEmbeddedMethodAccountSessionCreateMethodAccountSession<'a> { + pub fn new( + account: &'a str, + components: CreateConnectEmbeddedMethodAccountSessionCreateMethodAccountSessionComponents, + ) -> Self { + Self { account, components, expand: Default::default() } + } +} +/// Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. +/// +/// whether it has been enabled or not). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateConnectEmbeddedMethodAccountSessionCreateMethodAccountSessionComponents { + /// Configuration for the account onboarding embedded component. +#[serde(skip_serializing_if = "Option::is_none")] +pub account_onboarding: Option, + +} +impl CreateConnectEmbeddedMethodAccountSessionCreateMethodAccountSessionComponents { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for the account onboarding embedded component. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateConnectEmbeddedMethodAccountSessionCreateMethodAccountSessionComponentsAccountOnboarding +{ + /// Whether the embedded component is enabled. + pub enabled: bool, +} +impl + CreateConnectEmbeddedMethodAccountSessionCreateMethodAccountSessionComponentsAccountOnboarding +{ + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +impl<'a> CreateConnectEmbeddedMethodAccountSessionCreateMethodAccountSession<'a> { + /// Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response< + stripe_connect::ConnectEmbeddedMethodAccountSessionCreateMethodAccountSession, + > { + client.send_form("/account_sessions", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_connect/src/country_spec/mod.rs b/generated/stripe_connect/src/country_spec/mod.rs new file mode 100644 index 000000000..4a1263a4a --- /dev/null +++ b/generated/stripe_connect/src/country_spec/mod.rs @@ -0,0 +1,39 @@ +/// Stripe needs to collect certain pieces of information about each account +/// created. +/// +/// These requirements can differ depending on the account's country. +/// The Country Specs API makes these rules available to your integration. You can also view the information from this API call as [an online guide](/docs/connect/required-verification-information). For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CountrySpec { + /// The default currency for this country. + /// + /// This applies to both payment methods and bank accounts. + pub default_currency: stripe_types::Currency, + /// Unique identifier for the object. + /// + /// Represented as the ISO country code for this country. + pub id: stripe_connect::country_spec::CountrySpecId, + /// Currencies that can be accepted in the specific country (for transfers). + pub supported_bank_account_currencies: std::collections::HashMap>, + /// Currencies that can be accepted in the specified country (for payments). + pub supported_payment_currencies: Vec, + /// Payment methods available in the specified country. + /// + /// You may need to enable some payment methods (e.g., [ACH](https://stripe.com/docs/ach)) on your account before they appear in this list. + /// The `stripe` payment method refers to [charging through your platform](https://stripe.com/docs/connect/destination-charges). + pub supported_payment_methods: Vec, + /// Countries that can accept transfers from the specified country. + pub supported_transfer_countries: Vec, + pub verification_fields: stripe_connect::CountrySpecVerificationFields, +} +impl stripe_types::Object for CountrySpec { + type Id = stripe_connect::country_spec::CountrySpecId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(CountrySpecId); +#[cfg(feature = "country_spec")] +mod requests; +#[cfg(feature = "country_spec")] +pub use requests::*; diff --git a/generated/stripe_connect/src/country_spec/requests.rs b/generated/stripe_connect/src/country_spec/requests.rs new file mode 100644 index 000000000..03a903450 --- /dev/null +++ b/generated/stripe_connect/src/country_spec/requests.rs @@ -0,0 +1,62 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCountrySpec<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListCountrySpec<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCountrySpec<'a> { + /// Lists all Country Spec objects available in the API. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/country_specs", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/country_specs", self) + } +} +impl<'a> stripe::PaginationParams for ListCountrySpec<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCountrySpec<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCountrySpec<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCountrySpec<'a> { + /// Returns a Country Spec for a given Country code. + pub fn send( + &self, + client: &stripe::Client, + country: &str, + ) -> stripe::Response { + client.get_query(&format!("/country_specs/{country}"), self) + } +} diff --git a/generated/stripe_connect/src/country_spec_verification_field_details/mod.rs b/generated/stripe_connect/src/country_spec_verification_field_details/mod.rs new file mode 100644 index 000000000..1f0195531 --- /dev/null +++ b/generated/stripe_connect/src/country_spec_verification_field_details/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CountrySpecVerificationFieldDetails { + /// Additional fields which are only required for some users. + pub additional: Vec, + /// Fields which every account must eventually provide. + pub minimum: Vec, +} diff --git a/generated/stripe_connect/src/country_spec_verification_fields/mod.rs b/generated/stripe_connect/src/country_spec_verification_fields/mod.rs new file mode 100644 index 000000000..4fd589811 --- /dev/null +++ b/generated/stripe_connect/src/country_spec_verification_fields/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CountrySpecVerificationFields { + pub company: stripe_connect::CountrySpecVerificationFieldDetails, + pub individual: stripe_connect::CountrySpecVerificationFieldDetails, +} diff --git a/generated/stripe_connect/src/deleted_account/mod.rs b/generated/stripe_connect/src/deleted_account/mod.rs new file mode 100644 index 000000000..ad9c7ac71 --- /dev/null +++ b/generated/stripe_connect/src/deleted_account/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::deleted_account::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/deleted_person/mod.rs b/generated/stripe_connect/src/deleted_person/mod.rs new file mode 100644 index 000000000..b073753ae --- /dev/null +++ b/generated/stripe_connect/src/deleted_person/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::deleted_person::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/external_account/mod.rs b/generated/stripe_connect/src/external_account/mod.rs new file mode 100644 index 000000000..1caaca7e2 --- /dev/null +++ b/generated/stripe_connect/src/external_account/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::external_account::*; +#[cfg(feature = "external_account")] +mod requests; +#[cfg(feature = "external_account")] +pub use requests::*; diff --git a/generated/stripe_connect/src/external_account/requests.rs b/generated/stripe_connect/src/external_account/requests.rs new file mode 100644 index 000000000..b7f604d08 --- /dev/null +++ b/generated/stripe_connect/src/external_account/requests.rs @@ -0,0 +1,409 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListExternalAccount<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Filter external accounts according to a particular object type. + #[serde(skip_serializing_if = "Option::is_none")] + pub object: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListExternalAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Filter external accounts according to a particular object type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListExternalAccountObject { + BankAccount, + Card, +} +impl ListExternalAccountObject { + pub fn as_str(self) -> &'static str { + use ListExternalAccountObject::*; + match self { + BankAccount => "bank_account", + Card => "card", + } + } +} + +impl std::str::FromStr for ListExternalAccountObject { + type Err = (); + fn from_str(s: &str) -> Result { + use ListExternalAccountObject::*; + match s { + "bank_account" => Ok(BankAccount), + "card" => Ok(Card), + _ => Err(()), + } + } +} +impl AsRef for ListExternalAccountObject { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListExternalAccountObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListExternalAccountObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListExternalAccountObject { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListExternalAccount<'a> { + /// List external accounts for an account. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + ) -> stripe::Response> { + client.get_query(&format!("/accounts/{account}/external_accounts"), self) + } + pub fn paginate( + self, + account: &stripe_types::account::AccountId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params(&format!("/accounts/{account}/external_accounts"), self) + } +} +impl<'a> stripe::PaginationParams for ListExternalAccount<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveExternalAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveExternalAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveExternalAccount<'a> { + /// Retrieve a specified external account for a given account. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + id: &str, + ) -> stripe::Response { + client.get_query(&format!("/accounts/{account}/external_accounts/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateExternalAccount<'a> { + /// When set to true, or if this is the first external account added in this currency, this account becomes the default external account for its currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for_currency: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Please refer to full [documentation](https://stripe.com/docs/api) instead. + pub external_account: &'a str, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> CreateExternalAccount<'a> { + pub fn new(external_account: &'a str) -> Self { + Self { + default_for_currency: Default::default(), + expand: Default::default(), + external_account, + metadata: Default::default(), + } + } +} +impl<'a> CreateExternalAccount<'a> { + /// Create an external account for a given account. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/external_accounts"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateExternalAccount<'a> { + /// The name of the person or business that owns the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_name: Option<&'a str>, + /// The type of entity that holds the account. + /// + /// This can be either `individual` or `company`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The bank account type. + /// + /// This can only be `checking` or `savings` in most countries. + /// In Japan, this can only be `futsu` or `toza`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// City/District/Suburb/Town/Village. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_city: Option<&'a str>, + /// Billing address country, if provided when creating card. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_country: Option<&'a str>, + /// Address line 1 (Street address/PO Box/Company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1: Option<&'a str>, + /// Address line 2 (Apartment/Suite/Unit/Building). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line2: Option<&'a str>, + /// State/County/Province/Region. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_state: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_zip: Option<&'a str>, + /// When set to true, this becomes the default external account for its currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for_currency: Option, + /// Documents that may be submitted to satisfy various informational requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub documents: Option>, + /// Two digit number representing the card’s expiration month. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option<&'a str>, + /// Four digit number representing the card’s expiration year. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Cardholder name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, +} +impl<'a> UpdateExternalAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of entity that holds the account. +/// +/// This can be either `individual` or `company`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateExternalAccountAccountHolderType { + Company, + Individual, +} +impl UpdateExternalAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdateExternalAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdateExternalAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateExternalAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for UpdateExternalAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateExternalAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateExternalAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateExternalAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The bank account type. +/// +/// This can only be `checking` or `savings` in most countries. +/// In Japan, this can only be `futsu` or `toza`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateExternalAccountAccountType { + Checking, + Futsu, + Savings, + Toza, +} +impl UpdateExternalAccountAccountType { + pub fn as_str(self) -> &'static str { + use UpdateExternalAccountAccountType::*; + match self { + Checking => "checking", + Futsu => "futsu", + Savings => "savings", + Toza => "toza", + } + } +} + +impl std::str::FromStr for UpdateExternalAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateExternalAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "futsu" => Ok(Futsu), + "savings" => Ok(Savings), + "toza" => Ok(Toza), + _ => Err(()), + } + } +} +impl AsRef for UpdateExternalAccountAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateExternalAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateExternalAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateExternalAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Documents that may be submitted to satisfy various informational requests. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateExternalAccountDocuments<'a> { + /// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. + /// + /// Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_account_ownership_verification: + Option>, +} +impl<'a> UpdateExternalAccountDocuments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. +/// +/// Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateExternalAccountDocumentsBankAccountOwnershipVerification<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> UpdateExternalAccountDocumentsBankAccountOwnershipVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateExternalAccount<'a> { + /// Updates the metadata, account holder name, account holder type of a bank account belonging to a [Custom account](https://stripe.com/docs/connect/custom-accounts), and optionally sets it as the default for its currency. + /// + /// Other bank account details are not editable by design. You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/external_accounts/{id}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteExternalAccount {} +impl DeleteExternalAccount { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteExternalAccount { + /// Delete a specified external account for a given account. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/external_accounts/{id}"), + self, + http_types::Method::Delete, + ) + } +} diff --git a/generated/stripe_connect/src/fee_refund/mod.rs b/generated/stripe_connect/src/fee_refund/mod.rs new file mode 100644 index 000000000..7c87d63af --- /dev/null +++ b/generated/stripe_connect/src/fee_refund/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::fee_refund::*; +#[cfg(feature = "fee_refund")] +mod requests; +#[cfg(feature = "fee_refund")] +pub use requests::*; diff --git a/generated/stripe_connect/src/fee_refund/requests.rs b/generated/stripe_connect/src/fee_refund/requests.rs new file mode 100644 index 000000000..fc55336f0 --- /dev/null +++ b/generated/stripe_connect/src/fee_refund/requests.rs @@ -0,0 +1,146 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateFeeRefund<'a> { + /// A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. + /// + /// Can refund only up to the remaining unrefunded amount of the fee. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> CreateFeeRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateFeeRefund<'a> { + /// Refunds an application fee that has previously been collected but not yet refunded. + /// Funds will be refunded to the Stripe account from which the fee was originally collected. + /// + /// You can optionally refund only part of an application fee. + /// You can do so multiple times, until the entire fee has been refunded. + /// + /// Once entirely refunded, an application fee can’t be refunded again. + /// This method will raise an error when called on an already-refunded application fee, + /// or when trying to refund more money than is left on an application fee. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_types::fee_refund::FeeRefundId, + ) -> stripe::Response { + client.send_form(&format!("/application_fees/{id}/refunds"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListFeeRefund<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListFeeRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListFeeRefund<'a> { + /// You can see a list of the refunds belonging to a specific application fee. + /// + /// Note that the 10 most recent refunds are always available by default on the application fee object. + /// If you need more than those 10, you can use this API method and the `limit` and `starting_after` parameters to page through additional refunds. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_types::fee_refund::FeeRefundId, + ) -> stripe::Response> { + client.get_query(&format!("/application_fees/{id}/refunds"), self) + } + pub fn paginate( + self, + id: &stripe_types::fee_refund::FeeRefundId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params(&format!("/application_fees/{id}/refunds"), self) + } +} +impl<'a> stripe::PaginationParams for ListFeeRefund<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveFeeRefund<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveFeeRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveFeeRefund<'a> { + /// By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee. + pub fn send( + &self, + client: &stripe::Client, + fee: &str, + id: &str, + ) -> stripe::Response { + client.get_query(&format!("/application_fees/{fee}/refunds/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateFeeRefund<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateFeeRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateFeeRefund<'a> { + /// Updates the specified application fee refund by setting the values of the parameters passed. + /// + /// Any parameters not provided will be left unchanged. This request only accepts metadata as an argument. + pub fn send( + &self, + client: &stripe::Client, + fee: &str, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/application_fees/{fee}/refunds/{id}"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_connect/src/legal_entity_company/mod.rs b/generated/stripe_connect/src/legal_entity_company/mod.rs new file mode 100644 index 000000000..33f161ddf --- /dev/null +++ b/generated/stripe_connect/src/legal_entity_company/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::legal_entity_company::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/legal_entity_company_verification/mod.rs b/generated/stripe_connect/src/legal_entity_company_verification/mod.rs new file mode 100644 index 000000000..e508fb5a0 --- /dev/null +++ b/generated/stripe_connect/src/legal_entity_company_verification/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::legal_entity_company_verification::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/legal_entity_company_verification_document/mod.rs b/generated/stripe_connect/src/legal_entity_company_verification_document/mod.rs new file mode 100644 index 000000000..80b26c496 --- /dev/null +++ b/generated/stripe_connect/src/legal_entity_company_verification_document/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::legal_entity_company_verification_document::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/legal_entity_dob/mod.rs b/generated/stripe_connect/src/legal_entity_dob/mod.rs new file mode 100644 index 000000000..5107b608c --- /dev/null +++ b/generated/stripe_connect/src/legal_entity_dob/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::legal_entity_dob::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/legal_entity_japan_address/mod.rs b/generated/stripe_connect/src/legal_entity_japan_address/mod.rs new file mode 100644 index 000000000..5e974dbbf --- /dev/null +++ b/generated/stripe_connect/src/legal_entity_japan_address/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::legal_entity_japan_address::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/legal_entity_person_verification/mod.rs b/generated/stripe_connect/src/legal_entity_person_verification/mod.rs new file mode 100644 index 000000000..f77824646 --- /dev/null +++ b/generated/stripe_connect/src/legal_entity_person_verification/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::legal_entity_person_verification::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/legal_entity_person_verification_document/mod.rs b/generated/stripe_connect/src/legal_entity_person_verification_document/mod.rs new file mode 100644 index 000000000..c442f9ca7 --- /dev/null +++ b/generated/stripe_connect/src/legal_entity_person_verification_document/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::legal_entity_person_verification_document::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/legal_entity_ubo_declaration/mod.rs b/generated/stripe_connect/src/legal_entity_ubo_declaration/mod.rs new file mode 100644 index 000000000..41e87d351 --- /dev/null +++ b/generated/stripe_connect/src/legal_entity_ubo_declaration/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::legal_entity_ubo_declaration::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/login_link/mod.rs b/generated/stripe_connect/src/login_link/mod.rs new file mode 100644 index 000000000..df23c9c60 --- /dev/null +++ b/generated/stripe_connect/src/login_link/mod.rs @@ -0,0 +1,16 @@ +/// Login Links are single-use login link for an Express account to access their Stripe dashboard. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct LoginLink { + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The URL for the login link. + pub url: String, +} +#[cfg(feature = "login_link")] +mod requests; +#[cfg(feature = "login_link")] +pub use requests::*; diff --git a/generated/stripe_connect/src/login_link/requests.rs b/generated/stripe_connect/src/login_link/requests.rs new file mode 100644 index 000000000..77f287987 --- /dev/null +++ b/generated/stripe_connect/src/login_link/requests.rs @@ -0,0 +1,27 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateLoginLink<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CreateLoginLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateLoginLink<'a> { + /// Creates a single-use login link for an Express account to access their Stripe dashboard. + /// + /// **You may only create login links for [Express accounts](https://stripe.com/docs/connect/express-accounts) connected to your platform**. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/login_links"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_connect/src/mod.rs b/generated/stripe_connect/src/mod.rs new file mode 100644 index 000000000..4e1894a8e --- /dev/null +++ b/generated/stripe_connect/src/mod.rs @@ -0,0 +1,83 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::invalid_html_tags)] +extern crate self as stripe_connect; +pub use stripe_types::Account; +pub mod account; +pub use stripe_types::AccountBacsDebitPaymentsSettings; +pub use stripe_types::AccountBrandingSettings; +pub use stripe_types::AccountBusinessProfile; +pub use stripe_types::AccountCapabilities; +pub use stripe_types::AccountCapabilityFutureRequirements; +pub use stripe_types::AccountCapabilityRequirements; +pub use stripe_types::AccountCardIssuingSettings; +pub use stripe_types::AccountCardPaymentsSettings; +pub use stripe_types::AccountDashboardSettings; +pub use stripe_types::AccountDeclineChargeOn; +pub use stripe_types::AccountFutureRequirements; +pub mod account_link; +pub use account_link::AccountLink; +pub use stripe_types::AccountMonthlyEstimatedRevenue; +pub use stripe_types::AccountPaymentsSettings; +pub use stripe_types::AccountPayoutSettings; +pub use stripe_types::AccountRequirements; +pub use stripe_types::AccountRequirementsAlternative; +pub use stripe_types::AccountRequirementsError; +pub use stripe_types::AccountSepaDebitPaymentsSettings; +pub mod connect_embedded_method_account_session_create_method_account_session; +pub use connect_embedded_method_account_session_create_method_account_session::ConnectEmbeddedMethodAccountSessionCreateMethodAccountSession; +pub use stripe_types::AccountSettings; +pub use stripe_types::AccountTermsOfService; +pub use stripe_types::AccountTosAcceptance; +pub use stripe_types::AccountTreasurySettings; +pub use stripe_types::AccountUnificationAccountController; +pub use stripe_types::Application; +pub use stripe_types::PlatformFee; +pub mod platform_fee; +pub mod secret_service_resource_secret; +pub use secret_service_resource_secret::SecretServiceResourceSecret; +pub use stripe_types::AccountCapability; +pub mod account_capability; +pub mod connect_embedded_account_session_create_components; +pub use connect_embedded_account_session_create_components::ConnectEmbeddedAccountSessionCreateComponents; +pub mod connect_embedded_base_config_claim; +pub use connect_embedded_base_config_claim::ConnectEmbeddedBaseConfigClaim; +pub mod country_spec; +pub use country_spec::CountrySpec; +pub mod country_spec_verification_field_details; +pub use country_spec_verification_field_details::CountrySpecVerificationFieldDetails; +pub mod country_spec_verification_fields; +pub use country_spec_verification_fields::CountrySpecVerificationFields; +pub use stripe_types::DeletedAccount; +pub use stripe_types::DeletedPerson; +pub use stripe_types::ExternalAccount; +pub mod external_account; +pub use stripe_types::FeeRefund; +pub mod fee_refund; +pub use stripe_types::LegalEntityCompany; +pub use stripe_types::LegalEntityCompanyVerification; +pub use stripe_types::LegalEntityCompanyVerificationDocument; +pub use stripe_types::LegalEntityDob; +pub use stripe_types::LegalEntityJapanAddress; +pub use stripe_types::LegalEntityPersonVerification; +pub use stripe_types::LegalEntityPersonVerificationDocument; +pub use stripe_types::LegalEntityUboDeclaration; +pub mod login_link; +pub use login_link::LoginLink; +pub use stripe_types::Person; +pub mod person; +pub use stripe_types::PersonAdditionalTosAcceptance; +pub use stripe_types::PersonAdditionalTosAcceptances; +pub use stripe_types::PersonFutureRequirements; +pub use stripe_types::PersonRelationship; +pub use stripe_types::PersonRequirements; +pub mod secret_service_resource_scope; +pub use secret_service_resource_scope::SecretServiceResourceScope; +pub use stripe_types::Topup; +pub mod topup; +pub use stripe_types::Transfer; +pub mod transfer; +pub use stripe_types::TransferData; +pub use stripe_types::TransferReversal; +pub mod transfer_reversal; +pub use stripe_types::TransferSchedule; diff --git a/generated/stripe_connect/src/person/mod.rs b/generated/stripe_connect/src/person/mod.rs new file mode 100644 index 000000000..d67304177 --- /dev/null +++ b/generated/stripe_connect/src/person/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::person::*; +#[cfg(feature = "person")] +mod requests; +#[cfg(feature = "person")] +pub use requests::*; diff --git a/generated/stripe_connect/src/person/requests.rs b/generated/stripe_connect/src/person/requests.rs new file mode 100644 index 000000000..d83490f99 --- /dev/null +++ b/generated/stripe_connect/src/person/requests.rs @@ -0,0 +1,962 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPerson<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Filters on the list of people returned based on the person's relationship to the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub relationship: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListPerson<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Filters on the list of people returned based on the person's relationship to the account's company. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPersonRelationship { + /// A filter on the list of people returned based on whether these people are directors of the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub director: Option, + /// A filter on the list of people returned based on whether these people are executives of the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub executive: Option, + /// A filter on the list of people returned based on whether these people are legal guardians of the account's representative. + #[serde(skip_serializing_if = "Option::is_none")] + pub legal_guardian: Option, + /// A filter on the list of people returned based on whether these people are owners of the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option, + /// A filter on the list of people returned based on whether these people are the representative of the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub representative: Option, +} +impl ListPersonRelationship { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPerson<'a> { + /// Returns a list of people associated with the account’s legal entity. + /// + /// The people are returned sorted by creation date, with the most recent people appearing first. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + ) -> stripe::Response> { + client.get_query(&format!("/accounts/{account}/persons"), self) + } + pub fn paginate( + self, + account: &stripe_types::account::AccountId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params(&format!("/accounts/{account}/persons"), self) + } +} +impl<'a> stripe::PaginationParams for ListPerson<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePerson<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePerson<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePerson<'a> { + /// Retrieves an existing person. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + person: &stripe_types::person::PersonId, + ) -> stripe::Response { + client.get_query(&format!("/accounts/{account}/persons/{person}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePerson<'a> { + /// Details on the legal guardian's acceptance of the required Stripe agreements. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_tos_acceptances: Option>, + /// The person's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the person's address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the person's address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// The person's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, + /// Documents that may be submitted to satisfy various informational requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub documents: Option>, + /// The person's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The person's first name. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option<&'a str>, + /// The Kana variation of the person's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kana: Option<&'a str>, + /// The Kanji variation of the person's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kanji: Option<&'a str>, + /// A list of alternate names or aliases that the person is known by. + #[serde(skip_serializing_if = "Option::is_none")] + pub full_name_aliases: Option<&'a [&'a str]>, + /// The person's gender (International regulations require either "male" or "female"). + #[serde(skip_serializing_if = "Option::is_none")] + pub gender: Option<&'a str>, + /// The person's ID number, as appropriate for their country. + /// + /// For example, a social security number in the U.S., social insurance number in Canada, etc. + /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option<&'a str>, + /// The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. + /// + /// In Thailand, this would be the laser code found on the back of an ID card. + /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number_secondary: Option<&'a str>, + /// The person's last name. + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option<&'a str>, + /// The Kana variation of the person's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kana: Option<&'a str>, + /// The Kanji variation of the person's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kanji: Option<&'a str>, + /// The person's maiden name. + #[serde(skip_serializing_if = "Option::is_none")] + pub maiden_name: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The country where the person is a national. + /// + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. + #[serde(skip_serializing_if = "Option::is_none")] + pub nationality: Option<&'a str>, + /// A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. + #[serde(skip_serializing_if = "Option::is_none")] + pub person_token: Option<&'a str>, + /// The person's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + #[serde(skip_serializing_if = "Option::is_none")] + pub political_exposure: Option<&'a str>, + /// The person's registered address. + #[serde(skip_serializing_if = "Option::is_none")] + pub registered_address: Option>, + /// The relationship that this person has with the account's legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub relationship: Option>, + /// The last four digits of the person's Social Security number (U.S. + /// + /// only). + #[serde(skip_serializing_if = "Option::is_none")] + pub ssn_last_4: Option<&'a str>, + /// The person's verification status. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> CreatePerson<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on the legal guardian's acceptance of the required Stripe agreements. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePersonAdditionalTosAcceptances<'a> { + /// Details on the legal guardian's acceptance of the main Stripe service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option>, +} +impl<'a> CreatePersonAdditionalTosAcceptances<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on the legal guardian's acceptance of the main Stripe service agreement. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePersonAdditionalTosAcceptancesAccount<'a> { + /// The Unix timestamp marking when the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> CreatePersonAdditionalTosAcceptancesAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The person's address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePersonAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreatePersonAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the person's address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePersonAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreatePersonAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the person's address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePersonAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreatePersonAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The person's date of birth. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePersonDob { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl CreatePersonDob { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +/// Documents that may be submitted to satisfy various informational requests. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePersonDocuments<'a> { + /// One or more documents that demonstrate proof that this person is authorized to represent the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_authorization: Option>, + /// One or more documents showing the person's passport page with photo and personal data. + #[serde(skip_serializing_if = "Option::is_none")] + pub passport: Option>, + /// One or more documents showing the person's visa required for living in the country where they are residing. + #[serde(skip_serializing_if = "Option::is_none")] + pub visa: Option>, +} +impl<'a> CreatePersonDocuments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents that demonstrate proof that this person is authorized to represent the company. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePersonDocumentsCompanyAuthorization<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> CreatePersonDocumentsCompanyAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents showing the person's passport page with photo and personal data. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePersonDocumentsPassport<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> CreatePersonDocumentsPassport<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents showing the person's visa required for living in the country where they are residing. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePersonDocumentsVisa<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> CreatePersonDocumentsVisa<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The person's registered address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePersonRegisteredAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreatePersonRegisteredAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The relationship that this person has with the account's legal entity. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePersonRelationship<'a> { + /// Whether the person is a director of the account's legal entity. + /// + /// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + #[serde(skip_serializing_if = "Option::is_none")] + pub director: Option, + /// Whether the person has significant responsibility to control, manage, or direct the organization. + #[serde(skip_serializing_if = "Option::is_none")] + pub executive: Option, + /// Whether the person is the legal guardian of the account's representative. + #[serde(skip_serializing_if = "Option::is_none")] + pub legal_guardian: Option, + /// Whether the person is an owner of the account’s legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option, + /// The percent owned by the person of the account's legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub percent_ownership: Option, + /// Whether the person is authorized as the primary representative of the account. + /// + /// This is the person nominated by the business to provide information about themselves, and general information about the account. + /// There can only be one representative at any given time. + /// At the time the account is created, this person should be set to the person responsible for opening the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub representative: Option, + /// The person's title (e.g., CEO, Support Engineer). + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option<&'a str>, +} +impl<'a> CreatePersonRelationship<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The person's verification status. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePersonVerification<'a> { + /// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_document: Option>, + /// An identifying document, either a passport or local ID card. + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> CreatePersonVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePersonVerificationAdditionalDocument<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> CreatePersonVerificationAdditionalDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An identifying document, either a passport or local ID card. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePersonVerificationDocument<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> CreatePersonVerificationDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreatePerson<'a> { + /// Creates a new person. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + ) -> stripe::Response { + client.send_form(&format!("/accounts/{account}/persons"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePerson<'a> { + /// Details on the legal guardian's acceptance of the required Stripe agreements. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_tos_acceptances: Option>, + /// The person's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the person's address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the person's address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// The person's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, + /// Documents that may be submitted to satisfy various informational requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub documents: Option>, + /// The person's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The person's first name. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option<&'a str>, + /// The Kana variation of the person's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kana: Option<&'a str>, + /// The Kanji variation of the person's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kanji: Option<&'a str>, + /// A list of alternate names or aliases that the person is known by. + #[serde(skip_serializing_if = "Option::is_none")] + pub full_name_aliases: Option<&'a [&'a str]>, + /// The person's gender (International regulations require either "male" or "female"). + #[serde(skip_serializing_if = "Option::is_none")] + pub gender: Option<&'a str>, + /// The person's ID number, as appropriate for their country. + /// + /// For example, a social security number in the U.S., social insurance number in Canada, etc. + /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option<&'a str>, + /// The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. + /// + /// In Thailand, this would be the laser code found on the back of an ID card. + /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number_secondary: Option<&'a str>, + /// The person's last name. + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option<&'a str>, + /// The Kana variation of the person's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kana: Option<&'a str>, + /// The Kanji variation of the person's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kanji: Option<&'a str>, + /// The person's maiden name. + #[serde(skip_serializing_if = "Option::is_none")] + pub maiden_name: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The country where the person is a national. + /// + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. + #[serde(skip_serializing_if = "Option::is_none")] + pub nationality: Option<&'a str>, + /// A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. + #[serde(skip_serializing_if = "Option::is_none")] + pub person_token: Option<&'a str>, + /// The person's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + #[serde(skip_serializing_if = "Option::is_none")] + pub political_exposure: Option<&'a str>, + /// The person's registered address. + #[serde(skip_serializing_if = "Option::is_none")] + pub registered_address: Option>, + /// The relationship that this person has with the account's legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub relationship: Option>, + /// The last four digits of the person's Social Security number (U.S. + /// + /// only). + #[serde(skip_serializing_if = "Option::is_none")] + pub ssn_last_4: Option<&'a str>, + /// The person's verification status. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> UpdatePerson<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on the legal guardian's acceptance of the required Stripe agreements. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePersonAdditionalTosAcceptances<'a> { + /// Details on the legal guardian's acceptance of the main Stripe service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option>, +} +impl<'a> UpdatePersonAdditionalTosAcceptances<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on the legal guardian's acceptance of the main Stripe service agreement. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePersonAdditionalTosAcceptancesAccount<'a> { + /// The Unix timestamp marking when the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> UpdatePersonAdditionalTosAcceptancesAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The person's address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePersonAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdatePersonAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the person's address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePersonAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> UpdatePersonAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the person's address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePersonAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> UpdatePersonAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The person's date of birth. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePersonDob { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl UpdatePersonDob { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +/// Documents that may be submitted to satisfy various informational requests. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePersonDocuments<'a> { + /// One or more documents that demonstrate proof that this person is authorized to represent the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_authorization: Option>, + /// One or more documents showing the person's passport page with photo and personal data. + #[serde(skip_serializing_if = "Option::is_none")] + pub passport: Option>, + /// One or more documents showing the person's visa required for living in the country where they are residing. + #[serde(skip_serializing_if = "Option::is_none")] + pub visa: Option>, +} +impl<'a> UpdatePersonDocuments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents that demonstrate proof that this person is authorized to represent the company. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePersonDocumentsCompanyAuthorization<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> UpdatePersonDocumentsCompanyAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents showing the person's passport page with photo and personal data. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePersonDocumentsPassport<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> UpdatePersonDocumentsPassport<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents showing the person's visa required for living in the country where they are residing. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePersonDocumentsVisa<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> UpdatePersonDocumentsVisa<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The person's registered address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePersonRegisteredAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdatePersonRegisteredAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The relationship that this person has with the account's legal entity. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePersonRelationship<'a> { + /// Whether the person is a director of the account's legal entity. + /// + /// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + #[serde(skip_serializing_if = "Option::is_none")] + pub director: Option, + /// Whether the person has significant responsibility to control, manage, or direct the organization. + #[serde(skip_serializing_if = "Option::is_none")] + pub executive: Option, + /// Whether the person is the legal guardian of the account's representative. + #[serde(skip_serializing_if = "Option::is_none")] + pub legal_guardian: Option, + /// Whether the person is an owner of the account’s legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option, + /// The percent owned by the person of the account's legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub percent_ownership: Option, + /// Whether the person is authorized as the primary representative of the account. + /// + /// This is the person nominated by the business to provide information about themselves, and general information about the account. + /// There can only be one representative at any given time. + /// At the time the account is created, this person should be set to the person responsible for opening the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub representative: Option, + /// The person's title (e.g., CEO, Support Engineer). + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option<&'a str>, +} +impl<'a> UpdatePersonRelationship<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The person's verification status. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePersonVerification<'a> { + /// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_document: Option>, + /// An identifying document, either a passport or local ID card. + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> UpdatePersonVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePersonVerificationAdditionalDocument<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> UpdatePersonVerificationAdditionalDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An identifying document, either a passport or local ID card. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePersonVerificationDocument<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> UpdatePersonVerificationDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdatePerson<'a> { + /// Updates an existing person. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + person: &stripe_types::person::PersonId, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/persons/{person}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeletePerson {} +impl DeletePerson { + pub fn new() -> Self { + Self::default() + } +} +impl DeletePerson { + /// Deletes an existing person’s relationship to the account’s legal entity. + /// + /// Any person with a relationship for an account can be deleted through the API, except if the person is the `account_opener`. + /// If your integration is using the `executive` parameter, you cannot delete the only verified `executive` on file. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + person: &stripe_types::person::PersonId, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/persons/{person}"), + self, + http_types::Method::Delete, + ) + } +} diff --git a/generated/stripe_connect/src/person_additional_tos_acceptance/mod.rs b/generated/stripe_connect/src/person_additional_tos_acceptance/mod.rs new file mode 100644 index 000000000..779443417 --- /dev/null +++ b/generated/stripe_connect/src/person_additional_tos_acceptance/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::person_additional_tos_acceptance::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/person_additional_tos_acceptances/mod.rs b/generated/stripe_connect/src/person_additional_tos_acceptances/mod.rs new file mode 100644 index 000000000..66f41878f --- /dev/null +++ b/generated/stripe_connect/src/person_additional_tos_acceptances/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::person_additional_tos_acceptances::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/person_future_requirements/mod.rs b/generated/stripe_connect/src/person_future_requirements/mod.rs new file mode 100644 index 000000000..e9acef23d --- /dev/null +++ b/generated/stripe_connect/src/person_future_requirements/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::person_future_requirements::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/person_relationship/mod.rs b/generated/stripe_connect/src/person_relationship/mod.rs new file mode 100644 index 000000000..b1b02ff16 --- /dev/null +++ b/generated/stripe_connect/src/person_relationship/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::person_relationship::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/person_requirements/mod.rs b/generated/stripe_connect/src/person_requirements/mod.rs new file mode 100644 index 000000000..67d4def71 --- /dev/null +++ b/generated/stripe_connect/src/person_requirements/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::person_requirements::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/platform_fee/mod.rs b/generated/stripe_connect/src/platform_fee/mod.rs new file mode 100644 index 000000000..e5ebd214d --- /dev/null +++ b/generated/stripe_connect/src/platform_fee/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::platform_fee::*; +#[cfg(feature = "platform_fee")] +mod requests; +#[cfg(feature = "platform_fee")] +pub use requests::*; diff --git a/generated/stripe_connect/src/platform_fee/requests.rs b/generated/stripe_connect/src/platform_fee/requests.rs new file mode 100644 index 000000000..125087f8c --- /dev/null +++ b/generated/stripe_connect/src/platform_fee/requests.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPlatformFee<'a> { + /// Only return application fees for the charge specified by this charge ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub charge: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListPlatformFee<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPlatformFee<'a> { + /// Returns a list of application fees you’ve previously collected. + /// + /// The application fees are returned in sorted order, with the most recent fees appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/application_fees", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/application_fees", self) + } +} +impl<'a> stripe::PaginationParams for ListPlatformFee<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePlatformFee<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePlatformFee<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePlatformFee<'a> { + /// Retrieves the details of an application fee that your account has collected. + /// + /// The same information is returned when refunding the application fee. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_types::platform_fee::ApplicationFeeId, + ) -> stripe::Response { + client.get_query(&format!("/application_fees/{id}"), self) + } +} diff --git a/generated/stripe_connect/src/secret_service_resource_scope/mod.rs b/generated/stripe_connect/src/secret_service_resource_scope/mod.rs new file mode 100644 index 000000000..728b61111 --- /dev/null +++ b/generated/stripe_connect/src/secret_service_resource_scope/mod.rs @@ -0,0 +1,69 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SecretServiceResourceScope { + /// The secret scope type. + #[serde(rename = "type")] + pub type_: SecretServiceResourceScopeType, + /// The user ID, if type is set to "user". + #[serde(skip_serializing_if = "Option::is_none")] + pub user: Option, +} +/// The secret scope type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SecretServiceResourceScopeType { + Account, + User, +} +impl SecretServiceResourceScopeType { + pub fn as_str(self) -> &'static str { + use SecretServiceResourceScopeType::*; + match self { + Account => "account", + User => "user", + } + } +} + +impl std::str::FromStr for SecretServiceResourceScopeType { + type Err = (); + fn from_str(s: &str) -> Result { + use SecretServiceResourceScopeType::*; + match s { + "account" => Ok(Account), + "user" => Ok(User), + _ => Err(()), + } + } +} +impl AsRef for SecretServiceResourceScopeType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SecretServiceResourceScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SecretServiceResourceScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SecretServiceResourceScopeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SecretServiceResourceScopeType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for SecretServiceResourceScopeType") + }) + } +} diff --git a/generated/stripe_connect/src/secret_service_resource_secret/mod.rs b/generated/stripe_connect/src/secret_service_resource_secret/mod.rs new file mode 100644 index 000000000..cb195183e --- /dev/null +++ b/generated/stripe_connect/src/secret_service_resource_secret/mod.rs @@ -0,0 +1,40 @@ +/// Secret Store is an API that allows Stripe Apps developers to securely persist secrets for use by UI Extensions and app backends. +/// +/// The primary resource in Secret Store is a `secret`. +/// +/// Other apps can't view secrets created by an app. +/// Additionally, secrets are scoped to provide further permission control. All Dashboard users and the app backend share `account` scoped secrets. +/// Use the `account` scope for secrets that don't change per-user, like a third-party API key. A `user` scoped secret is accessible by the app backend and one specific Dashboard user. +/// Use the `user` scope for per-user secrets like per-user OAuth tokens, where different users might have different permissions. Related guide: [Store data between page reloads](https://stripe.com/docs/stripe-apps/store-auth-data-custom-objects). +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SecretServiceResourceSecret { + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// If true, indicates that this secret has been deleted. + #[serde(skip_serializing_if = "Option::is_none")] + pub deleted: Option, + /// The Unix timestamp for the expiry time of the secret, after which the secret deletes. + pub expires_at: Option, + /// Unique identifier for the object. + pub id: stripe_connect::secret_service_resource_secret::AppsSecretId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// A name for the secret that's unique within the scope. + pub name: String, + /// The plaintext secret value to be stored. + pub payload: Option, + pub scope: stripe_connect::SecretServiceResourceScope, +} +impl stripe_types::Object for SecretServiceResourceSecret { + type Id = stripe_connect::secret_service_resource_secret::AppsSecretId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(AppsSecretId); +#[cfg(feature = "secret_service_resource_secret")] +mod requests; +#[cfg(feature = "secret_service_resource_secret")] +pub use requests::*; diff --git a/generated/stripe_connect/src/secret_service_resource_secret/requests.rs b/generated/stripe_connect/src/secret_service_resource_secret/requests.rs new file mode 100644 index 000000000..c5c759bd7 --- /dev/null +++ b/generated/stripe_connect/src/secret_service_resource_secret/requests.rs @@ -0,0 +1,418 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct FindSecretServiceResourceSecret<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A name for the secret that's unique within the scope. + pub name: &'a str, + /// Specifies the scoping of the secret. + /// + /// Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. + pub scope: FindSecretServiceResourceSecretScope<'a>, +} +impl<'a> FindSecretServiceResourceSecret<'a> { + pub fn new(name: &'a str, scope: FindSecretServiceResourceSecretScope<'a>) -> Self { + Self { expand: Default::default(), name, scope } + } +} +/// Specifies the scoping of the secret. +/// +/// Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct FindSecretServiceResourceSecretScope<'a> { + /// The secret scope type. + #[serde(rename = "type")] + pub type_: FindSecretServiceResourceSecretScopeType, + /// The user ID. + /// + /// This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub user: Option<&'a str>, +} +impl<'a> FindSecretServiceResourceSecretScope<'a> { + pub fn new(type_: FindSecretServiceResourceSecretScopeType) -> Self { + Self { type_, user: Default::default() } + } +} +/// The secret scope type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FindSecretServiceResourceSecretScopeType { + Account, + User, +} +impl FindSecretServiceResourceSecretScopeType { + pub fn as_str(self) -> &'static str { + use FindSecretServiceResourceSecretScopeType::*; + match self { + Account => "account", + User => "user", + } + } +} + +impl std::str::FromStr for FindSecretServiceResourceSecretScopeType { + type Err = (); + fn from_str(s: &str) -> Result { + use FindSecretServiceResourceSecretScopeType::*; + match s { + "account" => Ok(Account), + "user" => Ok(User), + _ => Err(()), + } + } +} +impl AsRef for FindSecretServiceResourceSecretScopeType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for FindSecretServiceResourceSecretScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FindSecretServiceResourceSecretScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FindSecretServiceResourceSecretScopeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> FindSecretServiceResourceSecret<'a> { + /// Finds a secret in the secret store by name and scope. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.get_query("/apps/secrets/find", self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSecretServiceResourceSecret<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The Unix timestamp for the expiry time of the secret, after which the secret deletes. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// A name for the secret that's unique within the scope. + pub name: &'a str, + /// The plaintext secret value to be stored. + pub payload: &'a str, + /// Specifies the scoping of the secret. + /// + /// Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. + pub scope: CreateSecretServiceResourceSecretScope<'a>, +} +impl<'a> CreateSecretServiceResourceSecret<'a> { + pub fn new( + name: &'a str, + payload: &'a str, + scope: CreateSecretServiceResourceSecretScope<'a>, + ) -> Self { + Self { expand: Default::default(), expires_at: Default::default(), name, payload, scope } + } +} +/// Specifies the scoping of the secret. +/// +/// Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSecretServiceResourceSecretScope<'a> { + /// The secret scope type. + #[serde(rename = "type")] + pub type_: CreateSecretServiceResourceSecretScopeType, + /// The user ID. + /// + /// This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub user: Option<&'a str>, +} +impl<'a> CreateSecretServiceResourceSecretScope<'a> { + pub fn new(type_: CreateSecretServiceResourceSecretScopeType) -> Self { + Self { type_, user: Default::default() } + } +} +/// The secret scope type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSecretServiceResourceSecretScopeType { + Account, + User, +} +impl CreateSecretServiceResourceSecretScopeType { + pub fn as_str(self) -> &'static str { + use CreateSecretServiceResourceSecretScopeType::*; + match self { + Account => "account", + User => "user", + } + } +} + +impl std::str::FromStr for CreateSecretServiceResourceSecretScopeType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSecretServiceResourceSecretScopeType::*; + match s { + "account" => Ok(Account), + "user" => Ok(User), + _ => Err(()), + } + } +} +impl AsRef for CreateSecretServiceResourceSecretScopeType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSecretServiceResourceSecretScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSecretServiceResourceSecretScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSecretServiceResourceSecretScopeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateSecretServiceResourceSecret<'a> { + /// Create or replace a secret in the secret store. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/apps/secrets", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct DeleteWhereSecretServiceResourceSecret<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A name for the secret that's unique within the scope. + pub name: &'a str, + /// Specifies the scoping of the secret. + /// + /// Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. + pub scope: DeleteWhereSecretServiceResourceSecretScope<'a>, +} +impl<'a> DeleteWhereSecretServiceResourceSecret<'a> { + pub fn new(name: &'a str, scope: DeleteWhereSecretServiceResourceSecretScope<'a>) -> Self { + Self { expand: Default::default(), name, scope } + } +} +/// Specifies the scoping of the secret. +/// +/// Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct DeleteWhereSecretServiceResourceSecretScope<'a> { + /// The secret scope type. + #[serde(rename = "type")] + pub type_: DeleteWhereSecretServiceResourceSecretScopeType, + /// The user ID. + /// + /// This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub user: Option<&'a str>, +} +impl<'a> DeleteWhereSecretServiceResourceSecretScope<'a> { + pub fn new(type_: DeleteWhereSecretServiceResourceSecretScopeType) -> Self { + Self { type_, user: Default::default() } + } +} +/// The secret scope type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum DeleteWhereSecretServiceResourceSecretScopeType { + Account, + User, +} +impl DeleteWhereSecretServiceResourceSecretScopeType { + pub fn as_str(self) -> &'static str { + use DeleteWhereSecretServiceResourceSecretScopeType::*; + match self { + Account => "account", + User => "user", + } + } +} + +impl std::str::FromStr for DeleteWhereSecretServiceResourceSecretScopeType { + type Err = (); + fn from_str(s: &str) -> Result { + use DeleteWhereSecretServiceResourceSecretScopeType::*; + match s { + "account" => Ok(Account), + "user" => Ok(User), + _ => Err(()), + } + } +} +impl AsRef for DeleteWhereSecretServiceResourceSecretScopeType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for DeleteWhereSecretServiceResourceSecretScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for DeleteWhereSecretServiceResourceSecretScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for DeleteWhereSecretServiceResourceSecretScopeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> DeleteWhereSecretServiceResourceSecret<'a> { + /// Deletes a secret from the secret store by name and scope. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/apps/secrets/delete", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListSecretServiceResourceSecret<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Specifies the scoping of the secret. + /// + /// Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. + pub scope: ListSecretServiceResourceSecretScope<'a>, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListSecretServiceResourceSecret<'a> { + pub fn new(scope: ListSecretServiceResourceSecretScope<'a>) -> Self { + Self { + ending_before: Default::default(), + expand: Default::default(), + limit: Default::default(), + scope, + starting_after: Default::default(), + } + } +} +/// Specifies the scoping of the secret. +/// +/// Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListSecretServiceResourceSecretScope<'a> { + /// The secret scope type. + #[serde(rename = "type")] + pub type_: ListSecretServiceResourceSecretScopeType, + /// The user ID. + /// + /// This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub user: Option<&'a str>, +} +impl<'a> ListSecretServiceResourceSecretScope<'a> { + pub fn new(type_: ListSecretServiceResourceSecretScopeType) -> Self { + Self { type_, user: Default::default() } + } +} +/// The secret scope type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListSecretServiceResourceSecretScopeType { + Account, + User, +} +impl ListSecretServiceResourceSecretScopeType { + pub fn as_str(self) -> &'static str { + use ListSecretServiceResourceSecretScopeType::*; + match self { + Account => "account", + User => "user", + } + } +} + +impl std::str::FromStr for ListSecretServiceResourceSecretScopeType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListSecretServiceResourceSecretScopeType::*; + match s { + "account" => Ok(Account), + "user" => Ok(User), + _ => Err(()), + } + } +} +impl AsRef for ListSecretServiceResourceSecretScopeType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListSecretServiceResourceSecretScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListSecretServiceResourceSecretScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListSecretServiceResourceSecretScopeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListSecretServiceResourceSecret<'a> { + /// List all secrets stored on the given scope. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/apps/secrets", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/apps/secrets", self) + } +} +impl<'a> stripe::PaginationParams for ListSecretServiceResourceSecret<'a> {} diff --git a/generated/stripe_connect/src/topup/mod.rs b/generated/stripe_connect/src/topup/mod.rs new file mode 100644 index 000000000..c24717427 --- /dev/null +++ b/generated/stripe_connect/src/topup/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::topup::*; +#[cfg(feature = "topup")] +mod requests; +#[cfg(feature = "topup")] +pub use requests::*; diff --git a/generated/stripe_connect/src/topup/requests.rs b/generated/stripe_connect/src/topup/requests.rs new file mode 100644 index 000000000..24dfe4421 --- /dev/null +++ b/generated/stripe_connect/src/topup/requests.rs @@ -0,0 +1,252 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTopup<'a> { + /// A positive integer representing how much to transfer. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The ID of a source to transfer funds from. + /// + /// For most users, this should be left unspecified which will use the bank account that was set up in the dashboard for the specified currency. + /// In test mode, this can be a test bank token (see [Testing Top-ups](https://stripe.com/docs/connect/testing#testing-top-ups)). + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option<&'a str>, + /// Extra information about a top-up for the source's bank statement. + /// + /// Limited to 15 ASCII characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// A string that identifies this top-up as part of a group. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> CreateTopup<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { + amount, + currency, + description: Default::default(), + expand: Default::default(), + metadata: Default::default(), + source: Default::default(), + statement_descriptor: Default::default(), + transfer_group: Default::default(), + } + } +} +impl<'a> CreateTopup<'a> { + /// Top up the balance of an account. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/topups", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTopup<'a> { + /// A positive integer representing how much to transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// A filter on the list, based on the object `created` field. + /// + /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return top-ups that have the given status. + /// + /// One of `canceled`, `failed`, `pending` or `succeeded`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTopup<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Only return top-ups that have the given status. +/// +/// One of `canceled`, `failed`, `pending` or `succeeded`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTopupStatus { + Canceled, + Failed, + Pending, + Succeeded, +} +impl ListTopupStatus { + pub fn as_str(self) -> &'static str { + use ListTopupStatus::*; + match self { + Canceled => "canceled", + Failed => "failed", + Pending => "pending", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for ListTopupStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTopupStatus::*; + match s { + "canceled" => Ok(Canceled), + "failed" => Ok(Failed), + "pending" => Ok(Pending), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl AsRef for ListTopupStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListTopupStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTopupStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTopupStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListTopup<'a> { + /// Returns a list of top-ups. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/topups", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/topups", self) + } +} +impl<'a> stripe::PaginationParams for ListTopup<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTopup<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTopup<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTopup<'a> { + /// Retrieves the details of a top-up that has previously been created. + /// + /// Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information. + pub fn send( + &self, + client: &stripe::Client, + topup: &stripe_types::topup::TopupId, + ) -> stripe::Response { + client.get_query(&format!("/topups/{topup}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTopup<'a> { + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateTopup<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateTopup<'a> { + /// Updates the metadata of a top-up. + /// + /// Other top-up details are not editable by design. + pub fn send( + &self, + client: &stripe::Client, + topup: &stripe_types::topup::TopupId, + ) -> stripe::Response { + client.send_form(&format!("/topups/{topup}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelTopup<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelTopup<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelTopup<'a> { + /// Cancels a top-up. + /// + /// Only pending top-ups can be canceled. + pub fn send( + &self, + client: &stripe::Client, + topup: &stripe_types::topup::TopupId, + ) -> stripe::Response { + client.send_form(&format!("/topups/{topup}/cancel"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_connect/src/transfer/mod.rs b/generated/stripe_connect/src/transfer/mod.rs new file mode 100644 index 000000000..1a63ac5bf --- /dev/null +++ b/generated/stripe_connect/src/transfer/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::transfer::*; +#[cfg(feature = "transfer")] +mod requests; +#[cfg(feature = "transfer")] +pub use requests::*; diff --git a/generated/stripe_connect/src/transfer/requests.rs b/generated/stripe_connect/src/transfer/requests.rs new file mode 100644 index 000000000..63649d4b5 --- /dev/null +++ b/generated/stripe_connect/src/transfer/requests.rs @@ -0,0 +1,233 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTransfer<'a> { + /// A positive integer in cents (or local equivalent) representing how much to transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// 3-letter [ISO code for currency](https://stripe.com/docs/payouts). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The ID of a connected Stripe account. + /// + /// [See the Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + pub destination: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// You can use this parameter to transfer funds from a charge before they are added to your available balance. + /// + /// A pending balance will transfer immediately but the funds will not become available until the original charge becomes available. + /// [See the Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-availability) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub source_transaction: Option<&'a str>, + /// The source balance to use for this transfer. + /// + /// One of `bank_account`, `card`, or `fpx`. + /// For most users, this will default to `card`. + #[serde(skip_serializing_if = "Option::is_none")] + pub source_type: Option, + /// A string that identifies this transaction as part of a group. + /// + /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> CreateTransfer<'a> { + pub fn new(currency: stripe_types::Currency, destination: &'a str) -> Self { + Self { + amount: Default::default(), + currency, + description: Default::default(), + destination, + expand: Default::default(), + metadata: Default::default(), + source_transaction: Default::default(), + source_type: Default::default(), + transfer_group: Default::default(), + } + } +} +/// The source balance to use for this transfer. +/// +/// One of `bank_account`, `card`, or `fpx`. +/// For most users, this will default to `card`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTransferSourceType { + BankAccount, + Card, + Fpx, +} +impl CreateTransferSourceType { + pub fn as_str(self) -> &'static str { + use CreateTransferSourceType::*; + match self { + BankAccount => "bank_account", + Card => "card", + Fpx => "fpx", + } + } +} + +impl std::str::FromStr for CreateTransferSourceType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTransferSourceType::*; + match s { + "bank_account" => Ok(BankAccount), + "card" => Ok(Card), + "fpx" => Ok(Fpx), + _ => Err(()), + } + } +} +impl AsRef for CreateTransferSourceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTransferSourceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTransferSourceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTransferSourceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateTransfer<'a> { + /// To send funds from your Stripe account to a connected account, you create a new transfer object. + /// + /// Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you’ll receive an “Insufficient Funds” error. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/transfers", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTransfer<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return transfers for the destination specified by this account ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return transfers with the specified transfer group. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> ListTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTransfer<'a> { + /// Returns a list of existing transfers sent to connected accounts. + /// + /// The transfers are returned in sorted order, with the most recently created transfers appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/transfers", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/transfers", self) + } +} +impl<'a> stripe::PaginationParams for ListTransfer<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTransfer<'a> { + /// Retrieves the details of an existing transfer. + /// + /// Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information. + pub fn send( + &self, + client: &stripe::Client, + transfer: &stripe_types::transfer::TransferId, + ) -> stripe::Response { + client.get_query(&format!("/transfers/{transfer}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTransfer<'a> { + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateTransfer<'a> { + /// Updates the specified transfer by setting the values of the parameters passed. + /// + /// Any parameters not provided will be left unchanged. This request accepts only metadata as an argument. + pub fn send( + &self, + client: &stripe::Client, + transfer: &stripe_types::transfer::TransferId, + ) -> stripe::Response { + client.send_form(&format!("/transfers/{transfer}"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_connect/src/transfer_data/mod.rs b/generated/stripe_connect/src/transfer_data/mod.rs new file mode 100644 index 000000000..2d1bdf26d --- /dev/null +++ b/generated/stripe_connect/src/transfer_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::transfer_data::*; \ No newline at end of file diff --git a/generated/stripe_connect/src/transfer_reversal/mod.rs b/generated/stripe_connect/src/transfer_reversal/mod.rs new file mode 100644 index 000000000..9794262b8 --- /dev/null +++ b/generated/stripe_connect/src/transfer_reversal/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::transfer_reversal::*; +#[cfg(feature = "transfer_reversal")] +mod requests; +#[cfg(feature = "transfer_reversal")] +pub use requests::*; diff --git a/generated/stripe_connect/src/transfer_reversal/requests.rs b/generated/stripe_connect/src/transfer_reversal/requests.rs new file mode 100644 index 000000000..b78cc8285 --- /dev/null +++ b/generated/stripe_connect/src/transfer_reversal/requests.rs @@ -0,0 +1,157 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTransferReversal<'a> { + /// A positive integer in cents (or local equivalent) representing how much of this transfer to reverse. + /// + /// Can only reverse up to the unreversed amount remaining of the transfer. + /// Partial transfer reversals are only allowed for transfers to Stripe Accounts. + /// Defaults to the entire transfer amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// An arbitrary string which you can attach to a reversal object. + /// + /// It is displayed alongside the reversal in the Dashboard. + /// This will be unset if you POST an empty value. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Boolean indicating whether the application fee should be refunded when reversing this transfer. + /// + /// If a full transfer reversal is given, the full application fee will be refunded. + /// Otherwise, the application fee will be refunded with an amount proportional to the amount of the transfer reversed. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_application_fee: Option, +} +impl<'a> CreateTransferReversal<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateTransferReversal<'a> { + /// When you create a new reversal, you must specify a transfer to create it on. + /// + /// When reversing transfers, you can optionally reverse part of the transfer. + /// + /// You can do so as many times as you wish until the entire transfer has been reversed. Once entirely reversed, a transfer can’t be reversed again. + /// This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_types::transfer_reversal::TransferReversalId, + ) -> stripe::Response { + client.send_form(&format!("/transfers/{id}/reversals"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTransferReversal<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListTransferReversal<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTransferReversal<'a> { + /// You can see a list of the reversals belonging to a specific transfer. + /// + /// Note that the 10 most recent reversals are always available by default on the transfer object. + /// If you need more than those 10, you can use this API method and the `limit` and `starting_after` parameters to page through additional reversals. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_types::transfer_reversal::TransferReversalId, + ) -> stripe::Response> { + client.get_query(&format!("/transfers/{id}/reversals"), self) + } + pub fn paginate( + self, + id: &stripe_types::transfer_reversal::TransferReversalId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params(&format!("/transfers/{id}/reversals"), self) + } +} +impl<'a> stripe::PaginationParams for ListTransferReversal<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTransferReversal<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTransferReversal<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTransferReversal<'a> { + /// By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. + pub fn send( + &self, + client: &stripe::Client, + id: &str, + transfer: &stripe_types::transfer::TransferId, + ) -> stripe::Response { + client.get_query(&format!("/transfers/{transfer}/reversals/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTransferReversal<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateTransferReversal<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateTransferReversal<'a> { + /// Updates the specified reversal by setting the values of the parameters passed. + /// + /// Any parameters not provided will be left unchanged. This request only accepts metadata and description as arguments. + pub fn send( + &self, + client: &stripe::Client, + id: &str, + transfer: &stripe_types::transfer::TransferId, + ) -> stripe::Response { + client.send_form( + &format!("/transfers/{transfer}/reversals/{id}"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_connect/src/transfer_schedule/mod.rs b/generated/stripe_connect/src/transfer_schedule/mod.rs new file mode 100644 index 000000000..5458153a4 --- /dev/null +++ b/generated/stripe_connect/src/transfer_schedule/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::transfer_schedule::*; \ No newline at end of file diff --git a/generated/stripe_core/Cargo.toml b/generated/stripe_core/Cargo.toml new file mode 100644 index 000000000..9417fd202 --- /dev/null +++ b/generated/stripe_core/Cargo.toml @@ -0,0 +1,77 @@ +[package] +name = "stripe_core" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + +[dependencies] +serde.workspace = true +http-types.workspace = true +smol_str.workspace = true +serde_json.workspace = true +async-stripe = {path = "../../async-stripe"} + +stripe_types = {path = "../../stripe_types"} + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +balance = [] +balance_transaction = [] +cash_balance = [] +charge = [] +customer = [] +customer_balance_transaction = [] +customer_cash_balance_transaction = [] +dispute = [] +file = [] +file_link = [] +mandate = [] +notification_event = [] +payment_flows_setup_intent_setup_attempt = [] +payment_intent = [] +payment_source = [] +payout = [] +refund = [] +setup_intent = [] +token = [] + +full = ["balance", +"balance_transaction", +"cash_balance", +"charge", +"customer", +"customer_balance_transaction", +"customer_cash_balance_transaction", +"dispute", +"file", +"file_link", +"mandate", +"notification_event", +"payment_flows_setup_intent_setup_attempt", +"payment_intent", +"payment_source", +"payout", +"refund", +"setup_intent", +"token"] + diff --git a/generated/stripe_core/src/balance/mod.rs b/generated/stripe_core/src/balance/mod.rs new file mode 100644 index 000000000..97b035985 --- /dev/null +++ b/generated/stripe_core/src/balance/mod.rs @@ -0,0 +1,30 @@ +/// This is an object representing your Stripe balance. +/// +/// You can retrieve it to see the balance currently on your Stripe account. You can also retrieve the balance history, which contains a list of [transactions](https://stripe.com/docs/reporting/balance-transaction-types) that contributed to the balance (charges, payouts, and so forth). The available and pending amounts for each currency are broken down further by payment source types. Related guide: [Understanding Connect account balances](https://stripe.com/docs/connect/account-balances) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Balance { + /// Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). + /// + /// You can find the available balance for each currency and payment type in the `source_types` property. + pub available: Vec, + /// Funds held due to negative balances on connected Custom accounts. + /// + /// You can find the connect reserve balance for each currency and payment type in the `source_types` property. + #[serde(skip_serializing_if = "Option::is_none")] + pub connect_reserved: Option>, + /// Funds that you can pay out using Instant Payouts. + #[serde(skip_serializing_if = "Option::is_none")] + pub instant_available: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub issuing: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Funds that aren't available in the balance yet. + /// + /// You can find the pending balance for each currency and each payment type in the `source_types` property. + pub pending: Vec, +} +#[cfg(feature = "balance")] +mod requests; +#[cfg(feature = "balance")] +pub use requests::*; diff --git a/generated/stripe_core/src/balance/requests.rs b/generated/stripe_core/src/balance/requests.rs new file mode 100644 index 000000000..22b34eb9b --- /dev/null +++ b/generated/stripe_core/src/balance/requests.rs @@ -0,0 +1,18 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveForMyAccountBalance<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveForMyAccountBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveForMyAccountBalance<'a> { + /// Retrieves the current account balance, based on the authentication that was used to make the request. + /// For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances). + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.get_query("/balance", self) + } +} diff --git a/generated/stripe_core/src/balance_amount/mod.rs b/generated/stripe_core/src/balance_amount/mod.rs new file mode 100644 index 000000000..710dbb1ab --- /dev/null +++ b/generated/stripe_core/src/balance_amount/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BalanceAmount { + /// Balance amount. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + #[serde(skip_serializing_if = "Option::is_none")] + pub source_types: Option, +} diff --git a/generated/stripe_core/src/balance_amount_by_source_type/mod.rs b/generated/stripe_core/src/balance_amount_by_source_type/mod.rs new file mode 100644 index 000000000..6fbb1b6eb --- /dev/null +++ b/generated/stripe_core/src/balance_amount_by_source_type/mod.rs @@ -0,0 +1,12 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct BalanceAmountBySourceType { + /// Amount for bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_account: Option, + /// Amount for card. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + /// Amount for FPX. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, +} diff --git a/generated/stripe_core/src/balance_amount_net/mod.rs b/generated/stripe_core/src/balance_amount_net/mod.rs new file mode 100644 index 000000000..a88589f3e --- /dev/null +++ b/generated/stripe_core/src/balance_amount_net/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BalanceAmountNet { + /// Balance amount. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + #[serde(skip_serializing_if = "Option::is_none")] + pub source_types: Option, +} diff --git a/generated/stripe_core/src/balance_detail/mod.rs b/generated/stripe_core/src/balance_detail/mod.rs new file mode 100644 index 000000000..c7cdd9af8 --- /dev/null +++ b/generated/stripe_core/src/balance_detail/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BalanceDetail { + /// Funds that are available for use. + pub available: Vec, +} diff --git a/generated/stripe_core/src/balance_transaction/mod.rs b/generated/stripe_core/src/balance_transaction/mod.rs new file mode 100644 index 000000000..14071944a --- /dev/null +++ b/generated/stripe_core/src/balance_transaction/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::balance_transaction::*; +#[cfg(feature = "balance_transaction")] +mod requests; +#[cfg(feature = "balance_transaction")] +pub use requests::*; diff --git a/generated/stripe_core/src/balance_transaction/requests.rs b/generated/stripe_core/src/balance_transaction/requests.rs new file mode 100644 index 000000000..4cff5c53f --- /dev/null +++ b/generated/stripe_core/src/balance_transaction/requests.rs @@ -0,0 +1,86 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListBalanceTransaction<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return transactions in a certain currency. + /// + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// For automatic Stripe payouts only, only returns transactions that were paid out on the specified payout ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub payout: Option<&'a str>, + /// Only returns the original transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only returns transactions of the given type. + /// + /// One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option<&'a str>, +} +impl<'a> ListBalanceTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListBalanceTransaction<'a> { + /// Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). + /// + /// The transactions are returned in sorted order, with the most recent transactions appearing first. Note that this endpoint was previously called “Balance history” and used the path `/v1/balance/history`. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/balance_transactions", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/balance_transactions", self) + } +} +impl<'a> stripe::PaginationParams for ListBalanceTransaction<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveBalanceTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveBalanceTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveBalanceTransaction<'a> { + /// Retrieves the balance transaction with the given ID. + /// + /// Note that this endpoint previously used the path `/v1/balance/history/:id`. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_types::balance_transaction::BalanceTransactionId, + ) -> stripe::Response { + client.get_query(&format!("/balance_transactions/{id}"), self) + } +} diff --git a/generated/stripe_core/src/balance_transaction_source/mod.rs b/generated/stripe_core/src/balance_transaction_source/mod.rs new file mode 100644 index 000000000..9b7fe542f --- /dev/null +++ b/generated/stripe_core/src/balance_transaction_source/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::balance_transaction_source::*; \ No newline at end of file diff --git a/generated/stripe_core/src/cash_balance/mod.rs b/generated/stripe_core/src/cash_balance/mod.rs new file mode 100644 index 000000000..0370f63dc --- /dev/null +++ b/generated/stripe_core/src/cash_balance/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::cash_balance::*; +#[cfg(feature = "cash_balance")] +mod requests; +#[cfg(feature = "cash_balance")] +pub use requests::*; diff --git a/generated/stripe_core/src/cash_balance/requests.rs b/generated/stripe_core/src/cash_balance/requests.rs new file mode 100644 index 000000000..f478a65bd --- /dev/null +++ b/generated/stripe_core/src/cash_balance/requests.rs @@ -0,0 +1,121 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCashBalance<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCashBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCashBalance<'a> { + /// Retrieves a customer’s cash balance. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::Response { + client.get_query(&format!("/customers/{customer}/cash_balance"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCashBalance<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A hash of settings for this cash balance. + #[serde(skip_serializing_if = "Option::is_none")] + pub settings: Option, +} +impl<'a> UpdateCashBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A hash of settings for this cash balance. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCashBalanceSettings { + /// Controls how funds transferred by the customer are applied to payment intents and invoices. + /// + /// Valid options are `automatic`, `manual`, or `merchant_default`. + /// For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). + #[serde(skip_serializing_if = "Option::is_none")] + pub reconciliation_mode: Option, +} +impl UpdateCashBalanceSettings { + pub fn new() -> Self { + Self::default() + } +} +/// Controls how funds transferred by the customer are applied to payment intents and invoices. +/// +/// Valid options are `automatic`, `manual`, or `merchant_default`. +/// For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateCashBalanceSettingsReconciliationMode { + Automatic, + Manual, + MerchantDefault, +} +impl UpdateCashBalanceSettingsReconciliationMode { + pub fn as_str(self) -> &'static str { + use UpdateCashBalanceSettingsReconciliationMode::*; + match self { + Automatic => "automatic", + Manual => "manual", + MerchantDefault => "merchant_default", + } + } +} + +impl std::str::FromStr for UpdateCashBalanceSettingsReconciliationMode { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateCashBalanceSettingsReconciliationMode::*; + match s { + "automatic" => Ok(Automatic), + "manual" => Ok(Manual), + "merchant_default" => Ok(MerchantDefault), + _ => Err(()), + } + } +} +impl AsRef for UpdateCashBalanceSettingsReconciliationMode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateCashBalanceSettingsReconciliationMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateCashBalanceSettingsReconciliationMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateCashBalanceSettingsReconciliationMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateCashBalance<'a> { + /// Changes the settings on a customer’s cash balance. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/cash_balance"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_core/src/charge/mod.rs b/generated/stripe_core/src/charge/mod.rs new file mode 100644 index 000000000..be917317a --- /dev/null +++ b/generated/stripe_core/src/charge/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::charge::*; +#[cfg(feature = "charge")] +mod requests; +#[cfg(feature = "charge")] +pub use requests::*; diff --git a/generated/stripe_core/src/charge/requests.rs b/generated/stripe_core/src/charge/requests.rs new file mode 100644 index 000000000..07f0b1c1d --- /dev/null +++ b/generated/stripe_core/src/charge/requests.rs @@ -0,0 +1,688 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SearchCharge<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for pagination across multiple pages of results. + /// + /// Don't include this parameter on the first call. + /// Use the next_page value returned in a previous response to request subsequent results. + #[serde(skip_serializing_if = "Option::is_none")] + pub page: Option<&'a str>, + /// The search query string. + /// + /// See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for charges](https://stripe.com/docs/search#query-fields-for-charges). + pub query: &'a str, +} +impl<'a> SearchCharge<'a> { + pub fn new(query: &'a str) -> Self { + Self { + expand: Default::default(), + limit: Default::default(), + page: Default::default(), + query, + } + } +} +impl<'a> SearchCharge<'a> { + /// Search for charges you’ve previously created using Stripe’s [Search Query Language](https://stripe.com/docs/search#search-query-language). + /// Don’t use search in read-after-write flows where strict consistency is necessary. + /// + /// Under normal operating conditions, data is searchable in less than a minute. + /// Occasionally, propagation of new or updated data can be up to an hour behind during outages. + /// Search functionality is not available to merchants in India. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.get_query("/charges/search", self) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SearchReturned { + pub data: Vec, + pub has_more: bool, + pub next_page: Option, + /// String representing the object's type. + /// + /// Objects of the same type share the same value. + pub object: SearchReturnedObject, + /// The total number of objects that match the query, only accurate up to 10,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub total_count: Option, + pub url: String, +} +/// String representing the object's type. +/// +/// Objects of the same type share the same value. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SearchReturnedObject { + SearchResult, +} +impl SearchReturnedObject { + pub fn as_str(self) -> &'static str { + use SearchReturnedObject::*; + match self { + SearchResult => "search_result", + } + } +} + +impl std::str::FromStr for SearchReturnedObject { + type Err = (); + fn from_str(s: &str) -> Result { + use SearchReturnedObject::*; + match s { + "search_result" => Ok(SearchResult), + _ => Err(()), + } + } +} +impl AsRef for SearchReturnedObject { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SearchReturnedObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SearchReturnedObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SearchReturnedObject { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SearchReturnedObject { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SearchReturnedObject")) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCharge<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return charges for the customer specified by this customer ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return charges for this transfer group. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> ListCharge<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCharge<'a> { + /// Returns a list of charges you’ve previously created. + /// + /// The charges are returned in sorted order, with the most recent charges appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/charges", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/charges", self) + } +} +impl<'a> stripe::PaginationParams for ListCharge<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCharge<'a> { + /// Amount intended to be collected by this payment. + /// + /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee: Option, + /// A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. + /// + /// The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. + /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// Whether to immediately capture the charge. + /// + /// Defaults to `true`. + /// When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://stripe.com/docs/api#capture_charge) later. + /// Uncaptured charges expire after a set number of days (7 by default). + /// For more information, see the [authorizing charges and settling later](https://stripe.com/docs/charges/placing-a-hold) documentation. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The ID of an existing customer that will be charged in this request. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// An arbitrary string which you can attach to a `Charge` object. + /// + /// It is displayed when in the web interface alongside the charge. + /// Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub destination: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The Stripe account ID for which these funds are intended. + /// + /// Automatically set if you use the `destination` parameter. + /// For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// Options to configure Radar. + /// + /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// The email address to which this charge's [receipt](https://stripe.com/docs/dashboard/receipts) will be sent. + /// + /// The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. + /// If this charge is for a [Customer](https://stripe.com/docs/api/customers/object), the email address specified here will override the customer's email address. + /// If `receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt_email: Option<&'a str>, + /// Shipping information for the charge. + /// + /// Helps prevent fraud on charges for physical goods. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// A payment source to be charged. + /// + /// This can be the ID of a [card](https://stripe.com/docs/api#cards) (i.e., credit or debit card), a [bank account](https://stripe.com/docs/api#bank_accounts), a [source](https://stripe.com/docs/api#sources), a [token](https://stripe.com/docs/api#tokens), or a [connected account](https://stripe.com/docs/connect/account-debits#charging-a-connected-account). + /// For certain sources---namely, [cards](https://stripe.com/docs/api#cards), [bank accounts](https://stripe.com/docs/api#bank_accounts), and attached [sources](https://stripe.com/docs/api#sources)---you must also pass the ID of the associated customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option<&'a str>, + /// For card charges, use `statement_descriptor_suffix` instead. + /// + /// Otherwise, you can use this value as the complete description of a charge on your customers’ statements. + /// Must contain at least one letter, maximum 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// Provides information about the charge that customers see on their statements. + /// + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters for the concatenated descriptor. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix: Option<&'a str>, + /// An optional dictionary including the account to automatically transfer to as part of a destination charge. + /// + /// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, + /// A string that identifies this transaction as part of a group. + /// + /// For details, see [Grouping transactions](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> CreateCharge<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateChargeDestination<'a> { + /// ID of an existing, connected Stripe account. + pub account: &'a str, + /// The amount to transfer to the destination account without creating an `Application Fee` object. + /// + /// Cannot be combined with the `application_fee` parameter. + /// Must be less than or equal to the charge amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, +} +impl<'a> CreateChargeDestination<'a> { + pub fn new(account: &'a str) -> Self { + Self { account, amount: Default::default() } + } +} +/// Options to configure Radar. +/// +/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateChargeRadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> CreateChargeRadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Shipping information for the charge. +/// +/// Helps prevent fraud on charges for physical goods. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateChargeShipping<'a> { + /// Shipping address. + pub address: CreateChargeShippingAddress<'a>, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// Recipient name. + pub name: &'a str, + /// Recipient phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The tracking number for a physical product, obtained from the delivery service. + /// + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub tracking_number: Option<&'a str>, +} +impl<'a> CreateChargeShipping<'a> { + pub fn new(address: CreateChargeShippingAddress<'a>, name: &'a str) -> Self { + Self { + address, + carrier: Default::default(), + name, + phone: Default::default(), + tracking_number: Default::default(), + } + } +} +/// Shipping address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateChargeShippingAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateChargeShippingAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An optional dictionary including the account to automatically transfer to as part of a destination charge. +/// +/// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateChargeTransferData<'a> { + /// The amount transferred to the destination account, if specified. + /// + /// By default, the entire charge amount is transferred to the destination account. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> CreateChargeTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount: Default::default(), destination } + } +} +impl<'a> CreateCharge<'a> { + /// Use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) to initiate a new payment instead + /// of using this method. + /// + /// Confirmation of the PaymentIntent creates the `Charge` object used to request payment, so this method is limited to legacy integrations. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/charges", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCharge<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCharge<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCharge<'a> { + /// Retrieves the details of a charge that has previously been created. + /// + /// Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. + /// The same information is returned when creating or refunding the charge. + pub fn send( + &self, + client: &stripe::Client, + charge: &stripe_types::charge::ChargeId, + ) -> stripe::Response { + client.get_query(&format!("/charges/{charge}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCharge<'a> { + /// The ID of an existing customer that will be associated with this request. + /// + /// This field may only be updated if there is no existing associated customer with this charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// An arbitrary string which you can attach to a charge object. + /// + /// It is displayed when in the web interface alongside the charge. + /// Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A set of key-value pairs you can attach to a charge giving information about its riskiness. + /// + /// If you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`. + /// If you believe a charge is safe, include a `user_report` key with a value of `safe`. + /// Stripe will use the information you send to improve our fraud detection algorithms. + #[serde(skip_serializing_if = "Option::is_none")] + pub fraud_details: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// This is the email address that the receipt for this charge will be sent to. + /// + /// If this field is updated, then a new email receipt will be sent to the updated address. + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt_email: Option<&'a str>, + /// Shipping information for the charge. + /// + /// Helps prevent fraud on charges for physical goods. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// A string that identifies this transaction as part of a group. + /// + /// `transfer_group` may only be provided if it has not been set. + /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> UpdateCharge<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A set of key-value pairs you can attach to a charge giving information about its riskiness. +/// +/// If you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`. +/// If you believe a charge is safe, include a `user_report` key with a value of `safe`. +/// Stripe will use the information you send to improve our fraud detection algorithms. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateChargeFraudDetails { + /// Either `safe` or `fraudulent`. + pub user_report: UpdateChargeFraudDetailsUserReport, +} +impl UpdateChargeFraudDetails { + pub fn new(user_report: UpdateChargeFraudDetailsUserReport) -> Self { + Self { user_report } + } +} +/// Either `safe` or `fraudulent`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateChargeFraudDetailsUserReport { + Fraudulent, + Safe, +} +impl UpdateChargeFraudDetailsUserReport { + pub fn as_str(self) -> &'static str { + use UpdateChargeFraudDetailsUserReport::*; + match self { + Fraudulent => "fraudulent", + Safe => "safe", + } + } +} + +impl std::str::FromStr for UpdateChargeFraudDetailsUserReport { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateChargeFraudDetailsUserReport::*; + match s { + "fraudulent" => Ok(Fraudulent), + "safe" => Ok(Safe), + _ => Err(()), + } + } +} +impl AsRef for UpdateChargeFraudDetailsUserReport { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateChargeFraudDetailsUserReport { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateChargeFraudDetailsUserReport { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateChargeFraudDetailsUserReport { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Shipping information for the charge. +/// +/// Helps prevent fraud on charges for physical goods. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateChargeShipping<'a> { + /// Shipping address. + pub address: UpdateChargeShippingAddress<'a>, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// Recipient name. + pub name: &'a str, + /// Recipient phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The tracking number for a physical product, obtained from the delivery service. + /// + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub tracking_number: Option<&'a str>, +} +impl<'a> UpdateChargeShipping<'a> { + pub fn new(address: UpdateChargeShippingAddress<'a>, name: &'a str) -> Self { + Self { + address, + carrier: Default::default(), + name, + phone: Default::default(), + tracking_number: Default::default(), + } + } +} +/// Shipping address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateChargeShippingAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateChargeShippingAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateCharge<'a> { + /// Updates the specified charge by setting the values of the parameters passed. + /// + /// Any parameters not provided will be left unchanged. + pub fn send( + &self, + client: &stripe::Client, + charge: &stripe_types::charge::ChargeId, + ) -> stripe::Response { + client.send_form(&format!("/charges/{charge}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureCharge<'a> { + /// The amount to capture, which must be less than or equal to the original amount. + /// + /// Any additional amount will be automatically refunded. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// An application fee to add on to this charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee: Option, + /// An application fee amount to add on to this charge, which must be less than or equal to the original amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The email address to send this charge's receipt to. + /// + /// This will override the previously-specified email address for this charge, if one was set. + /// Receipts will not be sent in test mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt_email: Option<&'a str>, + /// For card charges, use `statement_descriptor_suffix` instead. + /// + /// Otherwise, you can use this value as the complete description of a charge on your customers’ statements. + /// Must contain at least one letter, maximum 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// Provides information about the charge that customers see on their statements. + /// + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters for the concatenated descriptor. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix: Option<&'a str>, + /// An optional dictionary including the account to automatically transfer to as part of a destination charge. + /// + /// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option, + /// A string that identifies this transaction as part of a group. + /// + /// `transfer_group` may only be provided if it has not been set. + /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> CaptureCharge<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An optional dictionary including the account to automatically transfer to as part of a destination charge. +/// +/// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureChargeTransferData { + /// The amount transferred to the destination account, if specified. + /// + /// By default, the entire charge amount is transferred to the destination account. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, +} +impl CaptureChargeTransferData { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CaptureCharge<'a> { + /// Capture the payment of an existing, uncaptured charge that was created with the `capture` option set to false. + /// + /// Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. + /// + /// Don’t use this method to capture a PaymentIntent-initiated charge. + /// + /// Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). + pub fn send( + &self, + client: &stripe::Client, + charge: &stripe_types::charge::ChargeId, + ) -> stripe::Response { + client.send_form(&format!("/charges/{charge}/capture"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_core/src/charge_fraud_details/mod.rs b/generated/stripe_core/src/charge_fraud_details/mod.rs new file mode 100644 index 000000000..37b7a31ae --- /dev/null +++ b/generated/stripe_core/src/charge_fraud_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::charge_fraud_details::*; \ No newline at end of file diff --git a/generated/stripe_core/src/charge_outcome/mod.rs b/generated/stripe_core/src/charge_outcome/mod.rs new file mode 100644 index 000000000..3590242f7 --- /dev/null +++ b/generated/stripe_core/src/charge_outcome/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::charge_outcome::*; \ No newline at end of file diff --git a/generated/stripe_core/src/charge_transfer_data/mod.rs b/generated/stripe_core/src/charge_transfer_data/mod.rs new file mode 100644 index 000000000..c8e517d39 --- /dev/null +++ b/generated/stripe_core/src/charge_transfer_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::charge_transfer_data::*; \ No newline at end of file diff --git a/generated/stripe_core/src/connect_collection_transfer/mod.rs b/generated/stripe_core/src/connect_collection_transfer/mod.rs new file mode 100644 index 000000000..68553be05 --- /dev/null +++ b/generated/stripe_core/src/connect_collection_transfer/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::connect_collection_transfer::*; \ No newline at end of file diff --git a/generated/stripe_core/src/customer/mod.rs b/generated/stripe_core/src/customer/mod.rs new file mode 100644 index 000000000..9edb01a81 --- /dev/null +++ b/generated/stripe_core/src/customer/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::customer::*; +#[cfg(feature = "customer")] +mod requests; +#[cfg(feature = "customer")] +pub use requests::*; diff --git a/generated/stripe_core/src/customer/requests.rs b/generated/stripe_core/src/customer/requests.rs new file mode 100644 index 000000000..c914c04f2 --- /dev/null +++ b/generated/stripe_core/src/customer/requests.rs @@ -0,0 +1,1950 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SearchCustomer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for pagination across multiple pages of results. + /// + /// Don't include this parameter on the first call. + /// Use the next_page value returned in a previous response to request subsequent results. + #[serde(skip_serializing_if = "Option::is_none")] + pub page: Option<&'a str>, + /// The search query string. + /// + /// See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for customers](https://stripe.com/docs/search#query-fields-for-customers). + pub query: &'a str, +} +impl<'a> SearchCustomer<'a> { + pub fn new(query: &'a str) -> Self { + Self { + expand: Default::default(), + limit: Default::default(), + page: Default::default(), + query, + } + } +} +impl<'a> SearchCustomer<'a> { + /// Search for customers you’ve previously created using Stripe’s [Search Query Language](https://stripe.com/docs/search#search-query-language). + /// Don’t use search in read-after-write flows where strict consistency is necessary. + /// + /// Under normal operating conditions, data is searchable in less than a minute. + /// Occasionally, propagation of new or updated data can be up to an hour behind during outages. + /// Search functionality is not available to merchants in India. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.get_query("/customers/search", self) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SearchReturned { + pub data: Vec, + pub has_more: bool, + pub next_page: Option, + /// String representing the object's type. + /// + /// Objects of the same type share the same value. + pub object: SearchReturnedObject, + /// The total number of objects that match the query, only accurate up to 10,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub total_count: Option, + pub url: String, +} +/// String representing the object's type. +/// +/// Objects of the same type share the same value. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SearchReturnedObject { + SearchResult, +} +impl SearchReturnedObject { + pub fn as_str(self) -> &'static str { + use SearchReturnedObject::*; + match self { + SearchResult => "search_result", + } + } +} + +impl std::str::FromStr for SearchReturnedObject { + type Err = (); + fn from_str(s: &str) -> Result { + use SearchReturnedObject::*; + match s { + "search_result" => Ok(SearchResult), + _ => Err(()), + } + } +} +impl AsRef for SearchReturnedObject { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SearchReturnedObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SearchReturnedObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SearchReturnedObject { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SearchReturnedObject { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SearchReturnedObject")) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCustomer<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A case-sensitive filter on the list based on the customer's `email` field. + /// + /// The value must be a string. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Provides a list of customers that are associated with the specified test clock. + /// + /// The response will not include customers with test clocks if this parameter is not set. + #[serde(skip_serializing_if = "Option::is_none")] + pub test_clock: Option<&'a str>, +} +impl<'a> ListCustomer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCustomer<'a> { + /// Returns a list of your customers. + /// + /// The customers are returned sorted by creation date, with the most recent customers appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/customers", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/customers", self) + } +} +impl<'a> stripe::PaginationParams for ListCustomer<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCustomer<'a> { + /// The customer's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. + /// + /// A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub balance: Option, + /// Balance information and default balance settings for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub cash_balance: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// An arbitrary string that you can attach to a customer object. + /// + /// It is displayed alongside the customer in the dashboard. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Customer's email address. + /// + /// It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. + /// This may be up to *512 characters*. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The prefix for the customer used to generate unique invoice numbers. + /// + /// Must be 3–12 uppercase letters or numbers. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_prefix: Option<&'a str>, + /// Default invoice settings for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The customer's full name or business name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// The sequence to be used on the customer's next invoice. + /// + /// Defaults to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub next_invoice_sequence: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// The customer's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// Customer's preferred languages, ordered by preference. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locales: Option<&'a [&'a str]>, + /// The API ID of a promotion code to apply to the customer. + /// + /// The customer will have a discount applied on all recurring payments. + /// Charges you create through the API will not have the discount. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option<&'a str>, + /// The customer's shipping information. + /// + /// Appears on invoices emailed to this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option<&'a str>, + /// Tax details about the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax: Option>, + /// The customer's tax exemption. + /// + /// One of `none`, `exempt`, or `reverse`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_exempt: Option, + /// The customer's tax IDs. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_data: Option<&'a [CreateCustomerTaxIdData<'a>]>, + /// ID of the test clock to attach to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub test_clock: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub validate: Option, +} +impl<'a> CreateCustomer<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCustomerAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateCustomerAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Balance information and default balance settings for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCustomerCashBalance { + /// Settings controlling the behavior of the customer's cash balance, + /// such as reconciliation of funds received. + #[serde(skip_serializing_if = "Option::is_none")] + pub settings: Option, +} +impl CreateCustomerCashBalance { + pub fn new() -> Self { + Self::default() + } +} +/// Settings controlling the behavior of the customer's cash balance, +/// such as reconciliation of funds received. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCustomerCashBalanceSettings { + /// Controls how funds transferred by the customer are applied to payment intents and invoices. + /// + /// Valid options are `automatic`, `manual`, or `merchant_default`. + /// For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). + #[serde(skip_serializing_if = "Option::is_none")] + pub reconciliation_mode: Option, +} +impl CreateCustomerCashBalanceSettings { + pub fn new() -> Self { + Self::default() + } +} +/// Controls how funds transferred by the customer are applied to payment intents and invoices. +/// +/// Valid options are `automatic`, `manual`, or `merchant_default`. +/// For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCustomerCashBalanceSettingsReconciliationMode { + Automatic, + Manual, + MerchantDefault, +} +impl CreateCustomerCashBalanceSettingsReconciliationMode { + pub fn as_str(self) -> &'static str { + use CreateCustomerCashBalanceSettingsReconciliationMode::*; + match self { + Automatic => "automatic", + Manual => "manual", + MerchantDefault => "merchant_default", + } + } +} + +impl std::str::FromStr for CreateCustomerCashBalanceSettingsReconciliationMode { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCustomerCashBalanceSettingsReconciliationMode::*; + match s { + "automatic" => Ok(Automatic), + "manual" => Ok(Manual), + "merchant_default" => Ok(MerchantDefault), + _ => Err(()), + } + } +} +impl AsRef for CreateCustomerCashBalanceSettingsReconciliationMode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateCustomerCashBalanceSettingsReconciliationMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCustomerCashBalanceSettingsReconciliationMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCustomerCashBalanceSettingsReconciliationMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Default invoice settings for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCustomerInvoiceSettings<'a> { + /// Default custom fields to be displayed on invoices for this customer. + /// + /// When updating, pass an empty string to remove previously-defined fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [CreateCustomerInvoiceSettingsCustomFields<'a>]>, + /// ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// Default footer to be displayed on invoices for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// Default options for invoice PDF rendering for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering_options: Option, +} +impl<'a> CreateCustomerInvoiceSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Default custom fields to be displayed on invoices for this customer. +/// +/// When updating, pass an empty string to remove previously-defined fields. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCustomerInvoiceSettingsCustomFields<'a> { + /// The name of the custom field. + /// + /// This may be up to 30 characters. + pub name: &'a str, + /// The value of the custom field. + /// + /// This may be up to 30 characters. + pub value: &'a str, +} +impl<'a> CreateCustomerInvoiceSettingsCustomFields<'a> { + pub fn new(name: &'a str, value: &'a str) -> Self { + Self { name, value } + } +} +/// Default options for invoice PDF rendering for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCustomerInvoiceSettingsRenderingOptions { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: Option, +} +impl CreateCustomerInvoiceSettingsRenderingOptions { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl CreateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use CreateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr for CreateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl AsRef for CreateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's shipping information. +/// +/// Appears on invoices emailed to this customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCustomerShipping<'a> { + /// Customer shipping address. + pub address: CreateCustomerShippingAddress<'a>, + /// Customer name. + pub name: &'a str, + /// Customer phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> CreateCustomerShipping<'a> { + pub fn new(address: CreateCustomerShippingAddress<'a>, name: &'a str) -> Self { + Self { address, name, phone: Default::default() } + } +} +/// Customer shipping address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCustomerShippingAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateCustomerShippingAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tax details about the customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCustomerTax<'a> { + /// A recent IP address of the customer used for tax reporting and tax location inference. + /// + /// Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. + /// We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_address: Option<&'a str>, +} +impl<'a> CreateCustomerTax<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's tax exemption. +/// +/// One of `none`, `exempt`, or `reverse`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCustomerTaxExempt { + Exempt, + None, + Reverse, +} +impl CreateCustomerTaxExempt { + pub fn as_str(self) -> &'static str { + use CreateCustomerTaxExempt::*; + match self { + Exempt => "exempt", + None => "none", + Reverse => "reverse", + } + } +} + +impl std::str::FromStr for CreateCustomerTaxExempt { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCustomerTaxExempt::*; + match s { + "exempt" => Ok(Exempt), + "none" => Ok(None), + "reverse" => Ok(Reverse), + _ => Err(()), + } + } +} +impl AsRef for CreateCustomerTaxExempt { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateCustomerTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCustomerTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCustomerTaxExempt { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's tax IDs. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCustomerTaxIdData<'a> { + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. + #[serde(rename = "type")] + pub type_: CreateCustomerTaxIdDataType, + /// Value of the tax ID. + pub value: &'a str, +} +impl<'a> CreateCustomerTaxIdData<'a> { + pub fn new(type_: CreateCustomerTaxIdDataType, value: &'a str) -> Self { + Self { type_, value } + } +} +/// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateCustomerTaxIdDataType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateCustomerTaxIdDataType { + pub fn as_str(self) -> &'static str { + use CreateCustomerTaxIdDataType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateCustomerTaxIdDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCustomerTaxIdDataType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl AsRef for CreateCustomerTaxIdDataType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateCustomerTaxIdDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCustomerTaxIdDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCustomerTaxIdDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateCustomer<'a> { + /// Creates a new customer object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/customers", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCustomer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCustomer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCustomer<'a> { + /// Retrieves a Customer object. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::Response { + client.get_query(&format!("/customers/{customer}"), self) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum RetrieveReturned { + #[serde(rename = "customer")] + DeletedCustomer(stripe_types::DeletedCustomer), +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomer<'a> { + /// The customer's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. + /// + /// A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub balance: Option, + /// Balance information and default balance settings for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub cash_balance: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) parameter. + /// + /// Provide the ID of a payment source already attached to this customer to make it this customer's default payment source. + /// + /// If you want to add a new payment source and make it the default, see the [source](https://stripe.com/docs/api/customers/update#update_customer-source) property. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_source: Option<&'a str>, + /// An arbitrary string that you can attach to a customer object. + /// + /// It is displayed alongside the customer in the dashboard. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Customer's email address. + /// + /// It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. + /// This may be up to *512 characters*. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The prefix for the customer used to generate unique invoice numbers. + /// + /// Must be 3–12 uppercase letters or numbers. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_prefix: Option<&'a str>, + /// Default invoice settings for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The customer's full name or business name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// The sequence to be used on the customer's next invoice. + /// + /// Defaults to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub next_invoice_sequence: Option, + /// The customer's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// Customer's preferred languages, ordered by preference. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locales: Option<&'a [&'a str]>, + /// The API ID of a promotion code to apply to the customer. + /// + /// The customer will have a discount applied on all recurring payments. + /// Charges you create through the API will not have the discount. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option<&'a str>, + /// The customer's shipping information. + /// + /// Appears on invoices emailed to this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option<&'a str>, + /// Tax details about the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax: Option>, + /// The customer's tax exemption. + /// + /// One of `none`, `exempt`, or `reverse`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_exempt: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub validate: Option, +} +impl<'a> UpdateCustomer<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateCustomerAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Balance information and default balance settings for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerCashBalance { + /// Settings controlling the behavior of the customer's cash balance, + /// such as reconciliation of funds received. + #[serde(skip_serializing_if = "Option::is_none")] + pub settings: Option, +} +impl UpdateCustomerCashBalance { + pub fn new() -> Self { + Self::default() + } +} +/// Settings controlling the behavior of the customer's cash balance, +/// such as reconciliation of funds received. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerCashBalanceSettings { + /// Controls how funds transferred by the customer are applied to payment intents and invoices. + /// + /// Valid options are `automatic`, `manual`, or `merchant_default`. + /// For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). + #[serde(skip_serializing_if = "Option::is_none")] + pub reconciliation_mode: Option, +} +impl UpdateCustomerCashBalanceSettings { + pub fn new() -> Self { + Self::default() + } +} +/// Controls how funds transferred by the customer are applied to payment intents and invoices. +/// +/// Valid options are `automatic`, `manual`, or `merchant_default`. +/// For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateCustomerCashBalanceSettingsReconciliationMode { + Automatic, + Manual, + MerchantDefault, +} +impl UpdateCustomerCashBalanceSettingsReconciliationMode { + pub fn as_str(self) -> &'static str { + use UpdateCustomerCashBalanceSettingsReconciliationMode::*; + match self { + Automatic => "automatic", + Manual => "manual", + MerchantDefault => "merchant_default", + } + } +} + +impl std::str::FromStr for UpdateCustomerCashBalanceSettingsReconciliationMode { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateCustomerCashBalanceSettingsReconciliationMode::*; + match s { + "automatic" => Ok(Automatic), + "manual" => Ok(Manual), + "merchant_default" => Ok(MerchantDefault), + _ => Err(()), + } + } +} +impl AsRef for UpdateCustomerCashBalanceSettingsReconciliationMode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateCustomerCashBalanceSettingsReconciliationMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateCustomerCashBalanceSettingsReconciliationMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateCustomerCashBalanceSettingsReconciliationMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Default invoice settings for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerInvoiceSettings<'a> { + /// Default custom fields to be displayed on invoices for this customer. + /// + /// When updating, pass an empty string to remove previously-defined fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [UpdateCustomerInvoiceSettingsCustomFields<'a>]>, + /// ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// Default footer to be displayed on invoices for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// Default options for invoice PDF rendering for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering_options: Option, +} +impl<'a> UpdateCustomerInvoiceSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Default custom fields to be displayed on invoices for this customer. +/// +/// When updating, pass an empty string to remove previously-defined fields. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateCustomerInvoiceSettingsCustomFields<'a> { + /// The name of the custom field. + /// + /// This may be up to 30 characters. + pub name: &'a str, + /// The value of the custom field. + /// + /// This may be up to 30 characters. + pub value: &'a str, +} +impl<'a> UpdateCustomerInvoiceSettingsCustomFields<'a> { + pub fn new(name: &'a str, value: &'a str) -> Self { + Self { name, value } + } +} +/// Default options for invoice PDF rendering for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerInvoiceSettingsRenderingOptions { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: Option, +} +impl UpdateCustomerInvoiceSettingsRenderingOptions { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl UpdateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use UpdateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr for UpdateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl AsRef for UpdateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's shipping information. +/// +/// Appears on invoices emailed to this customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateCustomerShipping<'a> { + /// Customer shipping address. + pub address: UpdateCustomerShippingAddress<'a>, + /// Customer name. + pub name: &'a str, + /// Customer phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> UpdateCustomerShipping<'a> { + pub fn new(address: UpdateCustomerShippingAddress<'a>, name: &'a str) -> Self { + Self { address, name, phone: Default::default() } + } +} +/// Customer shipping address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerShippingAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateCustomerShippingAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tax details about the customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerTax<'a> { + /// A recent IP address of the customer used for tax reporting and tax location inference. + /// + /// Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. + /// We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_address: Option<&'a str>, +} +impl<'a> UpdateCustomerTax<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's tax exemption. +/// +/// One of `none`, `exempt`, or `reverse`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateCustomerTaxExempt { + Exempt, + None, + Reverse, +} +impl UpdateCustomerTaxExempt { + pub fn as_str(self) -> &'static str { + use UpdateCustomerTaxExempt::*; + match self { + Exempt => "exempt", + None => "none", + Reverse => "reverse", + } + } +} + +impl std::str::FromStr for UpdateCustomerTaxExempt { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateCustomerTaxExempt::*; + match s { + "exempt" => Ok(Exempt), + "none" => Ok(None), + "reverse" => Ok(Reverse), + _ => Err(()), + } + } +} +impl AsRef for UpdateCustomerTaxExempt { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateCustomerTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateCustomerTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateCustomerTaxExempt { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateCustomer<'a> { + /// Updates the specified customer by setting the values of the parameters passed. + /// + /// Any parameters not provided will be left unchanged. + /// For example, if you pass the **source** parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges in the future. + /// When you update a customer to a new valid card source by passing the **source** parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the `past_due` state, then the latest open invoice for the subscription with automatic collection enabled will be retried. + /// This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. + /// Changing the **default_source** for a customer will not trigger this behavior. This request accepts mostly the same arguments as the customer creation call. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::Response { + client.send_form(&format!("/customers/{customer}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteCustomer {} +impl DeleteCustomer { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteCustomer { + /// Permanently deletes a customer. + /// + /// It cannot be undone. + /// Also immediately cancels any active subscriptions on the customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::Response { + client.send_form(&format!("/customers/{customer}"), self, http_types::Method::Delete) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPaymentMethodsCustomer<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// An optional filter on the list, based on the object `type` field. + /// + /// Without the filter, the list includes all current and future payment method types. + /// If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> ListPaymentMethodsCustomer<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An optional filter on the list, based on the object `type` field. +/// +/// Without the filter, the list includes all current and future payment method types. +/// If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ListPaymentMethodsCustomerType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Card, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ListPaymentMethodsCustomerType { + pub fn as_str(self) -> &'static str { + use ListPaymentMethodsCustomerType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ListPaymentMethodsCustomerType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListPaymentMethodsCustomerType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl AsRef for ListPaymentMethodsCustomerType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListPaymentMethodsCustomerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListPaymentMethodsCustomerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListPaymentMethodsCustomerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListPaymentMethodsCustomer<'a> { + /// Returns a list of PaymentMethods for a given Customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::Response> { + client.get_query(&format!("/customers/{customer}/payment_methods"), self) + } + pub fn paginate( + self, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params(&format!("/customers/{customer}/payment_methods"), self) + } +} +impl<'a> stripe::PaginationParams for ListPaymentMethodsCustomer<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePaymentMethodCustomer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePaymentMethodCustomer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePaymentMethodCustomer<'a> { + /// Retrieves a PaymentMethod object for a given Customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + payment_method: &stripe_types::payment_method::PaymentMethodId, + ) -> stripe::Response { + client.get_query(&format!("/customers/{customer}/payment_methods/{payment_method}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct BalanceTransactionsCustomer<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> BalanceTransactionsCustomer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> BalanceTransactionsCustomer<'a> { + /// Returns a list of transactions that updated the customer’s [balances](https://stripe.com/docs/billing/customer/balance). + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::Response> { + client.get_query(&format!("/customers/{customer}/balance_transactions"), self) + } + pub fn paginate( + self, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params( + &format!("/customers/{customer}/balance_transactions"), + self, + ) + } +} +impl<'a> stripe::PaginationParams for BalanceTransactionsCustomer<'a> {} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct FundCashBalanceCustomer<'a> { + /// Amount to be used for this test cash balance transaction. + /// + /// A positive integer representing how much to fund in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to fund $1.00 or 100 to fund ¥100, a zero-decimal currency). + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A description of the test funding. + /// + /// This simulates free-text references supplied by customers when making bank transfers to their cash balance. + /// You can use this to test how Stripe's [reconciliation algorithm](https://stripe.com/docs/payments/customer-balance/reconciliation) applies to different user inputs. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, +} +impl<'a> FundCashBalanceCustomer<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { amount, currency, expand: Default::default(), reference: Default::default() } + } +} +impl<'a> FundCashBalanceCustomer<'a> { + /// Create an incoming testmode bank transfer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/customers/{customer}/fund_cash_balance"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateFundingInstructionsCustomer<'a> { + /// Additional parameters for `bank_transfer` funding types. + pub bank_transfer: CreateFundingInstructionsCustomerBankTransfer<'a>, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The `funding_type` to get the instructions for. + pub funding_type: CreateFundingInstructionsCustomerFundingType, +} +impl<'a> CreateFundingInstructionsCustomer<'a> { + pub fn new( + bank_transfer: CreateFundingInstructionsCustomerBankTransfer<'a>, + currency: stripe_types::Currency, + funding_type: CreateFundingInstructionsCustomerFundingType, + ) -> Self { + Self { bank_transfer, currency, expand: Default::default(), funding_type } + } +} +/// Additional parameters for `bank_transfer` funding types. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateFundingInstructionsCustomerBankTransfer<'a> { + /// Configuration for eu_bank_transfer funding type. + #[serde(skip_serializing_if = "Option::is_none")] + pub eu_bank_transfer: Option>, + /// List of address types that should be returned in the financial_addresses response. + /// + /// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested_address_types: + Option<&'a [CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes]>, + /// The type of the `bank_transfer`. + #[serde(rename = "type")] + pub type_: CreateFundingInstructionsCustomerBankTransferType, +} +impl<'a> CreateFundingInstructionsCustomerBankTransfer<'a> { + pub fn new(type_: CreateFundingInstructionsCustomerBankTransferType) -> Self { + Self { + eu_bank_transfer: Default::default(), + requested_address_types: Default::default(), + type_, + } + } +} +/// Configuration for eu_bank_transfer funding type. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateFundingInstructionsCustomerBankTransferEuBankTransfer<'a> { + /// The desired country code of the bank account information. + /// + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: &'a str, +} +impl<'a> CreateFundingInstructionsCustomerBankTransferEuBankTransfer<'a> { + pub fn new(country: &'a str) -> Self { + Self { country } + } +} +/// List of address types that should be returned in the financial_addresses response. +/// +/// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes { + Iban, + SortCode, + Spei, + Zengin, +} +impl CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes { + pub fn as_str(self) -> &'static str { + use CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes::*; + match self { + Iban => "iban", + SortCode => "sort_code", + Spei => "spei", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr for CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes::*; + match s { + "iban" => Ok(Iban), + "sort_code" => Ok(SortCode), + "spei" => Ok(Spei), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl AsRef for CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of the `bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateFundingInstructionsCustomerBankTransferType { + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl CreateFundingInstructionsCustomerBankTransferType { + pub fn as_str(self) -> &'static str { + use CreateFundingInstructionsCustomerBankTransferType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr for CreateFundingInstructionsCustomerBankTransferType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateFundingInstructionsCustomerBankTransferType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "gb_bank_transfer" => Ok(GbBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + "mx_bank_transfer" => Ok(MxBankTransfer), + "us_bank_transfer" => Ok(UsBankTransfer), + _ => Err(()), + } + } +} +impl AsRef for CreateFundingInstructionsCustomerBankTransferType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateFundingInstructionsCustomerBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateFundingInstructionsCustomerBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateFundingInstructionsCustomerBankTransferType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The `funding_type` to get the instructions for. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateFundingInstructionsCustomerFundingType { + BankTransfer, +} +impl CreateFundingInstructionsCustomerFundingType { + pub fn as_str(self) -> &'static str { + use CreateFundingInstructionsCustomerFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr for CreateFundingInstructionsCustomerFundingType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateFundingInstructionsCustomerFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl AsRef for CreateFundingInstructionsCustomerFundingType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateFundingInstructionsCustomerFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateFundingInstructionsCustomerFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateFundingInstructionsCustomerFundingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateFundingInstructionsCustomer<'a> { + /// Retrieve funding instructions for a customer cash balance. + /// + /// If funding instructions do not yet exist for the customer, new funding instructions will be created. + /// If funding instructions have already been created for a given customer, the same funding instructions will be retrieved. + /// In other words, we will return the same funding instructions each time. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::Response< + stripe_types::CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructions, + > { + client.send_form( + &format!("/customers/{customer}/funding_instructions"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteDiscountCustomer {} +impl DeleteDiscountCustomer { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteDiscountCustomer { + /// Removes the currently applied discount on a customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/discount"), + self, + http_types::Method::Delete, + ) + } +} diff --git a/generated/stripe_core/src/customer_acceptance/mod.rs b/generated/stripe_core/src/customer_acceptance/mod.rs new file mode 100644 index 000000000..cf9e475fd --- /dev/null +++ b/generated/stripe_core/src/customer_acceptance/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::customer_acceptance::*; \ No newline at end of file diff --git a/generated/stripe_core/src/customer_balance_customer_balance_settings/mod.rs b/generated/stripe_core/src/customer_balance_customer_balance_settings/mod.rs new file mode 100644 index 000000000..a320cd235 --- /dev/null +++ b/generated/stripe_core/src/customer_balance_customer_balance_settings/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::customer_balance_customer_balance_settings::*; \ No newline at end of file diff --git a/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft/mod.rs b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft/mod.rs new file mode 100644 index 000000000..b0c29772a --- /dev/null +++ b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft::*; \ No newline at end of file diff --git a/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction/mod.rs b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction/mod.rs new file mode 100644 index 000000000..0bb25abdc --- /dev/null +++ b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction::*; \ No newline at end of file diff --git a/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction/mod.rs b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction/mod.rs new file mode 100644 index 000000000..15c72e92e --- /dev/null +++ b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::customer_balance_resource_cash_balance_transaction_resource_funded_transaction::*; \ No newline at end of file diff --git a/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer/mod.rs b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer/mod.rs new file mode 100644 index 000000000..d78da6ca8 --- /dev/null +++ b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer::*; \ No newline at end of file diff --git a/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer/mod.rs b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer/mod.rs new file mode 100644 index 000000000..3a9d3a29e --- /dev/null +++ b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer::*; \ No newline at end of file diff --git a/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer/mod.rs b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer/mod.rs new file mode 100644 index 000000000..525525b76 --- /dev/null +++ b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer::*; \ No newline at end of file diff --git a/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer/mod.rs b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer/mod.rs new file mode 100644 index 000000000..5ae6befde --- /dev/null +++ b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer::*; \ No newline at end of file diff --git a/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer/mod.rs b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer/mod.rs new file mode 100644 index 000000000..eb790c9c0 --- /dev/null +++ b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer::*; \ No newline at end of file diff --git a/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction/mod.rs b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction/mod.rs new file mode 100644 index 000000000..b4a27f4ed --- /dev/null +++ b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction::*; \ No newline at end of file diff --git a/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction/mod.rs b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction/mod.rs new file mode 100644 index 000000000..e5e601588 --- /dev/null +++ b/generated/stripe_core/src/customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction::*; \ No newline at end of file diff --git a/generated/stripe_core/src/customer_balance_transaction/mod.rs b/generated/stripe_core/src/customer_balance_transaction/mod.rs new file mode 100644 index 000000000..87ebdfb2f --- /dev/null +++ b/generated/stripe_core/src/customer_balance_transaction/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::customer_balance_transaction::*; +#[cfg(feature = "customer_balance_transaction")] +mod requests; +#[cfg(feature = "customer_balance_transaction")] +pub use requests::*; diff --git a/generated/stripe_core/src/customer_balance_transaction/requests.rs b/generated/stripe_core/src/customer_balance_transaction/requests.rs new file mode 100644 index 000000000..cced11d00 --- /dev/null +++ b/generated/stripe_core/src/customer_balance_transaction/requests.rs @@ -0,0 +1,159 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCustomerBalanceTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCustomerBalanceTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCustomerBalanceTransaction<'a> { + /// Retrieves a specific customer balance transaction that updated the customer’s [balances](https://stripe.com/docs/billing/customer/balance). + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + transaction: &str, + ) -> stripe::Response { + client.get_query(&format!("/customers/{customer}/balance_transactions/{transaction}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCustomerBalanceTransaction<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListCustomerBalanceTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCustomerBalanceTransaction<'a> { + /// Returns a list of transactions that updated the customer’s [balances](https://stripe.com/docs/billing/customer/balance). + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::Response> { + client.get_query(&format!("/customers/{customer}/balance_transactions"), self) + } + pub fn paginate( + self, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params( + &format!("/customers/{customer}/balance_transactions"), + self, + ) + } +} +impl<'a> stripe::PaginationParams for ListCustomerBalanceTransaction<'a> {} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCustomerBalanceTransaction<'a> { + /// The integer amount in **cents (or local equivalent)** to apply to the customer's credit balance. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + /// Specifies the [`invoice_credit_balance`](https://stripe.com/docs/api/customers/object#customer_object-invoice_credit_balance) that this transaction will apply to. + /// If the customer's `currency` is not set, it will be updated to this value. + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> CreateCustomerBalanceTransaction<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { + amount, + currency, + description: Default::default(), + expand: Default::default(), + metadata: Default::default(), + } + } +} +impl<'a> CreateCustomerBalanceTransaction<'a> { + /// Creates an immutable transaction that updates the customer’s credit [balance](https://stripe.com/docs/billing/customer/balance). + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/balance_transactions"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerBalanceTransaction<'a> { + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateCustomerBalanceTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateCustomerBalanceTransaction<'a> { + /// Most credit balance transaction fields are immutable, but you may update its `description` and `metadata`. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + transaction: &str, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/balance_transactions/{transaction}"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_core/src/customer_cash_balance_transaction/mod.rs b/generated/stripe_core/src/customer_cash_balance_transaction/mod.rs new file mode 100644 index 000000000..7ee94e8f6 --- /dev/null +++ b/generated/stripe_core/src/customer_cash_balance_transaction/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::customer_cash_balance_transaction::*; +#[cfg(feature = "customer_cash_balance_transaction")] +mod requests; +#[cfg(feature = "customer_cash_balance_transaction")] +pub use requests::*; diff --git a/generated/stripe_core/src/customer_cash_balance_transaction/requests.rs b/generated/stripe_core/src/customer_cash_balance_transaction/requests.rs new file mode 100644 index 000000000..8672786c0 --- /dev/null +++ b/generated/stripe_core/src/customer_cash_balance_transaction/requests.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCustomerCashBalanceTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCustomerCashBalanceTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCustomerCashBalanceTransaction<'a> { + /// Retrieves a specific cash balance transaction, which updated the customer’s [cash balance](https://stripe.com/docs/payments/customer-balance). + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + transaction: &str, + ) -> stripe::Response { + client.get_query( + &format!("/customers/{customer}/cash_balance_transactions/{transaction}"), + self, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCustomerCashBalanceTransaction<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListCustomerCashBalanceTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCustomerCashBalanceTransaction<'a> { + /// Returns a list of transactions that modified the customer’s [cash balance](https://stripe.com/docs/payments/customer-balance). + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::Response> { + client.get_query(&format!("/customers/{customer}/cash_balance_transactions"), self) + } + pub fn paginate( + self, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params( + &format!("/customers/{customer}/cash_balance_transactions"), + self, + ) + } +} +impl<'a> stripe::PaginationParams for ListCustomerCashBalanceTransaction<'a> {} diff --git a/generated/stripe_core/src/customer_tax/mod.rs b/generated/stripe_core/src/customer_tax/mod.rs new file mode 100644 index 000000000..b5bdc7eed --- /dev/null +++ b/generated/stripe_core/src/customer_tax/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::customer_tax::*; \ No newline at end of file diff --git a/generated/stripe_core/src/customer_tax_location/mod.rs b/generated/stripe_core/src/customer_tax_location/mod.rs new file mode 100644 index 000000000..2e0bc366a --- /dev/null +++ b/generated/stripe_core/src/customer_tax_location/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::customer_tax_location::*; \ No newline at end of file diff --git a/generated/stripe_core/src/deleted_customer/mod.rs b/generated/stripe_core/src/deleted_customer/mod.rs new file mode 100644 index 000000000..b3c22ebea --- /dev/null +++ b/generated/stripe_core/src/deleted_customer/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::deleted_customer::*; \ No newline at end of file diff --git a/generated/stripe_core/src/dispute/mod.rs b/generated/stripe_core/src/dispute/mod.rs new file mode 100644 index 000000000..275a464fe --- /dev/null +++ b/generated/stripe_core/src/dispute/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::dispute::*; +#[cfg(feature = "dispute")] +mod requests; +#[cfg(feature = "dispute")] +pub use requests::*; diff --git a/generated/stripe_core/src/dispute/requests.rs b/generated/stripe_core/src/dispute/requests.rs new file mode 100644 index 000000000..cbc4773c5 --- /dev/null +++ b/generated/stripe_core/src/dispute/requests.rs @@ -0,0 +1,264 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListDispute<'a> { + /// Only return disputes associated to the charge specified by this charge ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub charge: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return disputes associated to the PaymentIntent specified by this PaymentIntent ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListDispute<'a> { + /// Returns a list of your disputes. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/disputes", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/disputes", self) + } +} +impl<'a> stripe::PaginationParams for ListDispute<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveDispute<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveDispute<'a> { + /// Retrieves the dispute with the given ID. + pub fn send( + &self, + client: &stripe::Client, + dispute: &stripe_types::dispute::DisputeId, + ) -> stripe::Response { + client.get_query(&format!("/disputes/{dispute}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateDispute<'a> { + /// Evidence to upload, to respond to a dispute. + /// + /// Updating any field in the hash will submit all fields in the hash for review. + /// The combined character count of all fields is limited to 150,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub evidence: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Whether to immediately submit evidence to the bank. + /// + /// If `false`, evidence is staged on the dispute. + /// Staged evidence is visible in the API and Dashboard, and can be submitted to the bank by making another request with this attribute set to `true` (the default). + #[serde(skip_serializing_if = "Option::is_none")] + pub submit: Option, +} +impl<'a> UpdateDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Evidence to upload, to respond to a dispute. +/// +/// Updating any field in the hash will submit all fields in the hash for review. +/// The combined character count of all fields is limited to 150,000. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateDisputeEvidence<'a> { + /// Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. + /// + /// This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. + /// Has a maximum character count of 20,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub access_activity_log: Option<&'a str>, + /// The billing address provided by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_address: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your subscription cancellation policy, as shown to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_policy: Option<&'a str>, + /// An explanation of how and when the customer was shown your refund policy prior to purchase. + /// + /// Has a maximum character count of 20,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_policy_disclosure: Option<&'a str>, + /// A justification for why the customer's subscription was not canceled. + /// + /// Has a maximum character count of 20,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_rebuttal: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any communication with the customer that you feel is relevant to your case. + /// + /// Examples include emails proving that the customer received the product or service, or demonstrating their use of or satisfaction with the product or service. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_communication: Option<&'a str>, + /// The email address of the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_email_address: Option<&'a str>, + /// The name of the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_name: Option<&'a str>, + /// The IP address that the customer used when making the purchase. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_purchase_ip: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A relevant document or contract showing the customer's signature. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_signature: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation for the prior charge that can uniquely identify the charge, such as a receipt, shipping label, work order, etc. + /// + /// This document should be paired with a similar document from the disputed payment that proves the two payments are separate. + #[serde(skip_serializing_if = "Option::is_none")] + pub duplicate_charge_documentation: Option<&'a str>, + /// An explanation of the difference between the disputed charge versus the prior charge that appears to be a duplicate. + /// + /// Has a maximum character count of 20,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub duplicate_charge_explanation: Option<&'a str>, + /// The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub duplicate_charge_id: Option<&'a str>, + /// A description of the product or service that was sold. + /// + /// Has a maximum character count of 20,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any receipt or message sent to the customer notifying them of the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your refund policy, as shown to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_policy: Option<&'a str>, + /// Documentation demonstrating that the customer was shown your refund policy prior to purchase. + /// + /// Has a maximum character count of 20,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_policy_disclosure: Option<&'a str>, + /// A justification for why the customer is not entitled to a refund. + /// + /// Has a maximum character count of 20,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_refusal_explanation: Option<&'a str>, + /// The date on which the customer received or began receiving the purchased service, in a clear human-readable format. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_date: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a service was provided to the customer. + /// + /// This could include a copy of a signed contract, work order, or other form of written agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_documentation: Option<&'a str>, + /// The address to which a physical product was shipped. + /// + /// You should try to include as complete address information as possible. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_address: Option<&'a str>, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + /// + /// If multiple carriers were used for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_carrier: Option<&'a str>, + /// The date on which a physical product began its route to the shipping address, in a clear human-readable format. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_date: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a product was shipped to the customer at the same address the customer provided to you. + /// + /// This could include a copy of the shipment receipt, shipping label, etc. + /// It should show the customer's full shipping address, if possible. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_documentation: Option<&'a str>, + /// The tracking number for a physical product, obtained from the delivery service. + /// + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_tracking_number: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any additional evidence or statements. + #[serde(skip_serializing_if = "Option::is_none")] + pub uncategorized_file: Option<&'a str>, + /// Any additional evidence or statements. + /// + /// Has a maximum character count of 20,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub uncategorized_text: Option<&'a str>, +} +impl<'a> UpdateDisputeEvidence<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateDispute<'a> { + /// When you get a dispute, contacting your customer is always the best first step. + /// + /// If that doesn’t work, you can submit evidence to help us resolve the dispute in your favor. + /// You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically. Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. + /// To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories). + pub fn send( + &self, + client: &stripe::Client, + dispute: &stripe_types::dispute::DisputeId, + ) -> stripe::Response { + client.send_form(&format!("/disputes/{dispute}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CloseDispute<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CloseDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CloseDispute<'a> { + /// Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + /// + /// The status of the dispute will change from `needs_response` to `lost`. + /// + /// _Closing a dispute is irreversible_. + pub fn send( + &self, + client: &stripe::Client, + dispute: &stripe_types::dispute::DisputeId, + ) -> stripe::Response { + client.send_form(&format!("/disputes/{dispute}/close"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_core/src/dispute_evidence/mod.rs b/generated/stripe_core/src/dispute_evidence/mod.rs new file mode 100644 index 000000000..d37b21e0d --- /dev/null +++ b/generated/stripe_core/src/dispute_evidence/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::dispute_evidence::*; \ No newline at end of file diff --git a/generated/stripe_core/src/dispute_evidence_details/mod.rs b/generated/stripe_core/src/dispute_evidence_details/mod.rs new file mode 100644 index 000000000..28c7c5d30 --- /dev/null +++ b/generated/stripe_core/src/dispute_evidence_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::dispute_evidence_details::*; \ No newline at end of file diff --git a/generated/stripe_core/src/dispute_payment_method_details/mod.rs b/generated/stripe_core/src/dispute_payment_method_details/mod.rs new file mode 100644 index 000000000..5a320c8a5 --- /dev/null +++ b/generated/stripe_core/src/dispute_payment_method_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::dispute_payment_method_details::*; \ No newline at end of file diff --git a/generated/stripe_core/src/dispute_payment_method_details_card/mod.rs b/generated/stripe_core/src/dispute_payment_method_details_card/mod.rs new file mode 100644 index 000000000..511c5739e --- /dev/null +++ b/generated/stripe_core/src/dispute_payment_method_details_card/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::dispute_payment_method_details_card::*; \ No newline at end of file diff --git a/generated/stripe_core/src/email_sent/mod.rs b/generated/stripe_core/src/email_sent/mod.rs new file mode 100644 index 000000000..f6a58b4cb --- /dev/null +++ b/generated/stripe_core/src/email_sent/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::email_sent::*; \ No newline at end of file diff --git a/generated/stripe_core/src/fee/mod.rs b/generated/stripe_core/src/fee/mod.rs new file mode 100644 index 000000000..e9abb0902 --- /dev/null +++ b/generated/stripe_core/src/fee/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::fee::*; \ No newline at end of file diff --git a/generated/stripe_core/src/file/mod.rs b/generated/stripe_core/src/file/mod.rs new file mode 100644 index 000000000..446f5633f --- /dev/null +++ b/generated/stripe_core/src/file/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::file::*; +#[cfg(feature = "file")] +mod requests; +#[cfg(feature = "file")] +pub use requests::*; diff --git a/generated/stripe_core/src/file/requests.rs b/generated/stripe_core/src/file/requests.rs new file mode 100644 index 000000000..4afe8d49e --- /dev/null +++ b/generated/stripe_core/src/file/requests.rs @@ -0,0 +1,170 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListFile<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Filter queries by the file purpose. + /// + /// If you don't provide a purpose, the queries return unfiltered files. + #[serde(skip_serializing_if = "Option::is_none")] + pub purpose: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListFile<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Filter queries by the file purpose. +/// +/// If you don't provide a purpose, the queries return unfiltered files. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ListFilePurpose { + AccountRequirement, + AdditionalVerification, + BusinessIcon, + BusinessLogo, + CustomerSignature, + DisputeEvidence, + DocumentProviderIdentityDocument, + FinanceReportRun, + IdentityDocument, + IdentityDocumentDownloadable, + PciDocument, + Selfie, + SigmaScheduledQuery, + TaxDocumentUserUpload, + TerminalReaderSplashscreen, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ListFilePurpose { + pub fn as_str(self) -> &'static str { + use ListFilePurpose::*; + match self { + AccountRequirement => "account_requirement", + AdditionalVerification => "additional_verification", + BusinessIcon => "business_icon", + BusinessLogo => "business_logo", + CustomerSignature => "customer_signature", + DisputeEvidence => "dispute_evidence", + DocumentProviderIdentityDocument => "document_provider_identity_document", + FinanceReportRun => "finance_report_run", + IdentityDocument => "identity_document", + IdentityDocumentDownloadable => "identity_document_downloadable", + PciDocument => "pci_document", + Selfie => "selfie", + SigmaScheduledQuery => "sigma_scheduled_query", + TaxDocumentUserUpload => "tax_document_user_upload", + TerminalReaderSplashscreen => "terminal_reader_splashscreen", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ListFilePurpose { + type Err = (); + fn from_str(s: &str) -> Result { + use ListFilePurpose::*; + match s { + "account_requirement" => Ok(AccountRequirement), + "additional_verification" => Ok(AdditionalVerification), + "business_icon" => Ok(BusinessIcon), + "business_logo" => Ok(BusinessLogo), + "customer_signature" => Ok(CustomerSignature), + "dispute_evidence" => Ok(DisputeEvidence), + "document_provider_identity_document" => Ok(DocumentProviderIdentityDocument), + "finance_report_run" => Ok(FinanceReportRun), + "identity_document" => Ok(IdentityDocument), + "identity_document_downloadable" => Ok(IdentityDocumentDownloadable), + "pci_document" => Ok(PciDocument), + "selfie" => Ok(Selfie), + "sigma_scheduled_query" => Ok(SigmaScheduledQuery), + "tax_document_user_upload" => Ok(TaxDocumentUserUpload), + "terminal_reader_splashscreen" => Ok(TerminalReaderSplashscreen), + _ => Err(()), + } + } +} +impl AsRef for ListFilePurpose { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListFilePurpose { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListFilePurpose { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListFilePurpose { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListFile<'a> { + /// Returns a list of the files that your account has access to. + /// + /// Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/files", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/files", self) + } +} +impl<'a> stripe::PaginationParams for ListFile<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveFile<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveFile<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveFile<'a> { + /// Retrieves the details of an existing file object. + /// + /// After you supply a unique file ID, Stripe returns the corresponding file object. + /// Learn how to [access file contents](https://stripe.com/docs/file-upload#download-file-contents). + pub fn send( + &self, + client: &stripe::Client, + file: &stripe_types::file::FileId, + ) -> stripe::Response { + client.get_query(&format!("/files/{file}"), self) + } +} diff --git a/generated/stripe_core/src/file_link/mod.rs b/generated/stripe_core/src/file_link/mod.rs new file mode 100644 index 000000000..e1cb8210c --- /dev/null +++ b/generated/stripe_core/src/file_link/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::file_link::*; +#[cfg(feature = "file_link")] +mod requests; +#[cfg(feature = "file_link")] +pub use requests::*; diff --git a/generated/stripe_core/src/file_link/requests.rs b/generated/stripe_core/src/file_link/requests.rs new file mode 100644 index 000000000..8a69ad4a2 --- /dev/null +++ b/generated/stripe_core/src/file_link/requests.rs @@ -0,0 +1,148 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveFileLink<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveFileLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveFileLink<'a> { + /// Retrieves the file link with the given ID. + pub fn send( + &self, + client: &stripe::Client, + link: &str, + ) -> stripe::Response { + client.get_query(&format!("/file_links/{link}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateFileLink<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The link isn't usable after this future timestamp. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// The ID of the file. + /// + /// The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `identity_document_downloadable`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. + pub file: &'a str, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> CreateFileLink<'a> { + pub fn new(file: &'a str) -> Self { + Self { + expand: Default::default(), + expires_at: Default::default(), + file, + metadata: Default::default(), + } + } +} +impl<'a> CreateFileLink<'a> { + /// Creates a new file link object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/file_links", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateFileLink<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A future timestamp after which the link will no longer be usable, or `now` to expire the link immediately. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateFileLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A future timestamp after which the link will no longer be usable, or `now` to expire the link immediately. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateFileLinkExpiresAt { + Now, + Timestamp(stripe_types::Timestamp), +} +impl<'a> UpdateFileLink<'a> { + /// Updates an existing file link object. + /// + /// Expired links can no longer be updated. + pub fn send( + &self, + client: &stripe::Client, + link: &str, + ) -> stripe::Response { + client.send_form(&format!("/file_links/{link}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListFileLink<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Filter links by their expiration status. + /// + /// By default, Stripe returns all links. + #[serde(skip_serializing_if = "Option::is_none")] + pub expired: Option, + /// Only return links for the given file. + #[serde(skip_serializing_if = "Option::is_none")] + pub file: Option<&'a str>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListFileLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListFileLink<'a> { + /// Returns a list of file links. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/file_links", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/file_links", self) + } +} +impl<'a> stripe::PaginationParams for ListFileLink<'a> {} diff --git a/generated/stripe_core/src/level3/mod.rs b/generated/stripe_core/src/level3/mod.rs new file mode 100644 index 000000000..1e419dea8 --- /dev/null +++ b/generated/stripe_core/src/level3/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::level3::*; \ No newline at end of file diff --git a/generated/stripe_core/src/level3_line_items/mod.rs b/generated/stripe_core/src/level3_line_items/mod.rs new file mode 100644 index 000000000..442097e44 --- /dev/null +++ b/generated/stripe_core/src/level3_line_items/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::level3_line_items::*; \ No newline at end of file diff --git a/generated/stripe_core/src/mandate/mod.rs b/generated/stripe_core/src/mandate/mod.rs new file mode 100644 index 000000000..97934fc22 --- /dev/null +++ b/generated/stripe_core/src/mandate/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::mandate::*; +#[cfg(feature = "mandate")] +mod requests; +#[cfg(feature = "mandate")] +pub use requests::*; diff --git a/generated/stripe_core/src/mandate/requests.rs b/generated/stripe_core/src/mandate/requests.rs new file mode 100644 index 000000000..ef94fd911 --- /dev/null +++ b/generated/stripe_core/src/mandate/requests.rs @@ -0,0 +1,21 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveMandate<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveMandate<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveMandate<'a> { + /// Retrieves a Mandate object. + pub fn send( + &self, + client: &stripe::Client, + mandate: &stripe_types::mandate::MandateId, + ) -> stripe::Response { + client.get_query(&format!("/mandates/{mandate}"), self) + } +} diff --git a/generated/stripe_core/src/mandate_acss_debit/mod.rs b/generated/stripe_core/src/mandate_acss_debit/mod.rs new file mode 100644 index 000000000..0cc53574b --- /dev/null +++ b/generated/stripe_core/src/mandate_acss_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::mandate_acss_debit::*; \ No newline at end of file diff --git a/generated/stripe_core/src/mandate_au_becs_debit/mod.rs b/generated/stripe_core/src/mandate_au_becs_debit/mod.rs new file mode 100644 index 000000000..546354b08 --- /dev/null +++ b/generated/stripe_core/src/mandate_au_becs_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::mandate_au_becs_debit::*; \ No newline at end of file diff --git a/generated/stripe_core/src/mandate_bacs_debit/mod.rs b/generated/stripe_core/src/mandate_bacs_debit/mod.rs new file mode 100644 index 000000000..2bb0545c2 --- /dev/null +++ b/generated/stripe_core/src/mandate_bacs_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::mandate_bacs_debit::*; \ No newline at end of file diff --git a/generated/stripe_core/src/mandate_cashapp/mod.rs b/generated/stripe_core/src/mandate_cashapp/mod.rs new file mode 100644 index 000000000..6e14ec1db --- /dev/null +++ b/generated/stripe_core/src/mandate_cashapp/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::mandate_cashapp::*; \ No newline at end of file diff --git a/generated/stripe_core/src/mandate_link/mod.rs b/generated/stripe_core/src/mandate_link/mod.rs new file mode 100644 index 000000000..67d2ae622 --- /dev/null +++ b/generated/stripe_core/src/mandate_link/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::mandate_link::*; \ No newline at end of file diff --git a/generated/stripe_core/src/mandate_multi_use/mod.rs b/generated/stripe_core/src/mandate_multi_use/mod.rs new file mode 100644 index 000000000..81422fd4a --- /dev/null +++ b/generated/stripe_core/src/mandate_multi_use/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::mandate_multi_use::*; \ No newline at end of file diff --git a/generated/stripe_core/src/mandate_payment_method_details/mod.rs b/generated/stripe_core/src/mandate_payment_method_details/mod.rs new file mode 100644 index 000000000..eed255506 --- /dev/null +++ b/generated/stripe_core/src/mandate_payment_method_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::mandate_payment_method_details::*; \ No newline at end of file diff --git a/generated/stripe_core/src/mandate_paypal/mod.rs b/generated/stripe_core/src/mandate_paypal/mod.rs new file mode 100644 index 000000000..11df4a178 --- /dev/null +++ b/generated/stripe_core/src/mandate_paypal/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::mandate_paypal::*; \ No newline at end of file diff --git a/generated/stripe_core/src/mandate_sepa_debit/mod.rs b/generated/stripe_core/src/mandate_sepa_debit/mod.rs new file mode 100644 index 000000000..3ff1fd5b9 --- /dev/null +++ b/generated/stripe_core/src/mandate_sepa_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::mandate_sepa_debit::*; \ No newline at end of file diff --git a/generated/stripe_core/src/mandate_single_use/mod.rs b/generated/stripe_core/src/mandate_single_use/mod.rs new file mode 100644 index 000000000..79dd943c2 --- /dev/null +++ b/generated/stripe_core/src/mandate_single_use/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::mandate_single_use::*; \ No newline at end of file diff --git a/generated/stripe_core/src/mandate_us_bank_account/mod.rs b/generated/stripe_core/src/mandate_us_bank_account/mod.rs new file mode 100644 index 000000000..d318d6f05 --- /dev/null +++ b/generated/stripe_core/src/mandate_us_bank_account/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::mandate_us_bank_account::*; \ No newline at end of file diff --git a/generated/stripe_core/src/mod.rs b/generated/stripe_core/src/mod.rs new file mode 100644 index 000000000..bb36419cc --- /dev/null +++ b/generated/stripe_core/src/mod.rs @@ -0,0 +1,170 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::invalid_html_tags)] +extern crate self as stripe_core; +pub mod balance; +pub use balance::Balance; +pub mod balance_amount; +pub use balance_amount::BalanceAmount; +pub mod balance_amount_by_source_type; +pub use balance_amount_by_source_type::BalanceAmountBySourceType; +pub mod balance_amount_net; +pub use balance_amount_net::BalanceAmountNet; +pub mod balance_detail; +pub use balance_detail::BalanceDetail; +pub use stripe_types::BalanceTransaction; +pub mod balance_transaction; +pub use stripe_types::BalanceTransactionSource; +pub use stripe_types::CashBalance; +pub mod cash_balance; +pub use stripe_types::Charge; +pub mod charge; +pub use stripe_types::ChargeFraudDetails; +pub use stripe_types::ChargeOutcome; +pub use stripe_types::ChargeTransferData; +pub use stripe_types::ConnectCollectionTransfer; +pub use stripe_types::Customer; +pub mod customer; +pub use stripe_types::CustomerAcceptance; +pub use stripe_types::CustomerBalanceCustomerBalanceSettings; +pub use stripe_types::CustomerBalanceResourceCashBalanceTransactionResourceAdjustedForOverdraft; +pub use stripe_types::CustomerBalanceResourceCashBalanceTransactionResourceAppliedToPaymentTransaction; +pub use stripe_types::CustomerBalanceResourceCashBalanceTransactionResourceFundedTransaction; +pub use stripe_types::CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransfer; +pub use stripe_types::CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceEuBankTransfer; +pub use stripe_types::CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceGbBankTransfer; +pub use stripe_types::CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceJpBankTransfer; +pub use stripe_types::CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransfer; +pub use stripe_types::CustomerBalanceResourceCashBalanceTransactionResourceRefundedFromPaymentTransaction; +pub use stripe_types::CustomerBalanceResourceCashBalanceTransactionResourceUnappliedFromPaymentTransaction; +pub use stripe_types::CustomerBalanceTransaction; +pub mod customer_balance_transaction; +pub use stripe_types::CustomerCashBalanceTransaction; +pub mod customer_cash_balance_transaction; +pub use stripe_types::CustomerTax; +pub use stripe_types::CustomerTaxLocation; +pub use stripe_types::DeletedCustomer; +pub use stripe_types::Dispute; +pub mod dispute; +pub use stripe_types::DisputeEvidence; +pub use stripe_types::DisputeEvidenceDetails; +pub use stripe_types::DisputePaymentMethodDetails; +pub use stripe_types::DisputePaymentMethodDetailsCard; +pub use stripe_types::EmailSent; +pub use stripe_types::NotificationEvent; +pub mod notification_event; +pub use stripe_types::Fee; +pub use stripe_types::File; +pub mod file; +pub use stripe_types::FileLink; +pub mod file_link; +pub use stripe_types::Level3; +pub use stripe_types::Level3LineItems; +pub use stripe_types::Mandate; +pub mod mandate; +pub use stripe_types::MandateAcssDebit; +pub use stripe_types::MandateAuBecsDebit; +pub use stripe_types::MandateBacsDebit; +pub use stripe_types::MandateCashapp; +pub use stripe_types::MandateLink; +pub use stripe_types::MandateMultiUse; +pub use stripe_types::MandatePaymentMethodDetails; +pub use stripe_types::MandatePaypal; +pub use stripe_types::MandateSepaDebit; +pub use stripe_types::MandateSingleUse; +pub use stripe_types::MandateUsBankAccount; +pub use stripe_types::NotificationEventData; +pub use stripe_types::NotificationEventRequest; +pub use stripe_types::OfflineAcceptance; +pub use stripe_types::OnlineAcceptance; +pub use stripe_types::PaymentFlowsAmountDetails; +pub use stripe_types::PaymentFlowsAmountDetailsResourceTip; +pub use stripe_types::PaymentFlowsAutomaticPaymentMethodsPaymentIntent; +pub use stripe_types::PaymentFlowsAutomaticPaymentMethodsSetupIntent; +pub use stripe_types::PaymentIntent; +pub mod payment_intent; +pub use stripe_types::PaymentIntentCardProcessing; +pub use stripe_types::PaymentIntentNextAction; +pub use stripe_types::PaymentIntentNextActionAlipayHandleRedirect; +pub use stripe_types::PaymentIntentNextActionBoleto; +pub use stripe_types::PaymentIntentNextActionCardAwaitNotification; +pub use stripe_types::PaymentIntentNextActionCashappHandleRedirectOrDisplayQrCode; +pub use stripe_types::PaymentIntentNextActionCashappQrCode; +pub use stripe_types::PaymentIntentNextActionDisplayBankTransferInstructions; +pub use stripe_types::PaymentIntentNextActionDisplayOxxoDetails; +pub use stripe_types::PaymentIntentNextActionKonbini; +pub use stripe_types::PaymentIntentNextActionKonbiniFamilymart; +pub use stripe_types::PaymentIntentNextActionKonbiniLawson; +pub use stripe_types::PaymentIntentNextActionKonbiniMinistop; +pub use stripe_types::PaymentIntentNextActionKonbiniSeicomart; +pub use stripe_types::PaymentIntentNextActionKonbiniStores; +pub use stripe_types::PaymentIntentNextActionPaynowDisplayQrCode; +pub use stripe_types::PaymentIntentNextActionPixDisplayQrCode; +pub use stripe_types::PaymentIntentNextActionPromptpayDisplayQrCode; +pub use stripe_types::PaymentIntentNextActionRedirectToUrl; +pub use stripe_types::PaymentIntentNextActionVerifyWithMicrodeposits; +pub use stripe_types::PaymentIntentNextActionWechatPayDisplayQrCode; +pub use stripe_types::PaymentIntentNextActionWechatPayRedirectToAndroidApp; +pub use stripe_types::PaymentIntentNextActionWechatPayRedirectToIosApp; +pub use stripe_types::PaymentIntentPaymentMethodOptions; +pub use stripe_types::PaymentIntentPaymentMethodOptionsAcssDebit; +pub use stripe_types::PaymentIntentPaymentMethodOptionsAuBecsDebit; +pub use stripe_types::PaymentIntentPaymentMethodOptionsBlik; +pub use stripe_types::PaymentIntentPaymentMethodOptionsCard; +pub use stripe_types::PaymentIntentPaymentMethodOptionsEps; +pub use stripe_types::PaymentIntentPaymentMethodOptionsLink; +pub use stripe_types::PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit; +pub use stripe_types::PaymentIntentPaymentMethodOptionsMandateOptionsSepaDebit; +pub use stripe_types::PaymentIntentPaymentMethodOptionsSepaDebit; +pub use stripe_types::PaymentIntentPaymentMethodOptionsUsBankAccount; +pub use stripe_types::PaymentIntentProcessing; +pub use stripe_types::PaymentIntentProcessingCustomerNotification; +pub use stripe_types::PaymentSource; +pub mod payment_source; +pub use stripe_types::Payout; +pub mod payout; +pub use stripe_types::PlatformTax; +pub use stripe_types::Refund; +pub mod refund; +pub use stripe_types::PaymentFlowsSetupIntentSetupAttempt; +pub use stripe_types::RefundNextAction; +pub use stripe_types::RefundNextActionDisplayDetails; +pub use stripe_types::ReserveTransaction; +pub mod payment_flows_setup_intent_setup_attempt; +pub use stripe_types::SetupAttemptPaymentMethodDetails; +pub use stripe_types::SetupAttemptPaymentMethodDetailsAcssDebit; +pub use stripe_types::SetupAttemptPaymentMethodDetailsAuBecsDebit; +pub use stripe_types::SetupAttemptPaymentMethodDetailsBacsDebit; +pub use stripe_types::SetupAttemptPaymentMethodDetailsBancontact; +pub use stripe_types::SetupAttemptPaymentMethodDetailsBoleto; +pub use stripe_types::SetupAttemptPaymentMethodDetailsCard; +pub use stripe_types::SetupAttemptPaymentMethodDetailsCardChecks; +pub use stripe_types::SetupAttemptPaymentMethodDetailsCardPresent; +pub use stripe_types::SetupAttemptPaymentMethodDetailsCardWallet; +pub use stripe_types::SetupAttemptPaymentMethodDetailsCashapp; +pub use stripe_types::SetupAttemptPaymentMethodDetailsIdeal; +pub use stripe_types::SetupAttemptPaymentMethodDetailsKlarna; +pub use stripe_types::SetupAttemptPaymentMethodDetailsLink; +pub use stripe_types::SetupAttemptPaymentMethodDetailsPaypal; +pub use stripe_types::SetupAttemptPaymentMethodDetailsSepaDebit; +pub use stripe_types::SetupAttemptPaymentMethodDetailsSofort; +pub use stripe_types::SetupAttemptPaymentMethodDetailsUsBankAccount; +pub use stripe_types::SetupIntent; +pub mod setup_intent; +pub use stripe_types::SetupIntentNextAction; +pub use stripe_types::SetupIntentNextActionRedirectToUrl; +pub use stripe_types::SetupIntentNextActionVerifyWithMicrodeposits; +pub use stripe_types::SetupIntentPaymentMethodOptions; +pub use stripe_types::SetupIntentPaymentMethodOptionsAcssDebit; +pub use stripe_types::SetupIntentPaymentMethodOptionsCard; +pub use stripe_types::SetupIntentPaymentMethodOptionsCardMandateOptions; +pub use stripe_types::SetupIntentPaymentMethodOptionsLink; +pub use stripe_types::SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit; +pub use stripe_types::SetupIntentPaymentMethodOptionsMandateOptionsSepaDebit; +pub use stripe_types::SetupIntentPaymentMethodOptionsPaypal; +pub use stripe_types::SetupIntentPaymentMethodOptionsSepaDebit; +pub use stripe_types::SetupIntentPaymentMethodOptionsUsBankAccount; +pub use stripe_types::TaxDeductedAtSource; +pub use stripe_types::ThreeDSecureDetails; +pub mod token; +pub use token::Token; diff --git a/generated/stripe_core/src/notification_event/mod.rs b/generated/stripe_core/src/notification_event/mod.rs new file mode 100644 index 000000000..56ca09d0e --- /dev/null +++ b/generated/stripe_core/src/notification_event/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::notification_event::*; +#[cfg(feature = "notification_event")] +mod requests; +#[cfg(feature = "notification_event")] +pub use requests::*; diff --git a/generated/stripe_core/src/notification_event/requests.rs b/generated/stripe_core/src/notification_event/requests.rs new file mode 100644 index 000000000..f8b6920c9 --- /dev/null +++ b/generated/stripe_core/src/notification_event/requests.rs @@ -0,0 +1,85 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListNotificationEvent<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Filter events by whether all webhooks were successfully delivered. + /// + /// If false, events which are still pending or have failed all delivery attempts to a webhook endpoint will be returned. + #[serde(skip_serializing_if = "Option::is_none")] + pub delivery_success: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// A string containing a specific event name, or group of events using * as a wildcard. + /// + /// The list will be filtered to include only events with a matching event property. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option<&'a str>, + /// An array of up to 20 strings containing specific event names. + /// + /// The list will be filtered to include only events with a matching event property. + /// You may pass either `type` or `types`, but not both. + #[serde(skip_serializing_if = "Option::is_none")] + pub types: Option<&'a [&'a str]>, +} +impl<'a> ListNotificationEvent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListNotificationEvent<'a> { + /// List events, going back up to 30 days. + /// + /// Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) `api_version` attribute (not according to your current Stripe API version or `Stripe-Version` header). + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/events", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/events", self) + } +} +impl<'a> stripe::PaginationParams for ListNotificationEvent<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveNotificationEvent<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveNotificationEvent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveNotificationEvent<'a> { + /// Retrieves the details of an event. + /// + /// Supply the unique identifier of the event, which you might have received in a webhook. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_types::notification_event::EventId, + ) -> stripe::Response { + client.get_query(&format!("/events/{id}"), self) + } +} diff --git a/generated/stripe_core/src/notification_event_data/mod.rs b/generated/stripe_core/src/notification_event_data/mod.rs new file mode 100644 index 000000000..fdaa56ba8 --- /dev/null +++ b/generated/stripe_core/src/notification_event_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::notification_event_data::*; \ No newline at end of file diff --git a/generated/stripe_core/src/notification_event_request/mod.rs b/generated/stripe_core/src/notification_event_request/mod.rs new file mode 100644 index 000000000..87ab5d726 --- /dev/null +++ b/generated/stripe_core/src/notification_event_request/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::notification_event_request::*; \ No newline at end of file diff --git a/generated/stripe_core/src/offline_acceptance/mod.rs b/generated/stripe_core/src/offline_acceptance/mod.rs new file mode 100644 index 000000000..1cd7d2bfc --- /dev/null +++ b/generated/stripe_core/src/offline_acceptance/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::offline_acceptance::*; \ No newline at end of file diff --git a/generated/stripe_core/src/online_acceptance/mod.rs b/generated/stripe_core/src/online_acceptance/mod.rs new file mode 100644 index 000000000..60c7abc95 --- /dev/null +++ b/generated/stripe_core/src/online_acceptance/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::online_acceptance::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_flows_amount_details/mod.rs b/generated/stripe_core/src/payment_flows_amount_details/mod.rs new file mode 100644 index 000000000..2ce5b9c1d --- /dev/null +++ b/generated/stripe_core/src/payment_flows_amount_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_flows_amount_details::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_flows_amount_details_resource_tip/mod.rs b/generated/stripe_core/src/payment_flows_amount_details_resource_tip/mod.rs new file mode 100644 index 000000000..197d06a67 --- /dev/null +++ b/generated/stripe_core/src/payment_flows_amount_details_resource_tip/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_flows_amount_details_resource_tip::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_flows_automatic_payment_methods_payment_intent/mod.rs b/generated/stripe_core/src/payment_flows_automatic_payment_methods_payment_intent/mod.rs new file mode 100644 index 000000000..a8e7d35c9 --- /dev/null +++ b/generated/stripe_core/src/payment_flows_automatic_payment_methods_payment_intent/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_flows_automatic_payment_methods_payment_intent::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_flows_automatic_payment_methods_setup_intent/mod.rs b/generated/stripe_core/src/payment_flows_automatic_payment_methods_setup_intent/mod.rs new file mode 100644 index 000000000..5422e772c --- /dev/null +++ b/generated/stripe_core/src/payment_flows_automatic_payment_methods_setup_intent/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_flows_automatic_payment_methods_setup_intent::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_flows_setup_intent_setup_attempt/mod.rs b/generated/stripe_core/src/payment_flows_setup_intent_setup_attempt/mod.rs new file mode 100644 index 000000000..c04fccbfe --- /dev/null +++ b/generated/stripe_core/src/payment_flows_setup_intent_setup_attempt/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::payment_flows_setup_intent_setup_attempt::*; +#[cfg(feature = "payment_flows_setup_intent_setup_attempt")] +mod requests; +#[cfg(feature = "payment_flows_setup_intent_setup_attempt")] +pub use requests::*; diff --git a/generated/stripe_core/src/payment_flows_setup_intent_setup_attempt/requests.rs b/generated/stripe_core/src/payment_flows_setup_intent_setup_attempt/requests.rs new file mode 100644 index 000000000..ecbfb0abf --- /dev/null +++ b/generated/stripe_core/src/payment_flows_setup_intent_setup_attempt/requests.rs @@ -0,0 +1,59 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListPaymentFlowsSetupIntentSetupAttempt<'a> { + /// A filter on the list, based on the object `created` field. + /// + /// The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return SetupAttempts created by the SetupIntent specified by + /// this ID. + pub setup_intent: &'a str, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListPaymentFlowsSetupIntentSetupAttempt<'a> { + pub fn new(setup_intent: &'a str) -> Self { + Self { + created: Default::default(), + ending_before: Default::default(), + expand: Default::default(), + limit: Default::default(), + setup_intent, + starting_after: Default::default(), + } + } +} +impl<'a> ListPaymentFlowsSetupIntentSetupAttempt<'a> { + /// Returns a list of SetupAttempts that associate with a provided SetupIntent. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> + { + client.get_query("/setup_attempts", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/setup_attempts", self) + } +} +impl<'a> stripe::PaginationParams for ListPaymentFlowsSetupIntentSetupAttempt<'a> {} diff --git a/generated/stripe_core/src/payment_intent/mod.rs b/generated/stripe_core/src/payment_intent/mod.rs new file mode 100644 index 000000000..ec4d5db1e --- /dev/null +++ b/generated/stripe_core/src/payment_intent/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::payment_intent::*; +#[cfg(feature = "payment_intent")] +mod requests; +#[cfg(feature = "payment_intent")] +pub use requests::*; diff --git a/generated/stripe_core/src/payment_intent/requests.rs b/generated/stripe_core/src/payment_intent/requests.rs new file mode 100644 index 000000000..e301f17be --- /dev/null +++ b/generated/stripe_core/src/payment_intent/requests.rs @@ -0,0 +1,20296 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SearchPaymentIntent<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for pagination across multiple pages of results. + /// + /// Don't include this parameter on the first call. + /// Use the next_page value returned in a previous response to request subsequent results. + #[serde(skip_serializing_if = "Option::is_none")] + pub page: Option<&'a str>, + /// The search query string. + /// + /// See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for payment intents](https://stripe.com/docs/search#query-fields-for-payment-intents). + pub query: &'a str, +} +impl<'a> SearchPaymentIntent<'a> { + pub fn new(query: &'a str) -> Self { + Self { + expand: Default::default(), + limit: Default::default(), + page: Default::default(), + query, + } + } +} +impl<'a> SearchPaymentIntent<'a> { + /// Search for PaymentIntents you’ve previously created using Stripe’s [Search Query Language](https://stripe.com/docs/search#search-query-language). + /// Don’t use search in read-after-write flows where strict consistency is necessary. + /// + /// Under normal operating conditions, data is searchable in less than a minute. + /// Occasionally, propagation of new or updated data can be up to an hour behind during outages. + /// Search functionality is not available to merchants in India. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.get_query("/payment_intents/search", self) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SearchReturned { + pub data: Vec, + pub has_more: bool, + pub next_page: Option, + /// String representing the object's type. + /// + /// Objects of the same type share the same value. + pub object: SearchReturnedObject, + /// The total number of objects that match the query, only accurate up to 10,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub total_count: Option, + pub url: String, +} +/// String representing the object's type. +/// +/// Objects of the same type share the same value. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SearchReturnedObject { + SearchResult, +} +impl SearchReturnedObject { + pub fn as_str(self) -> &'static str { + use SearchReturnedObject::*; + match self { + SearchResult => "search_result", + } + } +} + +impl std::str::FromStr for SearchReturnedObject { + type Err = (); + fn from_str(s: &str) -> Result { + use SearchReturnedObject::*; + match s { + "search_result" => Ok(SearchResult), + _ => Err(()), + } + } +} +impl AsRef for SearchReturnedObject { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SearchReturnedObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SearchReturnedObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SearchReturnedObject { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SearchReturnedObject { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SearchReturnedObject")) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntent<'a> { + /// Amount intended to be collected by this PaymentIntent. + /// + /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + pub amount: i64, + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// + /// The amount of the application fee collected will be capped at the total payment amount. + /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_payment_methods: Option, + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent immediately. + /// + /// This parameter defaults to `false`. + /// When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm). + #[serde(skip_serializing_if = "Option::is_none")] + pub confirm: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_method: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the Customer this PaymentIntent belongs to, if one exists. + /// + /// Payment methods attached to other Customers cannot be used with this PaymentIntent. + /// + /// If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. + /// + /// Use this parameter for simpler integrations that don't handle customer actions, such as [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). + /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + #[serde(skip_serializing_if = "Option::is_none")] + pub error_on_requires_action: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// ID of the mandate that's used for this payment. + /// + /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate: Option<&'a str>, + /// This hash contains details about the Mandate to create. + /// + /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_data: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. + /// + /// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). + /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + #[serde(skip_serializing_if = "Option::is_none")] + pub off_session: Option, + /// The Stripe account ID that these funds are intended for. + /// + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent. + /// + /// If you don't provide the `payment_method` parameter or the `source` parameter with `confirm=true`, `source` automatically populates with `customer.default_source` to improve migration for users of the Charges API. + /// + /// We recommend that you explicitly provide the `payment_method` moving forward. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// The ID of the payment method configuration to use with this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_configuration: Option<&'a str>, + /// If provided, this hash will be used to create a PaymentMethod. + /// + /// The new PaymentMethod will appear in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) property on the PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_data: Option>, + /// Payment method-specific configuration for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The list of payment method types (for example, a card) that this PaymentIntent can use. + /// + /// If you don't provide this, it defaults to ["card"]. + /// Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [&'a str]>, + /// Options to configure Radar. + /// + /// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// Email address to send the receipt to. + /// + /// If you specify `receipt_email` for a payment in live mode, you send a receipt regardless of your [email settings](https://dashboard.stripe.com/account/emails). + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt_email: Option<&'a str>, + /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. + /// + /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Shipping information for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// For non-card charges, you can use this value as the complete description that appears on your customers’ statements. + /// + /// It must contain at least one letter and be 1–22 characters long. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// Provides information about a card payment that customers see on their statements. + /// + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. + /// The concatenated descriptor must contain 1-22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix: Option<&'a str>, + /// The parameters that you can use to automatically create a Transfer. + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, + /// A string that identifies the resulting payment as part of a group. + /// + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, + /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_stripe_sdk: Option, +} +impl<'a> CreatePaymentIntent<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { + amount, + application_fee_amount: Default::default(), + automatic_payment_methods: Default::default(), + capture_method: Default::default(), + confirm: Default::default(), + confirmation_method: Default::default(), + currency, + customer: Default::default(), + description: Default::default(), + error_on_requires_action: Default::default(), + expand: Default::default(), + mandate: Default::default(), + mandate_data: Default::default(), + metadata: Default::default(), + off_session: Default::default(), + on_behalf_of: Default::default(), + payment_method: Default::default(), + payment_method_configuration: Default::default(), + payment_method_data: Default::default(), + payment_method_options: Default::default(), + payment_method_types: Default::default(), + radar_options: Default::default(), + receipt_email: Default::default(), + return_url: Default::default(), + setup_future_usage: Default::default(), + shipping: Default::default(), + statement_descriptor: Default::default(), + statement_descriptor_suffix: Default::default(), + transfer_data: Default::default(), + transfer_group: Default::default(), + use_stripe_sdk: Default::default(), + } + } +} +/// When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentAutomaticPaymentMethods { + /// Controls whether this PaymentIntent will accept redirect-based payment methods. + /// + /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. + /// + /// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redirects: Option, + /// Whether this feature is enabled. + pub enabled: bool, +} +impl CreatePaymentIntentAutomaticPaymentMethods { + pub fn new(enabled: bool) -> Self { + Self { allow_redirects: Default::default(), enabled } + } +} +/// Controls whether this PaymentIntent will accept redirect-based payment methods. +/// +/// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. +/// +/// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + Always, + Never, +} +impl CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::*; + match self { + Always => "always", + Never => "never", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::*; + match s { + "always" => Ok(Always), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentCaptureMethod { + Automatic, + AutomaticAsync, + Manual, +} +impl CreatePaymentIntentCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentCaptureMethod::*; + match self { + Automatic => "automatic", + AutomaticAsync => "automatic_async", + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentCaptureMethod::*; + match s { + "automatic" => Ok(Automatic), + "automatic_async" => Ok(AutomaticAsync), + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentConfirmationMethod { + Automatic, + Manual, +} +impl CreatePaymentIntentConfirmationMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentConfirmationMethod::*; + match self { + Automatic => "automatic", + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentConfirmationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentConfirmationMethod::*; + match s { + "automatic" => Ok(Automatic), + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentConfirmationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentConfirmationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentConfirmationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentConfirmationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This hash contains details about the Mandate to create. +/// +/// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentMandateData<'a> { + /// This hash contains details about the customer acceptance of the Mandate. + pub customer_acceptance: CreatePaymentIntentMandateDataCustomerAcceptance<'a>, +} +impl<'a> CreatePaymentIntentMandateData<'a> { + pub fn new(customer_acceptance: CreatePaymentIntentMandateDataCustomerAcceptance<'a>) -> Self { + Self { customer_acceptance } + } +} +/// This hash contains details about the customer acceptance of the Mandate. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentMandateDataCustomerAcceptance<'a> { + /// The time at which the customer accepted the Mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub accepted_at: Option, + /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option<&'a serde_json::Value>, + /// If this is a Mandate accepted online, this hash contains details about the online acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub online: Option>, + /// The type of customer acceptance information included with the Mandate. + /// + /// One of `online` or `offline`. + #[serde(rename = "type")] + pub type_: CreatePaymentIntentMandateDataCustomerAcceptanceType, +} +impl<'a> CreatePaymentIntentMandateDataCustomerAcceptance<'a> { + pub fn new(type_: CreatePaymentIntentMandateDataCustomerAcceptanceType) -> Self { + Self { + accepted_at: Default::default(), + offline: Default::default(), + online: Default::default(), + type_, + } + } +} +/// If this is a Mandate accepted online, this hash contains details about the online acceptance. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentMandateDataCustomerAcceptanceOnline<'a> { + /// The IP address from which the Mandate was accepted by the customer. + pub ip_address: &'a str, + /// The user agent of the browser from which the Mandate was accepted by the customer. + pub user_agent: &'a str, +} +impl<'a> CreatePaymentIntentMandateDataCustomerAcceptanceOnline<'a> { + pub fn new(ip_address: &'a str, user_agent: &'a str) -> Self { + Self { ip_address, user_agent } + } +} +/// The type of customer acceptance information included with the Mandate. +/// +/// One of `online` or `offline`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentMandateDataCustomerAcceptanceType { + Offline, + Online, +} +impl CreatePaymentIntentMandateDataCustomerAcceptanceType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentMandateDataCustomerAcceptanceType::*; + match self { + Offline => "offline", + Online => "online", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentMandateDataCustomerAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentMandateDataCustomerAcceptanceType::*; + match s { + "offline" => Ok(Offline), + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentMandateDataCustomerAcceptanceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentMandateDataCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentMandateDataCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentMandateDataCustomerAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. +/// +/// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). +/// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreatePaymentIntentOffSession { + Bool(bool), + OneOff, + Recurring, +} +/// If provided, this hash will be used to create a PaymentMethod. +/// +/// The new PaymentMethod will appear in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) property on the PaymentIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodData<'a> { + /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option<&'a serde_json::Value>, + /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option<&'a serde_json::Value>, + /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option<&'a serde_json::Value>, + /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option>, + /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option>, + /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option<&'a serde_json::Value>, + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: Option>, + /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option<&'a serde_json::Value>, + /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option>, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option<&'a serde_json::Value>, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option<&'a serde_json::Value>, + /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option<&'a serde_json::Value>, + /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option<&'a serde_json::Value>, + /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option<&'a serde_json::Value>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option<&'a serde_json::Value>, + /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option<&'a serde_json::Value>, + /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option<&'a serde_json::Value>, + /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option<&'a serde_json::Value>, + /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option<&'a serde_json::Value>, + /// Options to configure Radar. + /// + /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option<&'a serde_json::Value>, + /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// The type of the PaymentMethod. + /// + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + pub type_: CreatePaymentIntentPaymentMethodDataType, + /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option<&'a serde_json::Value>, + /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option<&'a serde_json::Value>, +} +impl<'a> CreatePaymentIntentPaymentMethodData<'a> { + pub fn new(type_: CreatePaymentIntentPaymentMethodDataType) -> Self { + Self { + acss_debit: Default::default(), + affirm: Default::default(), + afterpay_clearpay: Default::default(), + alipay: Default::default(), + au_becs_debit: Default::default(), + bacs_debit: Default::default(), + bancontact: Default::default(), + billing_details: Default::default(), + blik: Default::default(), + boleto: Default::default(), + cashapp: Default::default(), + customer_balance: Default::default(), + eps: Default::default(), + fpx: Default::default(), + giropay: Default::default(), + grabpay: Default::default(), + ideal: Default::default(), + interac_present: Default::default(), + klarna: Default::default(), + konbini: Default::default(), + link: Default::default(), + metadata: Default::default(), + oxxo: Default::default(), + p24: Default::default(), + paynow: Default::default(), + paypal: Default::default(), + pix: Default::default(), + promptpay: Default::default(), + radar_options: Default::default(), + revolut_pay: Default::default(), + sepa_debit: Default::default(), + sofort: Default::default(), + type_, + us_bank_account: Default::default(), + wechat_pay: Default::default(), + zip: Default::default(), + } + } +} +/// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataAcssDebit<'a> { + /// Customer's bank account number. + pub account_number: &'a str, + /// Institution number of the customer's bank. + pub institution_number: &'a str, + /// Transit number of the customer's bank. + pub transit_number: &'a str, +} +impl<'a> CreatePaymentIntentPaymentMethodDataAcssDebit<'a> { + pub fn new( + account_number: &'a str, + institution_number: &'a str, + transit_number: &'a str, + ) -> Self { + Self { account_number, institution_number, transit_number } + } +} +/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataAuBecsDebit<'a> { + /// The account number for the bank account. + pub account_number: &'a str, + /// Bank-State-Branch number of the bank account. + pub bsb_number: &'a str, +} +impl<'a> CreatePaymentIntentPaymentMethodDataAuBecsDebit<'a> { + pub fn new(account_number: &'a str, bsb_number: &'a str) -> Self { + Self { account_number, bsb_number } + } +} +/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataBacsDebit<'a> { + /// Account number of the bank account that the funds will be debited from. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Sort code of the bank account. + /// + /// (e.g., `10-20-30`). + #[serde(skip_serializing_if = "Option::is_none")] + pub sort_code: Option<&'a str>, +} +impl<'a> CreatePaymentIntentPaymentMethodDataBacsDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataBillingDetails<'a> { + /// Billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Billing phone number (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> CreatePaymentIntentPaymentMethodDataBillingDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataBillingDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreatePaymentIntentPaymentMethodDataBillingDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataBoleto<'a> { + /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers). + pub tax_id: &'a str, +} +impl<'a> CreatePaymentIntentPaymentMethodDataBoleto<'a> { + pub fn new(tax_id: &'a str) -> Self { + Self { tax_id } + } +} +/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataEps { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreatePaymentIntentPaymentMethodDataEps { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentIntentPaymentMethodDataEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentIntentPaymentMethodDataEpsBank { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodDataEpsBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataFpx { + /// Account holder type for FPX transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The customer's bank. + pub bank: CreatePaymentIntentPaymentMethodDataFpxBank, +} +impl CreatePaymentIntentPaymentMethodDataFpx { + pub fn new(bank: CreatePaymentIntentPaymentMethodDataFpxBank) -> Self { + Self { account_holder_type: Default::default(), bank } + } +} +/// Account holder type for FPX transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { + Company, + Individual, +} +impl CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentIntentPaymentMethodDataFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentIntentPaymentMethodDataFpxBank { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodDataFpxBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataIdeal { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreatePaymentIntentPaymentMethodDataIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentIntentPaymentMethodDataIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentIntentPaymentMethodDataIdealBank { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodDataIdealBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataKlarna { + /// Customer's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, +} +impl CreatePaymentIntentPaymentMethodDataKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Customer's date of birth. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataKlarnaDob { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl CreatePaymentIntentPaymentMethodDataKlarnaDob { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataP24 { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreatePaymentIntentPaymentMethodDataP24 { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentIntentPaymentMethodDataP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentIntentPaymentMethodDataP24Bank { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodDataP24Bank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options to configure Radar. +/// +/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataRadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> CreatePaymentIntentPaymentMethodDataRadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataSepaDebit<'a> { + /// IBAN of the bank account. + pub iban: &'a str, +} +impl<'a> CreatePaymentIntentPaymentMethodDataSepaDebit<'a> { + pub fn new(iban: &'a str) -> Self { + Self { iban } + } +} +/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataSofort { + /// Two-letter ISO code representing the country the bank account is located in. + pub country: CreatePaymentIntentPaymentMethodDataSofortCountry, +} +impl CreatePaymentIntentPaymentMethodDataSofort { + pub fn new(country: CreatePaymentIntentPaymentMethodDataSofortCountry) -> Self { + Self { country } + } +} +/// Two-letter ISO code representing the country the bank account is located in. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodDataSofortCountry { + At, + Be, + De, + Es, + It, + Nl, +} +impl CreatePaymentIntentPaymentMethodDataSofortCountry { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataSofortCountry::*; + match self { + At => "AT", + Be => "BE", + De => "DE", + Es => "ES", + It => "IT", + Nl => "NL", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataSofortCountry { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataSofortCountry::*; + match s { + "AT" => Ok(At), + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "IT" => Ok(It), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodDataSofortCountry { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataSofortCountry { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of the PaymentMethod. +/// +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentIntentPaymentMethodDataType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentIntentPaymentMethodDataType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodDataType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataUsBankAccount<'a> { + /// Account holder type: individual or company. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: + Option, + /// Account number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Account type: checkings or savings. + /// + /// Defaults to checking if omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// The ID of a Financial Connections Account to use as a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections_account: Option<&'a str>, + /// Routing number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> CreatePaymentIntentPaymentMethodDataUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + Company, + Individual, +} +impl CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Account type: checkings or savings. +/// +/// Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + Checking, + Savings, +} +impl CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment method-specific configuration for this PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptions<'a> { + /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option>, + /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option>, + /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option>, + /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + /// Configuration for any card payments attempted on this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option, + /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option>, + /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option>, + /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option>, + /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option>, + /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option, + /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option, + /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Demo Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option>, + /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebit<'a> { + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsAcssDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Mandate creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + /// A URL for custom mandate text to render during confirmation step. + /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option<&'a str>, + /// Description of the mandate interval. + /// + /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_description: Option<&'a str>, + /// Payment schedule for the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_schedule: + Option, + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: + Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsAffirm<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred language of the Affirm authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsAffirm<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + Manual, +} +impl CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: + Option, + /// An internal identifier or reference that this payment corresponds to. + /// + /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + Manual, +} +impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsAlipay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsAlipay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + None, + OffSession, +} +impl CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsAuBecsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreatePaymentIntentPaymentMethodOptionsAuBecsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsBacsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreatePaymentIntentPaymentMethodOptionsBacsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreatePaymentIntentPaymentMethodOptionsBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + None, + OffSession, +} +impl CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsBlik<'a> { + /// The 6-digit BLIK code that a customer has generated using their banking application. + /// + /// Can only be set on confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option<&'a str>, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsBlik<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsBoleto { + /// The number of calendar days before a Boleto voucher expires. + /// + /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsBoleto { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for any card payments attempted on this PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCard<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// A single-use `cvc_update` Token that represents a card CVC value. + /// + /// When provided, the CVC value will be verified during the card payment attempt. + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc_token: Option<&'a str>, + /// Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + /// + /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + #[serde(skip_serializing_if = "Option::is_none")] + pub installments: Option, + /// Configuration options for setting up an eMandate for cards issued in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// When specified, this parameter indicates that a transaction will be marked + /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. + /// + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub moto: Option, + /// Selected network to process this PaymentIntent on. + /// + /// Depends on the available networks of the card attached to the PaymentIntent. + /// Can be only set confirm-time. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, + /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_extended_authorization: + Option, + /// Request ability to [increment](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_incremental_authorization: + Option, + /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_multicapture: + Option, + /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_overcapture: Option, + /// 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). + /// + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// Permitted values include: `automatic` or `any`. + /// If not provided, defaults to `automatic`. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Provides information about a card payment that customers see on their statements. + /// + /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kana: Option<&'a str>, + /// Provides information about a card payment that customers see on their statements. + /// + /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 17 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kanji: Option<&'a str>, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + Manual, +} +impl CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Installment configuration for payments attempted on this PaymentIntent (Mexico Only). +/// +/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallments { + /// Setting to true enables installments for this PaymentIntent. + /// This will cause the response to contain a list of available installment plans. + /// Setting to false will prevent any selected plan from applying to a charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// The selected installment plan to use for this payment attempt. + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsCardInstallments { + pub fn new() -> Self { + Self::default() + } +} +/// The selected installment plan to use for this payment attempt. +/// This parameter can only be provided during confirmation. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan { + /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + pub count: u64, + /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + /// One of `month`. + pub interval: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, + /// Type of installment plan, one of `fixed_count`. + #[serde(rename = "type")] + pub type_: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType, +} +impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan { + pub fn new( + count: u64, + interval: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, + type_: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType, + ) -> Self { + Self { count, interval, type_ } + } +} +/// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. +/// One of `month`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + Month, +} +impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match self { + Month => "month", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match s { + "month" => Ok(Month), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of installment plan, one of `fixed_count`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + FixedCount, +} +impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*; + match self { + FixedCount => "fixed_count", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*; + match s { + "fixed_count" => Ok(FixedCount), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration options for setting up an eMandate for cards issued in India. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCardMandateOptions<'a> { + /// Amount to be charged for future payments. + pub amount: i64, + /// One of `fixed` or `maximum`. + /// + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// End date of the mandate or subscription. + /// + /// If not provided, the mandate will be active until canceled. + /// If provided, end date should be after start date. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// Specifies payment frequency. + /// + /// One of `day`, `week`, `month`, `year`, or `sporadic`. + pub interval: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval, + /// The number of intervals between payments. + /// + /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// This parameter is optional when `interval=sporadic`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, + /// Unique identifier for the mandate or subscription. + pub reference: &'a str, + /// Start date of the mandate or subscription. + /// + /// Start date should not be lesser than yesterday. + pub start_date: stripe_types::Timestamp, + /// Specifies the type of mandates supported. + /// + /// Possible values are `india`. + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_types: + Option<&'a [CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes]>, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsCardMandateOptions<'a> { + pub fn new( + amount: i64, + amount_type: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType, + interval: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval, + reference: &'a str, + start_date: stripe_types::Timestamp, + ) -> Self { + Self { + amount, + amount_type, + description: Default::default(), + end_date: Default::default(), + interval, + interval_count: Default::default(), + reference, + start_date, + supported_types: Default::default(), + } + } +} +/// One of `fixed` or `maximum`. +/// +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies payment frequency. +/// +/// One of `day`, `week`, `month`, `year`, or `sporadic`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + Day, + Month, + Sporadic, + Week, + Year, +} +impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match self { + Day => "day", + Month => "month", + Sporadic => "sporadic", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "sporadic" => Ok(Sporadic), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies the type of mandates supported. +/// +/// Possible values are `india`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + India, +} +impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match self { + India => "india", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match s { + "india" => Ok(India), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Selected network to process this PaymentIntent on. +/// +/// Depends on the available networks of the card attached to the PaymentIntent. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl CreatePaymentIntentPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + IfAvailable, + Never, +} +impl CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [increment](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + IfAvailable, + Never, +} +impl CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + IfAvailable, + Never, +} +impl CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + IfAvailable, + Never, +} +impl CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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). +/// +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// Permitted values include: `automatic` or `any`. +/// If not provided, defaults to `automatic`. +/// 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. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, +} +impl CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCardPresent { + /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity). + #[serde(skip_serializing_if = "Option::is_none")] + pub request_extended_authorization: Option, + /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. + /// + /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_incremental_authorization_support: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsCardPresent { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCashapp { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsCashapp { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + Manual, +} +impl CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalance<'a> { + /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: + Option>, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// + /// Permitted values include: `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub funding_type: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsCustomerBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + /// Configuration for the eu_bank_transfer funding type. +#[serde(skip_serializing_if = "Option::is_none")] +pub eu_bank_transfer: Option>, + /// List of address types that should be returned in the financial_addresses response. + /// + /// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[serde(skip_serializing_if = "Option::is_none")] +pub requested_address_types: Option<&'a [CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes]>, + /// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[serde(rename = "type")] +pub type_: CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType, + +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + pub fn new( + type_: CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType, + ) -> Self { + Self { + eu_bank_transfer: Default::default(), + requested_address_types: Default::default(), + type_, + } + } +} +/// Configuration for the eu_bank_transfer funding type. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer<'a> { + /// The desired country code of the bank account information. + /// + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: &'a str, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer<'a> { + pub fn new(country: &'a str) -> Self { + Self { country } + } +} +/// List of address types that should be returned in the financial_addresses response. +/// +/// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + Aba, + Iban, + Sepa, + SortCode, + Spei, + Swift, + Zengin, +} +impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match self { + Aba => "aba", + Iban => "iban", + Sepa => "sepa", + SortCode => "sort_code", + Spei => "spei", + Swift => "swift", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match s { + "aba" => Ok(Aba), + "iban" => Ok(Iban), + "sepa" => Ok(Sepa), + "sort_code" => Ok(SortCode), + "spei" => Ok(Spei), + "swift" => Ok(Swift), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "gb_bank_transfer" => Ok(GbBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + "mx_bank_transfer" => Ok(MxBankTransfer), + "us_bank_transfer" => Ok(UsBankTransfer), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The funding method type to be used when there are not enough funds in the customer balance. +/// +/// Permitted values include: `bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + BankTransfer, +} +impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsEps { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsEps { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsFpx { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsFpx { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsGiropay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsGiropay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsGrabpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsGrabpay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsIdeal { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + None, + OffSession, +} +impl CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsKlarna { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred language of the Klarna authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + Manual, +} +impl CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Preferred language of the Klarna authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + CsMinusCz, + DaMinusDk, + DeMinusAt, + DeMinusCh, + DeMinusDe, + ElMinusGr, + EnMinusAt, + EnMinusAu, + EnMinusBe, + EnMinusCa, + EnMinusCh, + EnMinusCz, + EnMinusDe, + EnMinusDk, + EnMinusEs, + EnMinusFi, + EnMinusFr, + EnMinusGb, + EnMinusGr, + EnMinusIe, + EnMinusIt, + EnMinusNl, + EnMinusNo, + EnMinusNz, + EnMinusPl, + EnMinusPt, + EnMinusSe, + EnMinusUs, + EsMinusEs, + EsMinusUs, + FiMinusFi, + FrMinusBe, + FrMinusCa, + FrMinusCh, + FrMinusFr, + ItMinusCh, + ItMinusIt, + NbMinusNo, + NlMinusBe, + NlMinusNl, + PlMinusPl, + PtMinusPt, + SvMinusFi, + SvMinusSe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*; + match self { + CsMinusCz => "cs-CZ", + DaMinusDk => "da-DK", + DeMinusAt => "de-AT", + DeMinusCh => "de-CH", + DeMinusDe => "de-DE", + ElMinusGr => "el-GR", + EnMinusAt => "en-AT", + EnMinusAu => "en-AU", + EnMinusBe => "en-BE", + EnMinusCa => "en-CA", + EnMinusCh => "en-CH", + EnMinusCz => "en-CZ", + EnMinusDe => "en-DE", + EnMinusDk => "en-DK", + EnMinusEs => "en-ES", + EnMinusFi => "en-FI", + EnMinusFr => "en-FR", + EnMinusGb => "en-GB", + EnMinusGr => "en-GR", + EnMinusIe => "en-IE", + EnMinusIt => "en-IT", + EnMinusNl => "en-NL", + EnMinusNo => "en-NO", + EnMinusNz => "en-NZ", + EnMinusPl => "en-PL", + EnMinusPt => "en-PT", + EnMinusSe => "en-SE", + EnMinusUs => "en-US", + EsMinusEs => "es-ES", + EsMinusUs => "es-US", + FiMinusFi => "fi-FI", + FrMinusBe => "fr-BE", + FrMinusCa => "fr-CA", + FrMinusCh => "fr-CH", + FrMinusFr => "fr-FR", + ItMinusCh => "it-CH", + ItMinusIt => "it-IT", + NbMinusNo => "nb-NO", + NlMinusBe => "nl-BE", + NlMinusNl => "nl-NL", + PlMinusPl => "pl-PL", + PtMinusPt => "pt-PT", + SvMinusFi => "sv-FI", + SvMinusSe => "sv-SE", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*; + match s { + "cs-CZ" => Ok(CsMinusCz), + "da-DK" => Ok(DaMinusDk), + "de-AT" => Ok(DeMinusAt), + "de-CH" => Ok(DeMinusCh), + "de-DE" => Ok(DeMinusDe), + "el-GR" => Ok(ElMinusGr), + "en-AT" => Ok(EnMinusAt), + "en-AU" => Ok(EnMinusAu), + "en-BE" => Ok(EnMinusBe), + "en-CA" => Ok(EnMinusCa), + "en-CH" => Ok(EnMinusCh), + "en-CZ" => Ok(EnMinusCz), + "en-DE" => Ok(EnMinusDe), + "en-DK" => Ok(EnMinusDk), + "en-ES" => Ok(EnMinusEs), + "en-FI" => Ok(EnMinusFi), + "en-FR" => Ok(EnMinusFr), + "en-GB" => Ok(EnMinusGb), + "en-GR" => Ok(EnMinusGr), + "en-IE" => Ok(EnMinusIe), + "en-IT" => Ok(EnMinusIt), + "en-NL" => Ok(EnMinusNl), + "en-NO" => Ok(EnMinusNo), + "en-NZ" => Ok(EnMinusNz), + "en-PL" => Ok(EnMinusPl), + "en-PT" => Ok(EnMinusPt), + "en-SE" => Ok(EnMinusSe), + "en-US" => Ok(EnMinusUs), + "es-ES" => Ok(EsMinusEs), + "es-US" => Ok(EsMinusUs), + "fi-FI" => Ok(FiMinusFi), + "fr-BE" => Ok(FrMinusBe), + "fr-CA" => Ok(FrMinusCa), + "fr-CH" => Ok(FrMinusCh), + "fr-FR" => Ok(FrMinusFr), + "it-CH" => Ok(ItMinusCh), + "it-IT" => Ok(ItMinusIt), + "nb-NO" => Ok(NbMinusNo), + "nl-BE" => Ok(NlMinusBe), + "nl-NL" => Ok(NlMinusNl), + "pl-PL" => Ok(PlMinusPl), + "pt-PT" => Ok(PtMinusPt), + "sv-FI" => Ok(SvMinusFi), + "sv-SE" => Ok(SvMinusSe), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsKonbini<'a> { + /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. + /// + /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. + /// We recommend to use the customer's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_number: Option<&'a str>, + /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. + /// + /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. + /// Defaults to 3 days. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// The timestamp at which the Konbini payment instructions will expire. + /// + /// Only one of `expires_after_days` or `expires_at` may be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsKonbini<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsLink<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// \[Deprecated\] This is a legacy parameter that no longer has any function. + #[serde(skip_serializing_if = "Option::is_none")] + pub persistent_token: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + Manual, +} +impl CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + None, + OffSession, +} +impl CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsOxxo { + /// The number of calendar days before an OXXO voucher expires. + /// + /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsOxxo { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsP24 { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Confirm that the payer has accepted the P24 terms and conditions. + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_shown_and_accepted: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsP24 { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsPaynow { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsPaynow { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsPaypal<'a> { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. + /// + /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// The risk correlation ID for an on-session payment using a saved PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub risk_correlation_id: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsPaypal<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + Manual, +} +impl CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + CsMinusCz, + DaMinusDk, + DeMinusAt, + DeMinusDe, + DeMinusLu, + ElMinusGr, + EnMinusGb, + EnMinusUs, + EsMinusEs, + FiMinusFi, + FrMinusBe, + FrMinusFr, + FrMinusLu, + HuMinusHu, + ItMinusIt, + NlMinusBe, + NlMinusNl, + PlMinusPl, + PtMinusPt, + SkMinusSk, + SvMinusSe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*; + match self { + CsMinusCz => "cs-CZ", + DaMinusDk => "da-DK", + DeMinusAt => "de-AT", + DeMinusDe => "de-DE", + DeMinusLu => "de-LU", + ElMinusGr => "el-GR", + EnMinusGb => "en-GB", + EnMinusUs => "en-US", + EsMinusEs => "es-ES", + FiMinusFi => "fi-FI", + FrMinusBe => "fr-BE", + FrMinusFr => "fr-FR", + FrMinusLu => "fr-LU", + HuMinusHu => "hu-HU", + ItMinusIt => "it-IT", + NlMinusBe => "nl-BE", + NlMinusNl => "nl-NL", + PlMinusPl => "pl-PL", + PtMinusPt => "pt-PT", + SkMinusSk => "sk-SK", + SvMinusSe => "sv-SE", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*; + match s { + "cs-CZ" => Ok(CsMinusCz), + "da-DK" => Ok(DaMinusDk), + "de-AT" => Ok(DeMinusAt), + "de-DE" => Ok(DeMinusDe), + "de-LU" => Ok(DeMinusLu), + "el-GR" => Ok(ElMinusGr), + "en-GB" => Ok(EnMinusGb), + "en-US" => Ok(EnMinusUs), + "es-ES" => Ok(EsMinusEs), + "fi-FI" => Ok(FiMinusFi), + "fr-BE" => Ok(FrMinusBe), + "fr-FR" => Ok(FrMinusFr), + "fr-LU" => Ok(FrMinusLu), + "hu-HU" => Ok(HuMinusHu), + "it-IT" => Ok(ItMinusIt), + "nl-BE" => Ok(NlMinusBe), + "nl-NL" => Ok(NlMinusNl), + "pl-PL" => Ok(PlMinusPl), + "pt-PT" => Ok(PtMinusPt), + "sk-SK" => Ok(SkMinusSk), + "sv-SE" => Ok(SvMinusSe), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + None, + OffSession, +} +impl CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsPix { + /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. + /// + /// Defaults to 86400 seconds. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_seconds: Option, + /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). + /// + /// Defaults to 1 day in the future. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsPix { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsPromptpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreatePaymentIntentPaymentMethodOptionsPromptpay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Demo Pay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsRevolutPay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreatePaymentIntentPaymentMethodOptionsRevolutPay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + None, + OffSession, +} +impl CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsSepaDebit<'a> { + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option<&'a serde_json::Value>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsSepaDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsSofort { + /// Language shown to the payer on redirect. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsSofort { + pub fn new() -> Self { + Self::default() + } +} +/// Language shown to the payer on redirect. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + De, + En, + Es, + Fr, + It, + Nl, + Pl, +} +impl CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*; + match self { + De => "de", + En => "en", + Es => "es", + Fr => "fr", + It => "it", + Nl => "nl", + Pl => "pl", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "es" => Ok(Es), + "fr" => Ok(Fr), + "it" => Ok(It), + "nl" => Ok(Nl), + "pl" => Ok(Pl), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + None, + OffSession, +} +impl CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: + Option>, + /// Additional fields for network related functions. + #[serde(skip_serializing_if = "Option::is_none")] + pub networks: Option>, + /// Preferred transaction settlement speed. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_settlement_speed: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: Option< + &'a [CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions], + >, + /// List of data features that you would like to retrieve upon account creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prefetch: Option< + &'a [CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch], + >, + /// For webview integrations only. + /// + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, +} +impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for network related functions. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + /// Triggers validations to run across the selected networks. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: + Option<&'a [CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested]>, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Triggers validations to run across the selected networks. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + Ach, + UsDomesticWire, +} +impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Preferred transaction settlement speed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + Fastest, + Standard, +} +impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*; + match self { + Fastest => "fastest", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*; + match s { + "fastest" => Ok(Fastest), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsWechatPay<'a> { + /// The app ID registered with WeChat Pay. + /// + /// Only required when client is ios or android. + #[serde(skip_serializing_if = "Option::is_none")] + pub app_id: Option<&'a str>, + /// The client type that the end customer will pay from. + pub client: CreatePaymentIntentPaymentMethodOptionsWechatPayClient, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsWechatPay<'a> { + pub fn new(client: CreatePaymentIntentPaymentMethodOptionsWechatPayClient) -> Self { + Self { app_id: Default::default(), client, setup_future_usage: Default::default() } + } +} +/// The client type that the end customer will pay from. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsWechatPayClient { + Android, + Ios, + Web, +} +impl CreatePaymentIntentPaymentMethodOptionsWechatPayClient { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsWechatPayClient::*; + match self { + Android => "android", + Ios => "ios", + Web => "web", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsWechatPayClient { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsWechatPayClient::*; + match s { + "android" => Ok(Android), + "ios" => Ok(Ios), + "web" => Ok(Web), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsWechatPayClient { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsWechatPayClient { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsZip { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsZip { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options to configure Radar. +/// +/// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentRadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> CreatePaymentIntentRadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentSetupFutureUsage { + OffSession, + OnSession, +} +impl CreatePaymentIntentSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentSetupFutureUsage::*; + match self { + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentSetupFutureUsage::*; + match s { + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentIntentSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentIntentSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Shipping information for this PaymentIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentShipping<'a> { + /// Shipping address. + pub address: CreatePaymentIntentShippingAddress<'a>, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// Recipient name. + pub name: &'a str, + /// Recipient phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The tracking number for a physical product, obtained from the delivery service. + /// + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub tracking_number: Option<&'a str>, +} +impl<'a> CreatePaymentIntentShipping<'a> { + pub fn new(address: CreatePaymentIntentShippingAddress<'a>, name: &'a str) -> Self { + Self { + address, + carrier: Default::default(), + name, + phone: Default::default(), + tracking_number: Default::default(), + } + } +} +/// Shipping address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentShippingAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreatePaymentIntentShippingAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The parameters that you can use to automatically create a Transfer. +/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentTransferData<'a> { + /// The amount that will be transferred automatically when a charge succeeds. + /// The amount is capped at the total transaction amount and if no amount is set, + /// the full amount is transferred. + /// + /// If you intend to collect a fee and you need a more robust reporting experience, using + /// [application_fee_amount](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-application_fee_amount) + /// might be a better fit for your integration. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// If specified, successful charges will be attributed to the destination + /// account for tax reporting, and the funds from charges will be transferred + /// to the destination account. + /// + /// The ID of the resulting transfer will be returned on the successful charge's `transfer` field. + pub destination: &'a str, +} +impl<'a> CreatePaymentIntentTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount: Default::default(), destination } + } +} +impl<'a> CreatePaymentIntent<'a> { + /// Creates a PaymentIntent object. + /// + /// After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm) + /// to continue the payment. + /// + /// Learn more about [the available payment flows with the Payment Intents API](https://stripe.com/docs/payments/payment-intents). When you use `confirm=true` during creation, it’s equivalent to creating and confirming the PaymentIntent in the same call. + /// You can use any parameters available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply `confirm=true`. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/payment_intents", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPaymentIntent<'a> { + /// A filter on the list, based on the object `created` field. + /// + /// The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return PaymentIntents for the customer that this customer ID specifies. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListPaymentIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPaymentIntent<'a> { + /// Returns a list of PaymentIntents. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/payment_intents", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/payment_intents", self) + } +} +impl<'a> stripe::PaginationParams for ListPaymentIntent<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePaymentIntent<'a> { + /// The client secret of the PaymentIntent. + /// + /// We require it if you use a publishable key to retrieve the source. + #[serde(skip_serializing_if = "Option::is_none")] + pub client_secret: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePaymentIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePaymentIntent<'a> { + /// Retrieves the details of a PaymentIntent that has previously been created. + /// + /// You can retrieve a PaymentIntent client-side using a publishable key when the `client_secret` is in the query string. + /// If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. + /// Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. + pub fn send( + &self, + client: &stripe::Client, + intent: &str, + ) -> stripe::Response { + client.get_query(&format!("/payment_intents/{intent}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntent<'a> { + /// Amount intended to be collected by this PaymentIntent. + /// + /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// + /// The amount of the application fee collected will be capped at the total payment amount. + /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// ID of the Customer this PaymentIntent belongs to, if one exists. + /// + /// Payment methods attached to other Customers cannot be used with this PaymentIntent. + /// + /// If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// The ID of the payment method configuration to use with this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_configuration: Option<&'a str>, + /// If provided, this hash will be used to create a PaymentMethod. + /// + /// The new PaymentMethod will appear in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) property on the PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_data: Option>, + /// Payment-method-specific configuration for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The list of payment method types (for example, card) that this PaymentIntent can use. + /// + /// Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [&'a str]>, + /// Email address that the receipt for the resulting payment will be sent to. + /// + /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt_email: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Shipping information for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// For non-card charges, you can use this value as the complete description that appears on your customers’ statements. + /// + /// Must contain at least one letter, maximum 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// Provides information about a card payment that customers see on their statements. + /// + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters for the concatenated descriptor. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix: Option<&'a str>, + /// Use this parameter to automatically create a Transfer when the payment succeeds. + /// + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option, + /// A string that identifies the resulting payment as part of a group. + /// + /// You can only provide `transfer_group` if it hasn't been set. + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> UpdatePaymentIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentCaptureMethod { + Automatic, + AutomaticAsync, + Manual, +} +impl UpdatePaymentIntentCaptureMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentCaptureMethod::*; + match self { + Automatic => "automatic", + AutomaticAsync => "automatic_async", + Manual => "manual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentCaptureMethod::*; + match s { + "automatic" => Ok(Automatic), + "automatic_async" => Ok(AutomaticAsync), + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If provided, this hash will be used to create a PaymentMethod. +/// +/// The new PaymentMethod will appear in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) property on the PaymentIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodData<'a> { + /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option<&'a serde_json::Value>, + /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option<&'a serde_json::Value>, + /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option<&'a serde_json::Value>, + /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option>, + /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option>, + /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option<&'a serde_json::Value>, + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: Option>, + /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option<&'a serde_json::Value>, + /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option>, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option<&'a serde_json::Value>, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option<&'a serde_json::Value>, + /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option<&'a serde_json::Value>, + /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option<&'a serde_json::Value>, + /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option<&'a serde_json::Value>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option<&'a serde_json::Value>, + /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option<&'a serde_json::Value>, + /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option<&'a serde_json::Value>, + /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option<&'a serde_json::Value>, + /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option<&'a serde_json::Value>, + /// Options to configure Radar. + /// + /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option<&'a serde_json::Value>, + /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// The type of the PaymentMethod. + /// + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + pub type_: UpdatePaymentIntentPaymentMethodDataType, + /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option<&'a serde_json::Value>, + /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option<&'a serde_json::Value>, +} +impl<'a> UpdatePaymentIntentPaymentMethodData<'a> { + pub fn new(type_: UpdatePaymentIntentPaymentMethodDataType) -> Self { + Self { + acss_debit: Default::default(), + affirm: Default::default(), + afterpay_clearpay: Default::default(), + alipay: Default::default(), + au_becs_debit: Default::default(), + bacs_debit: Default::default(), + bancontact: Default::default(), + billing_details: Default::default(), + blik: Default::default(), + boleto: Default::default(), + cashapp: Default::default(), + customer_balance: Default::default(), + eps: Default::default(), + fpx: Default::default(), + giropay: Default::default(), + grabpay: Default::default(), + ideal: Default::default(), + interac_present: Default::default(), + klarna: Default::default(), + konbini: Default::default(), + link: Default::default(), + metadata: Default::default(), + oxxo: Default::default(), + p24: Default::default(), + paynow: Default::default(), + paypal: Default::default(), + pix: Default::default(), + promptpay: Default::default(), + radar_options: Default::default(), + revolut_pay: Default::default(), + sepa_debit: Default::default(), + sofort: Default::default(), + type_, + us_bank_account: Default::default(), + wechat_pay: Default::default(), + zip: Default::default(), + } + } +} +/// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataAcssDebit<'a> { + /// Customer's bank account number. + pub account_number: &'a str, + /// Institution number of the customer's bank. + pub institution_number: &'a str, + /// Transit number of the customer's bank. + pub transit_number: &'a str, +} +impl<'a> UpdatePaymentIntentPaymentMethodDataAcssDebit<'a> { + pub fn new( + account_number: &'a str, + institution_number: &'a str, + transit_number: &'a str, + ) -> Self { + Self { account_number, institution_number, transit_number } + } +} +/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataAuBecsDebit<'a> { + /// The account number for the bank account. + pub account_number: &'a str, + /// Bank-State-Branch number of the bank account. + pub bsb_number: &'a str, +} +impl<'a> UpdatePaymentIntentPaymentMethodDataAuBecsDebit<'a> { + pub fn new(account_number: &'a str, bsb_number: &'a str) -> Self { + Self { account_number, bsb_number } + } +} +/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataBacsDebit<'a> { + /// Account number of the bank account that the funds will be debited from. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Sort code of the bank account. + /// + /// (e.g., `10-20-30`). + #[serde(skip_serializing_if = "Option::is_none")] + pub sort_code: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentPaymentMethodDataBacsDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataBillingDetails<'a> { + /// Billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Billing phone number (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentPaymentMethodDataBillingDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataBoleto<'a> { + /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers). + pub tax_id: &'a str, +} +impl<'a> UpdatePaymentIntentPaymentMethodDataBoleto<'a> { + pub fn new(tax_id: &'a str) -> Self { + Self { tax_id } + } +} +/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataEps { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl UpdatePaymentIntentPaymentMethodDataEps { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdatePaymentIntentPaymentMethodDataEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdatePaymentIntentPaymentMethodDataEpsBank { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodDataEpsBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataFpx { + /// Account holder type for FPX transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The customer's bank. + pub bank: UpdatePaymentIntentPaymentMethodDataFpxBank, +} +impl UpdatePaymentIntentPaymentMethodDataFpx { + pub fn new(bank: UpdatePaymentIntentPaymentMethodDataFpxBank) -> Self { + Self { account_holder_type: Default::default(), bank } + } +} +/// Account holder type for FPX transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { + Company, + Individual, +} +impl UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdatePaymentIntentPaymentMethodDataFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdatePaymentIntentPaymentMethodDataFpxBank { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodDataFpxBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataIdeal { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl UpdatePaymentIntentPaymentMethodDataIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdatePaymentIntentPaymentMethodDataIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdatePaymentIntentPaymentMethodDataIdealBank { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodDataIdealBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataKlarna { + /// Customer's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, +} +impl UpdatePaymentIntentPaymentMethodDataKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Customer's date of birth. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataKlarnaDob { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl UpdatePaymentIntentPaymentMethodDataKlarnaDob { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataP24 { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl UpdatePaymentIntentPaymentMethodDataP24 { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdatePaymentIntentPaymentMethodDataP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdatePaymentIntentPaymentMethodDataP24Bank { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodDataP24Bank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options to configure Radar. +/// +/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataRadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentPaymentMethodDataRadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataSepaDebit<'a> { + /// IBAN of the bank account. + pub iban: &'a str, +} +impl<'a> UpdatePaymentIntentPaymentMethodDataSepaDebit<'a> { + pub fn new(iban: &'a str) -> Self { + Self { iban } + } +} +/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataSofort { + /// Two-letter ISO code representing the country the bank account is located in. + pub country: UpdatePaymentIntentPaymentMethodDataSofortCountry, +} +impl UpdatePaymentIntentPaymentMethodDataSofort { + pub fn new(country: UpdatePaymentIntentPaymentMethodDataSofortCountry) -> Self { + Self { country } + } +} +/// Two-letter ISO code representing the country the bank account is located in. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodDataSofortCountry { + At, + Be, + De, + Es, + It, + Nl, +} +impl UpdatePaymentIntentPaymentMethodDataSofortCountry { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataSofortCountry::*; + match self { + At => "AT", + Be => "BE", + De => "DE", + Es => "ES", + It => "IT", + Nl => "NL", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataSofortCountry { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataSofortCountry::*; + match s { + "AT" => Ok(At), + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "IT" => Ok(It), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodDataSofortCountry { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataSofortCountry { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of the PaymentMethod. +/// +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdatePaymentIntentPaymentMethodDataType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdatePaymentIntentPaymentMethodDataType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodDataType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataUsBankAccount<'a> { + /// Account holder type: individual or company. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: + Option, + /// Account number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Account type: checkings or savings. + /// + /// Defaults to checking if omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// The ID of a Financial Connections Account to use as a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections_account: Option<&'a str>, + /// Routing number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentPaymentMethodDataUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + Company, + Individual, +} +impl UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Account type: checkings or savings. +/// +/// Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + Checking, + Savings, +} +impl UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment-method-specific configuration for this PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptions<'a> { + /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option>, + /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option>, + /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option>, + /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + /// Configuration for any card payments attempted on this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option, + /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option>, + /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option>, + /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option>, + /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option>, + /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option, + /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option, + /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Demo Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option>, + /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebit<'a> { + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsAcssDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Mandate creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + /// A URL for custom mandate text to render during confirmation step. + /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option<&'a str>, + /// Description of the mandate interval. + /// + /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_description: Option<&'a str>, + /// Payment schedule for the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_schedule: + Option, + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: + Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsAffirm<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred language of the Affirm authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsAffirm<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + Manual, +} +impl UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: + Option, + /// An internal identifier or reference that this payment corresponds to. + /// + /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + Manual, +} +impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsAlipay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsAlipay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + None, + OffSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsBacsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsBacsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + None, + OffSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsBlik<'a> { + /// The 6-digit BLIK code that a customer has generated using their banking application. + /// + /// Can only be set on confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsBlik<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsBoleto { + /// The number of calendar days before a Boleto voucher expires. + /// + /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsBoleto { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for any card payments attempted on this PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCard<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// A single-use `cvc_update` Token that represents a card CVC value. + /// + /// When provided, the CVC value will be verified during the card payment attempt. + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc_token: Option<&'a str>, + /// Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + /// + /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + #[serde(skip_serializing_if = "Option::is_none")] + pub installments: Option, + /// Configuration options for setting up an eMandate for cards issued in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// When specified, this parameter indicates that a transaction will be marked + /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. + /// + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub moto: Option, + /// Selected network to process this PaymentIntent on. + /// + /// Depends on the available networks of the card attached to the PaymentIntent. + /// Can be only set confirm-time. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, + /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_extended_authorization: + Option, + /// Request ability to [increment](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_incremental_authorization: + Option, + /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_multicapture: + Option, + /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_overcapture: Option, + /// 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). + /// + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// Permitted values include: `automatic` or `any`. + /// If not provided, defaults to `automatic`. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Provides information about a card payment that customers see on their statements. + /// + /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kana: Option<&'a str>, + /// Provides information about a card payment that customers see on their statements. + /// + /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 17 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kanji: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + Manual, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Installment configuration for payments attempted on this PaymentIntent (Mexico Only). +/// +/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallments { + /// Setting to true enables installments for this PaymentIntent. + /// This will cause the response to contain a list of available installment plans. + /// Setting to false will prevent any selected plan from applying to a charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// The selected installment plan to use for this payment attempt. + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardInstallments { + pub fn new() -> Self { + Self::default() + } +} +/// The selected installment plan to use for this payment attempt. +/// This parameter can only be provided during confirmation. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan { + /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + pub count: u64, + /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + /// One of `month`. + pub interval: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, + /// Type of installment plan, one of `fixed_count`. + #[serde(rename = "type")] + pub type_: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan { + pub fn new( + count: u64, + interval: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, + type_: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType, + ) -> Self { + Self { count, interval, type_ } + } +} +/// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. +/// One of `month`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + Month, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match self { + Month => "month", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match s { + "month" => Ok(Month), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of installment plan, one of `fixed_count`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + FixedCount, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*; + match self { + FixedCount => "fixed_count", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*; + match s { + "fixed_count" => Ok(FixedCount), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration options for setting up an eMandate for cards issued in India. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions<'a> { + /// Amount to be charged for future payments. + pub amount: i64, + /// One of `fixed` or `maximum`. + /// + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// End date of the mandate or subscription. + /// + /// If not provided, the mandate will be active until canceled. + /// If provided, end date should be after start date. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// Specifies payment frequency. + /// + /// One of `day`, `week`, `month`, `year`, or `sporadic`. + pub interval: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval, + /// The number of intervals between payments. + /// + /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// This parameter is optional when `interval=sporadic`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, + /// Unique identifier for the mandate or subscription. + pub reference: &'a str, + /// Start date of the mandate or subscription. + /// + /// Start date should not be lesser than yesterday. + pub start_date: stripe_types::Timestamp, + /// Specifies the type of mandates supported. + /// + /// Possible values are `india`. + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_types: + Option<&'a [UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes]>, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions<'a> { + pub fn new( + amount: i64, + amount_type: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType, + interval: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval, + reference: &'a str, + start_date: stripe_types::Timestamp, + ) -> Self { + Self { + amount, + amount_type, + description: Default::default(), + end_date: Default::default(), + interval, + interval_count: Default::default(), + reference, + start_date, + supported_types: Default::default(), + } + } +} +/// One of `fixed` or `maximum`. +/// +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies payment frequency. +/// +/// One of `day`, `week`, `month`, `year`, or `sporadic`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + Day, + Month, + Sporadic, + Week, + Year, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match self { + Day => "day", + Month => "month", + Sporadic => "sporadic", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "sporadic" => Ok(Sporadic), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies the type of mandates supported. +/// +/// Possible values are `india`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + India, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match self { + India => "india", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match s { + "india" => Ok(India), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Selected network to process this PaymentIntent on. +/// +/// Depends on the available networks of the card attached to the PaymentIntent. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + IfAvailable, + Never, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [increment](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + IfAvailable, + Never, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + IfAvailable, + Never, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + IfAvailable, + Never, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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). +/// +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// Permitted values include: `automatic` or `any`. +/// If not provided, defaults to `automatic`. +/// 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. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCardPresent { + /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity). + #[serde(skip_serializing_if = "Option::is_none")] + pub request_extended_authorization: Option, + /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. + /// + /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_incremental_authorization_support: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardPresent { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCashapp { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsCashapp { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + Manual, +} +impl UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalance<'a> { + /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: + Option>, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// + /// Permitted values include: `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub funding_type: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsCustomerBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + /// Configuration for the eu_bank_transfer funding type. +#[serde(skip_serializing_if = "Option::is_none")] +pub eu_bank_transfer: Option>, + /// List of address types that should be returned in the financial_addresses response. + /// + /// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[serde(skip_serializing_if = "Option::is_none")] +pub requested_address_types: Option<&'a [UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes]>, + /// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[serde(rename = "type")] +pub type_: UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType, + +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + pub fn new( + type_: UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType, + ) -> Self { + Self { + eu_bank_transfer: Default::default(), + requested_address_types: Default::default(), + type_, + } + } +} +/// Configuration for the eu_bank_transfer funding type. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer<'a> { + /// The desired country code of the bank account information. + /// + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: &'a str, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer<'a> { + pub fn new(country: &'a str) -> Self { + Self { country } + } +} +/// List of address types that should be returned in the financial_addresses response. +/// +/// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + Aba, + Iban, + Sepa, + SortCode, + Spei, + Swift, + Zengin, +} +impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match self { + Aba => "aba", + Iban => "iban", + Sepa => "sepa", + SortCode => "sort_code", + Spei => "spei", + Swift => "swift", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match s { + "aba" => Ok(Aba), + "iban" => Ok(Iban), + "sepa" => Ok(Sepa), + "sort_code" => Ok(SortCode), + "spei" => Ok(Spei), + "swift" => Ok(Swift), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "gb_bank_transfer" => Ok(GbBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + "mx_bank_transfer" => Ok(MxBankTransfer), + "us_bank_transfer" => Ok(UsBankTransfer), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The funding method type to be used when there are not enough funds in the customer balance. +/// +/// Permitted values include: `bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + BankTransfer, +} +impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsEps { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsEps { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsFpx { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsFpx { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsGiropay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsGiropay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsGrabpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsGrabpay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsIdeal { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + None, + OffSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsKlarna { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred language of the Klarna authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + Manual, +} +impl UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Preferred language of the Klarna authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + CsMinusCz, + DaMinusDk, + DeMinusAt, + DeMinusCh, + DeMinusDe, + ElMinusGr, + EnMinusAt, + EnMinusAu, + EnMinusBe, + EnMinusCa, + EnMinusCh, + EnMinusCz, + EnMinusDe, + EnMinusDk, + EnMinusEs, + EnMinusFi, + EnMinusFr, + EnMinusGb, + EnMinusGr, + EnMinusIe, + EnMinusIt, + EnMinusNl, + EnMinusNo, + EnMinusNz, + EnMinusPl, + EnMinusPt, + EnMinusSe, + EnMinusUs, + EsMinusEs, + EsMinusUs, + FiMinusFi, + FrMinusBe, + FrMinusCa, + FrMinusCh, + FrMinusFr, + ItMinusCh, + ItMinusIt, + NbMinusNo, + NlMinusBe, + NlMinusNl, + PlMinusPl, + PtMinusPt, + SvMinusFi, + SvMinusSe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*; + match self { + CsMinusCz => "cs-CZ", + DaMinusDk => "da-DK", + DeMinusAt => "de-AT", + DeMinusCh => "de-CH", + DeMinusDe => "de-DE", + ElMinusGr => "el-GR", + EnMinusAt => "en-AT", + EnMinusAu => "en-AU", + EnMinusBe => "en-BE", + EnMinusCa => "en-CA", + EnMinusCh => "en-CH", + EnMinusCz => "en-CZ", + EnMinusDe => "en-DE", + EnMinusDk => "en-DK", + EnMinusEs => "en-ES", + EnMinusFi => "en-FI", + EnMinusFr => "en-FR", + EnMinusGb => "en-GB", + EnMinusGr => "en-GR", + EnMinusIe => "en-IE", + EnMinusIt => "en-IT", + EnMinusNl => "en-NL", + EnMinusNo => "en-NO", + EnMinusNz => "en-NZ", + EnMinusPl => "en-PL", + EnMinusPt => "en-PT", + EnMinusSe => "en-SE", + EnMinusUs => "en-US", + EsMinusEs => "es-ES", + EsMinusUs => "es-US", + FiMinusFi => "fi-FI", + FrMinusBe => "fr-BE", + FrMinusCa => "fr-CA", + FrMinusCh => "fr-CH", + FrMinusFr => "fr-FR", + ItMinusCh => "it-CH", + ItMinusIt => "it-IT", + NbMinusNo => "nb-NO", + NlMinusBe => "nl-BE", + NlMinusNl => "nl-NL", + PlMinusPl => "pl-PL", + PtMinusPt => "pt-PT", + SvMinusFi => "sv-FI", + SvMinusSe => "sv-SE", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*; + match s { + "cs-CZ" => Ok(CsMinusCz), + "da-DK" => Ok(DaMinusDk), + "de-AT" => Ok(DeMinusAt), + "de-CH" => Ok(DeMinusCh), + "de-DE" => Ok(DeMinusDe), + "el-GR" => Ok(ElMinusGr), + "en-AT" => Ok(EnMinusAt), + "en-AU" => Ok(EnMinusAu), + "en-BE" => Ok(EnMinusBe), + "en-CA" => Ok(EnMinusCa), + "en-CH" => Ok(EnMinusCh), + "en-CZ" => Ok(EnMinusCz), + "en-DE" => Ok(EnMinusDe), + "en-DK" => Ok(EnMinusDk), + "en-ES" => Ok(EnMinusEs), + "en-FI" => Ok(EnMinusFi), + "en-FR" => Ok(EnMinusFr), + "en-GB" => Ok(EnMinusGb), + "en-GR" => Ok(EnMinusGr), + "en-IE" => Ok(EnMinusIe), + "en-IT" => Ok(EnMinusIt), + "en-NL" => Ok(EnMinusNl), + "en-NO" => Ok(EnMinusNo), + "en-NZ" => Ok(EnMinusNz), + "en-PL" => Ok(EnMinusPl), + "en-PT" => Ok(EnMinusPt), + "en-SE" => Ok(EnMinusSe), + "en-US" => Ok(EnMinusUs), + "es-ES" => Ok(EsMinusEs), + "es-US" => Ok(EsMinusUs), + "fi-FI" => Ok(FiMinusFi), + "fr-BE" => Ok(FrMinusBe), + "fr-CA" => Ok(FrMinusCa), + "fr-CH" => Ok(FrMinusCh), + "fr-FR" => Ok(FrMinusFr), + "it-CH" => Ok(ItMinusCh), + "it-IT" => Ok(ItMinusIt), + "nb-NO" => Ok(NbMinusNo), + "nl-BE" => Ok(NlMinusBe), + "nl-NL" => Ok(NlMinusNl), + "pl-PL" => Ok(PlMinusPl), + "pt-PT" => Ok(PtMinusPt), + "sv-FI" => Ok(SvMinusFi), + "sv-SE" => Ok(SvMinusSe), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsKonbini<'a> { + /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. + /// + /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. + /// We recommend to use the customer's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_number: Option<&'a str>, + /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. + /// + /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. + /// Defaults to 3 days. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// The timestamp at which the Konbini payment instructions will expire. + /// + /// Only one of `expires_after_days` or `expires_at` may be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsKonbini<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsLink<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// \[Deprecated\] This is a legacy parameter that no longer has any function. + #[serde(skip_serializing_if = "Option::is_none")] + pub persistent_token: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + Manual, +} +impl UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + None, + OffSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsOxxo { + /// The number of calendar days before an OXXO voucher expires. + /// + /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsOxxo { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsP24 { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Confirm that the payer has accepted the P24 terms and conditions. + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_shown_and_accepted: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsP24 { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsPaynow { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsPaynow { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsPaypal<'a> { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. + /// + /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// The risk correlation ID for an on-session payment using a saved PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub risk_correlation_id: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsPaypal<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + Manual, +} +impl UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + CsMinusCz, + DaMinusDk, + DeMinusAt, + DeMinusDe, + DeMinusLu, + ElMinusGr, + EnMinusGb, + EnMinusUs, + EsMinusEs, + FiMinusFi, + FrMinusBe, + FrMinusFr, + FrMinusLu, + HuMinusHu, + ItMinusIt, + NlMinusBe, + NlMinusNl, + PlMinusPl, + PtMinusPt, + SkMinusSk, + SvMinusSe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*; + match self { + CsMinusCz => "cs-CZ", + DaMinusDk => "da-DK", + DeMinusAt => "de-AT", + DeMinusDe => "de-DE", + DeMinusLu => "de-LU", + ElMinusGr => "el-GR", + EnMinusGb => "en-GB", + EnMinusUs => "en-US", + EsMinusEs => "es-ES", + FiMinusFi => "fi-FI", + FrMinusBe => "fr-BE", + FrMinusFr => "fr-FR", + FrMinusLu => "fr-LU", + HuMinusHu => "hu-HU", + ItMinusIt => "it-IT", + NlMinusBe => "nl-BE", + NlMinusNl => "nl-NL", + PlMinusPl => "pl-PL", + PtMinusPt => "pt-PT", + SkMinusSk => "sk-SK", + SvMinusSe => "sv-SE", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*; + match s { + "cs-CZ" => Ok(CsMinusCz), + "da-DK" => Ok(DaMinusDk), + "de-AT" => Ok(DeMinusAt), + "de-DE" => Ok(DeMinusDe), + "de-LU" => Ok(DeMinusLu), + "el-GR" => Ok(ElMinusGr), + "en-GB" => Ok(EnMinusGb), + "en-US" => Ok(EnMinusUs), + "es-ES" => Ok(EsMinusEs), + "fi-FI" => Ok(FiMinusFi), + "fr-BE" => Ok(FrMinusBe), + "fr-FR" => Ok(FrMinusFr), + "fr-LU" => Ok(FrMinusLu), + "hu-HU" => Ok(HuMinusHu), + "it-IT" => Ok(ItMinusIt), + "nl-BE" => Ok(NlMinusBe), + "nl-NL" => Ok(NlMinusNl), + "pl-PL" => Ok(PlMinusPl), + "pt-PT" => Ok(PtMinusPt), + "sk-SK" => Ok(SkMinusSk), + "sv-SE" => Ok(SvMinusSe), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + None, + OffSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsPix { + /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. + /// + /// Defaults to 86400 seconds. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_seconds: Option, + /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). + /// + /// Defaults to 1 day in the future. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsPix { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsPromptpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsPromptpay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Demo Pay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsRevolutPay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsRevolutPay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + None, + OffSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsSepaDebit<'a> { + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option<&'a serde_json::Value>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsSepaDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsSofort { + /// Language shown to the payer on redirect. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsSofort { + pub fn new() -> Self { + Self::default() + } +} +/// Language shown to the payer on redirect. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + De, + En, + Es, + Fr, + It, + Nl, + Pl, +} +impl UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*; + match self { + De => "de", + En => "en", + Es => "es", + Fr => "fr", + It => "it", + Nl => "nl", + Pl => "pl", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "es" => Ok(Es), + "fr" => Ok(Fr), + "it" => Ok(It), + "nl" => Ok(Nl), + "pl" => Ok(Pl), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + None, + OffSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: + Option>, + /// Additional fields for network related functions. + #[serde(skip_serializing_if = "Option::is_none")] + pub networks: Option>, + /// Preferred transaction settlement speed. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_settlement_speed: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: Option< + &'a [UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions], + >, + /// List of data features that you would like to retrieve upon account creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prefetch: Option< + &'a [UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch], + >, + /// For webview integrations only. + /// + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, +} +impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for network related functions. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + /// Triggers validations to run across the selected networks. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: + Option<&'a [UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested]>, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Triggers validations to run across the selected networks. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + Ach, + UsDomesticWire, +} +impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Preferred transaction settlement speed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + Fastest, + Standard, +} +impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*; + match self { + Fastest => "fastest", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*; + match s { + "fastest" => Ok(Fastest), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsWechatPay<'a> { + /// The app ID registered with WeChat Pay. + /// + /// Only required when client is ios or android. + #[serde(skip_serializing_if = "Option::is_none")] + pub app_id: Option<&'a str>, + /// The client type that the end customer will pay from. + pub client: UpdatePaymentIntentPaymentMethodOptionsWechatPayClient, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsWechatPay<'a> { + pub fn new(client: UpdatePaymentIntentPaymentMethodOptionsWechatPayClient) -> Self { + Self { app_id: Default::default(), client, setup_future_usage: Default::default() } + } +} +/// The client type that the end customer will pay from. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { + Android, + Ios, + Web, +} +impl UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::*; + match self { + Android => "android", + Ios => "ios", + Web => "web", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::*; + match s { + "android" => Ok(Android), + "ios" => Ok(Ios), + "web" => Ok(Web), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsZip { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsZip { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentSetupFutureUsage { + OffSession, + OnSession, +} +impl UpdatePaymentIntentSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentSetupFutureUsage::*; + match self { + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentSetupFutureUsage::*; + match s { + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentIntentSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentIntentSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Shipping information for this PaymentIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentShipping<'a> { + /// Shipping address. + pub address: UpdatePaymentIntentShippingAddress<'a>, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// Recipient name. + pub name: &'a str, + /// Recipient phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The tracking number for a physical product, obtained from the delivery service. + /// + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub tracking_number: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentShipping<'a> { + pub fn new(address: UpdatePaymentIntentShippingAddress<'a>, name: &'a str) -> Self { + Self { + address, + carrier: Default::default(), + name, + phone: Default::default(), + tracking_number: Default::default(), + } + } +} +/// Shipping address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentShippingAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentShippingAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Use this parameter to automatically create a Transfer when the payment succeeds. +/// +/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentTransferData { + /// The amount that will be transferred automatically when a charge succeeds. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, +} +impl UpdatePaymentIntentTransferData { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdatePaymentIntent<'a> { + /// Updates properties on a PaymentIntent object without confirming. + /// + /// Depending on which properties you update, you might need to confirm the + /// PaymentIntent again. + /// + /// For example, updating the `payment_method` always requires you to confirm the PaymentIntent again. + /// If you prefer to update and confirm at the same time, we recommend updating properties through the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead. + pub fn send( + &self, + client: &stripe::Client, + intent: &str, + ) -> stripe::Response { + client.send_form(&format!("/payment_intents/{intent}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntent<'a> { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. + /// + /// This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub error_on_requires_action: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// ID of the mandate that's used for this payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_data: Option>, + /// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. + /// + /// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). + #[serde(skip_serializing_if = "Option::is_none")] + pub off_session: Option, + /// ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// If provided, this hash will be used to create a PaymentMethod. + /// + /// The new PaymentMethod will appear in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) property on the PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_data: Option>, + /// Payment method-specific configuration for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// Options to configure Radar. + /// + /// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// Email address that the receipt for the resulting payment will be sent to. + /// + /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt_email: Option<&'a str>, + /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. + /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + /// This parameter is only used for cards and other redirect-based payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Shipping information for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_stripe_sdk: Option, +} +impl<'a> ConfirmPaymentIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentCaptureMethod { + Automatic, + AutomaticAsync, + Manual, +} +impl ConfirmPaymentIntentCaptureMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentCaptureMethod::*; + match self { + Automatic => "automatic", + AutomaticAsync => "automatic_async", + Manual => "manual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentCaptureMethod::*; + match s { + "automatic" => Ok(Automatic), + "automatic_async" => Ok(AutomaticAsync), + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum ConfirmPaymentIntentMandateData<'a> { + SecretKeyParam(ConfirmPaymentIntentSecretKeyParam<'a>), + ClientKeyParam(ConfirmPaymentIntentClientKeyParam<'a>), +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentSecretKeyParam<'a> { + /// This hash contains details about the customer acceptance of the Mandate. + pub customer_acceptance: ConfirmPaymentIntentSecretKeyParamCustomerAcceptance<'a>, +} +impl<'a> ConfirmPaymentIntentSecretKeyParam<'a> { + pub fn new( + customer_acceptance: ConfirmPaymentIntentSecretKeyParamCustomerAcceptance<'a>, + ) -> Self { + Self { customer_acceptance } + } +} +/// This hash contains details about the customer acceptance of the Mandate. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentSecretKeyParamCustomerAcceptance<'a> { + /// The time at which the customer accepted the Mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub accepted_at: Option, + /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option<&'a serde_json::Value>, + /// If this is a Mandate accepted online, this hash contains details about the online acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub online: Option>, + /// The type of customer acceptance information included with the Mandate. + /// + /// One of `online` or `offline`. + #[serde(rename = "type")] + pub type_: ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType, +} +impl<'a> ConfirmPaymentIntentSecretKeyParamCustomerAcceptance<'a> { + pub fn new(type_: ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType) -> Self { + Self { + accepted_at: Default::default(), + offline: Default::default(), + online: Default::default(), + type_, + } + } +} +/// If this is a Mandate accepted online, this hash contains details about the online acceptance. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceOnline<'a> { + /// The IP address from which the Mandate was accepted by the customer. + pub ip_address: &'a str, + /// The user agent of the browser from which the Mandate was accepted by the customer. + pub user_agent: &'a str, +} +impl<'a> ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceOnline<'a> { + pub fn new(ip_address: &'a str, user_agent: &'a str) -> Self { + Self { ip_address, user_agent } + } +} +/// The type of customer acceptance information included with the Mandate. +/// +/// One of `online` or `offline`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType { + Offline, + Online, +} +impl ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType::*; + match self { + Offline => "offline", + Online => "online", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType::*; + match s { + "offline" => Ok(Offline), + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentClientKeyParam<'a> { + /// This hash contains details about the customer acceptance of the Mandate. + pub customer_acceptance: ConfirmPaymentIntentClientKeyParamCustomerAcceptance<'a>, +} +impl<'a> ConfirmPaymentIntentClientKeyParam<'a> { + pub fn new( + customer_acceptance: ConfirmPaymentIntentClientKeyParamCustomerAcceptance<'a>, + ) -> Self { + Self { customer_acceptance } + } +} +/// This hash contains details about the customer acceptance of the Mandate. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentClientKeyParamCustomerAcceptance<'a> { + /// If this is a Mandate accepted online, this hash contains details about the online acceptance. + pub online: ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline<'a>, + /// The type of customer acceptance information included with the Mandate. + #[serde(rename = "type")] + pub type_: ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType, +} +impl<'a> ConfirmPaymentIntentClientKeyParamCustomerAcceptance<'a> { + pub fn new( + online: ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline<'a>, + type_: ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType, + ) -> Self { + Self { online, type_ } + } +} +/// If this is a Mandate accepted online, this hash contains details about the online acceptance. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline<'a> { + /// The IP address from which the Mandate was accepted by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_address: Option<&'a str>, + /// The user agent of the browser from which the Mandate was accepted by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of customer acceptance information included with the Mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType { + Online, +} +impl ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType::*; + match self { + Online => "online", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType::*; + match s { + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. +/// +/// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum ConfirmPaymentIntentOffSession { + Bool(bool), + OneOff, + Recurring, +} +/// If provided, this hash will be used to create a PaymentMethod. +/// +/// The new PaymentMethod will appear in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) property on the PaymentIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodData<'a> { + /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option<&'a serde_json::Value>, + /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option<&'a serde_json::Value>, + /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option<&'a serde_json::Value>, + /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option>, + /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option>, + /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option<&'a serde_json::Value>, + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: Option>, + /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option<&'a serde_json::Value>, + /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option>, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option<&'a serde_json::Value>, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option<&'a serde_json::Value>, + /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option<&'a serde_json::Value>, + /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option<&'a serde_json::Value>, + /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option<&'a serde_json::Value>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option<&'a serde_json::Value>, + /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option<&'a serde_json::Value>, + /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option<&'a serde_json::Value>, + /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option<&'a serde_json::Value>, + /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option<&'a serde_json::Value>, + /// Options to configure Radar. + /// + /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option<&'a serde_json::Value>, + /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// The type of the PaymentMethod. + /// + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + pub type_: ConfirmPaymentIntentPaymentMethodDataType, + /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option<&'a serde_json::Value>, + /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option<&'a serde_json::Value>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodData<'a> { + pub fn new(type_: ConfirmPaymentIntentPaymentMethodDataType) -> Self { + Self { + acss_debit: Default::default(), + affirm: Default::default(), + afterpay_clearpay: Default::default(), + alipay: Default::default(), + au_becs_debit: Default::default(), + bacs_debit: Default::default(), + bancontact: Default::default(), + billing_details: Default::default(), + blik: Default::default(), + boleto: Default::default(), + cashapp: Default::default(), + customer_balance: Default::default(), + eps: Default::default(), + fpx: Default::default(), + giropay: Default::default(), + grabpay: Default::default(), + ideal: Default::default(), + interac_present: Default::default(), + klarna: Default::default(), + konbini: Default::default(), + link: Default::default(), + metadata: Default::default(), + oxxo: Default::default(), + p24: Default::default(), + paynow: Default::default(), + paypal: Default::default(), + pix: Default::default(), + promptpay: Default::default(), + radar_options: Default::default(), + revolut_pay: Default::default(), + sepa_debit: Default::default(), + sofort: Default::default(), + type_, + us_bank_account: Default::default(), + wechat_pay: Default::default(), + zip: Default::default(), + } + } +} +/// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataAcssDebit<'a> { + /// Customer's bank account number. + pub account_number: &'a str, + /// Institution number of the customer's bank. + pub institution_number: &'a str, + /// Transit number of the customer's bank. + pub transit_number: &'a str, +} +impl<'a> ConfirmPaymentIntentPaymentMethodDataAcssDebit<'a> { + pub fn new( + account_number: &'a str, + institution_number: &'a str, + transit_number: &'a str, + ) -> Self { + Self { account_number, institution_number, transit_number } + } +} +/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataAuBecsDebit<'a> { + /// The account number for the bank account. + pub account_number: &'a str, + /// Bank-State-Branch number of the bank account. + pub bsb_number: &'a str, +} +impl<'a> ConfirmPaymentIntentPaymentMethodDataAuBecsDebit<'a> { + pub fn new(account_number: &'a str, bsb_number: &'a str) -> Self { + Self { account_number, bsb_number } + } +} +/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataBacsDebit<'a> { + /// Account number of the bank account that the funds will be debited from. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Sort code of the bank account. + /// + /// (e.g., `10-20-30`). + #[serde(skip_serializing_if = "Option::is_none")] + pub sort_code: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodDataBacsDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataBillingDetails<'a> { + /// Billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Billing phone number (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodDataBillingDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataBoleto<'a> { + /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers). + pub tax_id: &'a str, +} +impl<'a> ConfirmPaymentIntentPaymentMethodDataBoleto<'a> { + pub fn new(tax_id: &'a str) -> Self { + Self { tax_id } + } +} +/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataEps { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl ConfirmPaymentIntentPaymentMethodDataEps { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmPaymentIntentPaymentMethodDataEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmPaymentIntentPaymentMethodDataEpsBank { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodDataEpsBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataFpx { + /// Account holder type for FPX transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The customer's bank. + pub bank: ConfirmPaymentIntentPaymentMethodDataFpxBank, +} +impl ConfirmPaymentIntentPaymentMethodDataFpx { + pub fn new(bank: ConfirmPaymentIntentPaymentMethodDataFpxBank) -> Self { + Self { account_holder_type: Default::default(), bank } + } +} +/// Account holder type for FPX transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType { + Company, + Individual, +} +impl ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmPaymentIntentPaymentMethodDataFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmPaymentIntentPaymentMethodDataFpxBank { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodDataFpxBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataIdeal { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl ConfirmPaymentIntentPaymentMethodDataIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmPaymentIntentPaymentMethodDataIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmPaymentIntentPaymentMethodDataIdealBank { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodDataIdealBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataKlarna { + /// Customer's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, +} +impl ConfirmPaymentIntentPaymentMethodDataKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Customer's date of birth. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataKlarnaDob { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl ConfirmPaymentIntentPaymentMethodDataKlarnaDob { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataP24 { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl ConfirmPaymentIntentPaymentMethodDataP24 { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmPaymentIntentPaymentMethodDataP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmPaymentIntentPaymentMethodDataP24Bank { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodDataP24Bank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options to configure Radar. +/// +/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataRadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodDataRadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataSepaDebit<'a> { + /// IBAN of the bank account. + pub iban: &'a str, +} +impl<'a> ConfirmPaymentIntentPaymentMethodDataSepaDebit<'a> { + pub fn new(iban: &'a str) -> Self { + Self { iban } + } +} +/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataSofort { + /// Two-letter ISO code representing the country the bank account is located in. + pub country: ConfirmPaymentIntentPaymentMethodDataSofortCountry, +} +impl ConfirmPaymentIntentPaymentMethodDataSofort { + pub fn new(country: ConfirmPaymentIntentPaymentMethodDataSofortCountry) -> Self { + Self { country } + } +} +/// Two-letter ISO code representing the country the bank account is located in. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodDataSofortCountry { + At, + Be, + De, + Es, + It, + Nl, +} +impl ConfirmPaymentIntentPaymentMethodDataSofortCountry { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataSofortCountry::*; + match self { + At => "AT", + Be => "BE", + De => "DE", + Es => "ES", + It => "IT", + Nl => "NL", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataSofortCountry { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataSofortCountry::*; + match s { + "AT" => Ok(At), + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "IT" => Ok(It), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodDataSofortCountry { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataSofortCountry { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of the PaymentMethod. +/// +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmPaymentIntentPaymentMethodDataType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmPaymentIntentPaymentMethodDataType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodDataType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataUsBankAccount<'a> { + /// Account holder type: individual or company. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: + Option, + /// Account number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Account type: checkings or savings. + /// + /// Defaults to checking if omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// The ID of a Financial Connections Account to use as a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections_account: Option<&'a str>, + /// Routing number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodDataUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + Company, + Individual, +} +impl ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Account type: checkings or savings. +/// +/// Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType { + Checking, + Savings, +} +impl ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment method-specific configuration for this PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptions<'a> { + /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option>, + /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option>, + /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option>, + /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + /// Configuration for any card payments attempted on this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option, + /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option>, + /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option>, + /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option>, + /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option>, + /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option, + /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option, + /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Demo Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option>, + /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsAcssDebit<'a> { + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsAcssDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Mandate creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + /// A URL for custom mandate text to render during confirmation step. + /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option<&'a str>, + /// Description of the mandate interval. + /// + /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_description: Option<&'a str>, + /// Payment schedule for the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_schedule: + Option, + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: + Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsAffirm<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred language of the Affirm authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsAffirm<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + Manual, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: + Option, + /// An internal identifier or reference that this payment corresponds to. + /// + /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + Manual, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsAlipay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAlipay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + None, + OffSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsBacsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsBacsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + None, + OffSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsBlik<'a> { + /// The 6-digit BLIK code that a customer has generated using their banking application. + /// + /// Can only be set on confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsBlik<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsBoleto { + /// The number of calendar days before a Boleto voucher expires. + /// + /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsBoleto { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for any card payments attempted on this PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCard<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// A single-use `cvc_update` Token that represents a card CVC value. + /// + /// When provided, the CVC value will be verified during the card payment attempt. + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc_token: Option<&'a str>, + /// Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + /// + /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + #[serde(skip_serializing_if = "Option::is_none")] + pub installments: Option, + /// Configuration options for setting up an eMandate for cards issued in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// When specified, this parameter indicates that a transaction will be marked + /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. + /// + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub moto: Option, + /// Selected network to process this PaymentIntent on. + /// + /// Depends on the available networks of the card attached to the PaymentIntent. + /// Can be only set confirm-time. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, + /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_extended_authorization: + Option, + /// Request ability to [increment](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_incremental_authorization: + Option, + /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_multicapture: + Option, + /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_overcapture: Option, + /// 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). + /// + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// Permitted values include: `automatic` or `any`. + /// If not provided, defaults to `automatic`. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Provides information about a card payment that customers see on their statements. + /// + /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kana: Option<&'a str>, + /// Provides information about a card payment that customers see on their statements. + /// + /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 17 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kanji: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod { + Manual, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Installment configuration for payments attempted on this PaymentIntent (Mexico Only). +/// +/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCardInstallments { + /// Setting to true enables installments for this PaymentIntent. + /// This will cause the response to contain a list of available installment plans. + /// Setting to false will prevent any selected plan from applying to a charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// The selected installment plan to use for this payment attempt. + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallments { + pub fn new() -> Self { + Self::default() + } +} +/// The selected installment plan to use for this payment attempt. +/// This parameter can only be provided during confirmation. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlan { + /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + pub count: u64, + /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + /// One of `month`. + pub interval: ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, + /// Type of installment plan, one of `fixed_count`. + #[serde(rename = "type")] + pub type_: ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlan { + pub fn new( + count: u64, + interval: ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, + type_: ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType, + ) -> Self { + Self { count, interval, type_ } + } +} +/// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. +/// One of `month`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + Month, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match self { + Month => "month", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match s { + "month" => Ok(Month), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of installment plan, one of `fixed_count`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + FixedCount, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*; + match self { + FixedCount => "fixed_count", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*; + match s { + "fixed_count" => Ok(FixedCount), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration options for setting up an eMandate for cards issued in India. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptions<'a> { + /// Amount to be charged for future payments. + pub amount: i64, + /// One of `fixed` or `maximum`. + /// + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// End date of the mandate or subscription. + /// + /// If not provided, the mandate will be active until canceled. + /// If provided, end date should be after start date. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// Specifies payment frequency. + /// + /// One of `day`, `week`, `month`, `year`, or `sporadic`. + pub interval: ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval, + /// The number of intervals between payments. + /// + /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// This parameter is optional when `interval=sporadic`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, + /// Unique identifier for the mandate or subscription. + pub reference: &'a str, + /// Start date of the mandate or subscription. + /// + /// Start date should not be lesser than yesterday. + pub start_date: stripe_types::Timestamp, + /// Specifies the type of mandates supported. + /// + /// Possible values are `india`. + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_types: + Option<&'a [ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes]>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptions<'a> { + pub fn new( + amount: i64, + amount_type: ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType, + interval: ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval, + reference: &'a str, + start_date: stripe_types::Timestamp, + ) -> Self { + Self { + amount, + amount_type, + description: Default::default(), + end_date: Default::default(), + interval, + interval_count: Default::default(), + reference, + start_date, + supported_types: Default::default(), + } + } +} +/// One of `fixed` or `maximum`. +/// +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies payment frequency. +/// +/// One of `day`, `week`, `month`, `year`, or `sporadic`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + Day, + Month, + Sporadic, + Week, + Year, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match self { + Day => "day", + Month => "month", + Sporadic => "sporadic", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "sporadic" => Ok(Sporadic), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies the type of mandates supported. +/// +/// Possible values are `india`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + India, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match self { + India => "india", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match s { + "india" => Ok(India), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Selected network to process this PaymentIntent on. +/// +/// Depends on the available networks of the card attached to the PaymentIntent. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + IfAvailable, + Never, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [increment](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + IfAvailable, + Never, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture { + IfAvailable, + Never, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture { + IfAvailable, + Never, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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). +/// +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// Permitted values include: `automatic` or `any`. +/// If not provided, defaults to `automatic`. +/// 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. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCardPresent { + /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity). + #[serde(skip_serializing_if = "Option::is_none")] + pub request_extended_authorization: Option, + /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. + /// + /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_incremental_authorization_support: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardPresent { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCashapp { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCashapp { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod { + Manual, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance<'a> { + /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: + Option>, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// + /// Permitted values include: `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub funding_type: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + /// Configuration for the eu_bank_transfer funding type. +#[serde(skip_serializing_if = "Option::is_none")] +pub eu_bank_transfer: Option>, + /// List of address types that should be returned in the financial_addresses response. + /// + /// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[serde(skip_serializing_if = "Option::is_none")] +pub requested_address_types: Option<&'a [ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes]>, + /// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[serde(rename = "type")] +pub type_: ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType, + +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + pub fn new( + type_: ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType, + ) -> Self { + Self { + eu_bank_transfer: Default::default(), + requested_address_types: Default::default(), + type_, + } + } +} +/// Configuration for the eu_bank_transfer funding type. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer<'a> { + /// The desired country code of the bank account information. + /// + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: &'a str, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer<'a> { + pub fn new(country: &'a str) -> Self { + Self { country } + } +} +/// List of address types that should be returned in the financial_addresses response. +/// +/// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + Aba, + Iban, + Sepa, + SortCode, + Spei, + Swift, + Zengin, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match self { + Aba => "aba", + Iban => "iban", + Sepa => "sepa", + SortCode => "sort_code", + Spei => "spei", + Swift => "swift", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match s { + "aba" => Ok(Aba), + "iban" => Ok(Iban), + "sepa" => Ok(Sepa), + "sort_code" => Ok(SortCode), + "spei" => Ok(Spei), + "swift" => Ok(Swift), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl AsRef + for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "gb_bank_transfer" => Ok(GbBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + "mx_bank_transfer" => Ok(MxBankTransfer), + "us_bank_transfer" => Ok(UsBankTransfer), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The funding method type to be used when there are not enough funds in the customer balance. +/// +/// Permitted values include: `bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + BankTransfer, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsEps { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsEps { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsFpx { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsFpx { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsGiropay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsGiropay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsGrabpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsGrabpay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsIdeal { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + None, + OffSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsKlarna { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred language of the Klarna authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + Manual, +} +impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Preferred language of the Klarna authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + CsMinusCz, + DaMinusDk, + DeMinusAt, + DeMinusCh, + DeMinusDe, + ElMinusGr, + EnMinusAt, + EnMinusAu, + EnMinusBe, + EnMinusCa, + EnMinusCh, + EnMinusCz, + EnMinusDe, + EnMinusDk, + EnMinusEs, + EnMinusFi, + EnMinusFr, + EnMinusGb, + EnMinusGr, + EnMinusIe, + EnMinusIt, + EnMinusNl, + EnMinusNo, + EnMinusNz, + EnMinusPl, + EnMinusPt, + EnMinusSe, + EnMinusUs, + EsMinusEs, + EsMinusUs, + FiMinusFi, + FrMinusBe, + FrMinusCa, + FrMinusCh, + FrMinusFr, + ItMinusCh, + ItMinusIt, + NbMinusNo, + NlMinusBe, + NlMinusNl, + PlMinusPl, + PtMinusPt, + SvMinusFi, + SvMinusSe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*; + match self { + CsMinusCz => "cs-CZ", + DaMinusDk => "da-DK", + DeMinusAt => "de-AT", + DeMinusCh => "de-CH", + DeMinusDe => "de-DE", + ElMinusGr => "el-GR", + EnMinusAt => "en-AT", + EnMinusAu => "en-AU", + EnMinusBe => "en-BE", + EnMinusCa => "en-CA", + EnMinusCh => "en-CH", + EnMinusCz => "en-CZ", + EnMinusDe => "en-DE", + EnMinusDk => "en-DK", + EnMinusEs => "en-ES", + EnMinusFi => "en-FI", + EnMinusFr => "en-FR", + EnMinusGb => "en-GB", + EnMinusGr => "en-GR", + EnMinusIe => "en-IE", + EnMinusIt => "en-IT", + EnMinusNl => "en-NL", + EnMinusNo => "en-NO", + EnMinusNz => "en-NZ", + EnMinusPl => "en-PL", + EnMinusPt => "en-PT", + EnMinusSe => "en-SE", + EnMinusUs => "en-US", + EsMinusEs => "es-ES", + EsMinusUs => "es-US", + FiMinusFi => "fi-FI", + FrMinusBe => "fr-BE", + FrMinusCa => "fr-CA", + FrMinusCh => "fr-CH", + FrMinusFr => "fr-FR", + ItMinusCh => "it-CH", + ItMinusIt => "it-IT", + NbMinusNo => "nb-NO", + NlMinusBe => "nl-BE", + NlMinusNl => "nl-NL", + PlMinusPl => "pl-PL", + PtMinusPt => "pt-PT", + SvMinusFi => "sv-FI", + SvMinusSe => "sv-SE", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*; + match s { + "cs-CZ" => Ok(CsMinusCz), + "da-DK" => Ok(DaMinusDk), + "de-AT" => Ok(DeMinusAt), + "de-CH" => Ok(DeMinusCh), + "de-DE" => Ok(DeMinusDe), + "el-GR" => Ok(ElMinusGr), + "en-AT" => Ok(EnMinusAt), + "en-AU" => Ok(EnMinusAu), + "en-BE" => Ok(EnMinusBe), + "en-CA" => Ok(EnMinusCa), + "en-CH" => Ok(EnMinusCh), + "en-CZ" => Ok(EnMinusCz), + "en-DE" => Ok(EnMinusDe), + "en-DK" => Ok(EnMinusDk), + "en-ES" => Ok(EnMinusEs), + "en-FI" => Ok(EnMinusFi), + "en-FR" => Ok(EnMinusFr), + "en-GB" => Ok(EnMinusGb), + "en-GR" => Ok(EnMinusGr), + "en-IE" => Ok(EnMinusIe), + "en-IT" => Ok(EnMinusIt), + "en-NL" => Ok(EnMinusNl), + "en-NO" => Ok(EnMinusNo), + "en-NZ" => Ok(EnMinusNz), + "en-PL" => Ok(EnMinusPl), + "en-PT" => Ok(EnMinusPt), + "en-SE" => Ok(EnMinusSe), + "en-US" => Ok(EnMinusUs), + "es-ES" => Ok(EsMinusEs), + "es-US" => Ok(EsMinusUs), + "fi-FI" => Ok(FiMinusFi), + "fr-BE" => Ok(FrMinusBe), + "fr-CA" => Ok(FrMinusCa), + "fr-CH" => Ok(FrMinusCh), + "fr-FR" => Ok(FrMinusFr), + "it-CH" => Ok(ItMinusCh), + "it-IT" => Ok(ItMinusIt), + "nb-NO" => Ok(NbMinusNo), + "nl-BE" => Ok(NlMinusBe), + "nl-NL" => Ok(NlMinusNl), + "pl-PL" => Ok(PlMinusPl), + "pt-PT" => Ok(PtMinusPt), + "sv-FI" => Ok(SvMinusFi), + "sv-SE" => Ok(SvMinusSe), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsKonbini<'a> { + /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. + /// + /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. + /// We recommend to use the customer's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_number: Option<&'a str>, + /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. + /// + /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. + /// Defaults to 3 days. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// The timestamp at which the Konbini payment instructions will expire. + /// + /// Only one of `expires_after_days` or `expires_at` may be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsKonbini<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsLink<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// \[Deprecated\] This is a legacy parameter that no longer has any function. + #[serde(skip_serializing_if = "Option::is_none")] + pub persistent_token: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod { + Manual, +} +impl ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + None, + OffSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsOxxo { + /// The number of calendar days before an OXXO voucher expires. + /// + /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsOxxo { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsP24 { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Confirm that the payer has accepted the P24 terms and conditions. + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_shown_and_accepted: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsP24 { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsPaynow { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPaynow { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsPaypal<'a> { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. + /// + /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// The risk correlation ID for an on-session payment using a saved PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub risk_correlation_id: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsPaypal<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + Manual, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + CsMinusCz, + DaMinusDk, + DeMinusAt, + DeMinusDe, + DeMinusLu, + ElMinusGr, + EnMinusGb, + EnMinusUs, + EsMinusEs, + FiMinusFi, + FrMinusBe, + FrMinusFr, + FrMinusLu, + HuMinusHu, + ItMinusIt, + NlMinusBe, + NlMinusNl, + PlMinusPl, + PtMinusPt, + SkMinusSk, + SvMinusSe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*; + match self { + CsMinusCz => "cs-CZ", + DaMinusDk => "da-DK", + DeMinusAt => "de-AT", + DeMinusDe => "de-DE", + DeMinusLu => "de-LU", + ElMinusGr => "el-GR", + EnMinusGb => "en-GB", + EnMinusUs => "en-US", + EsMinusEs => "es-ES", + FiMinusFi => "fi-FI", + FrMinusBe => "fr-BE", + FrMinusFr => "fr-FR", + FrMinusLu => "fr-LU", + HuMinusHu => "hu-HU", + ItMinusIt => "it-IT", + NlMinusBe => "nl-BE", + NlMinusNl => "nl-NL", + PlMinusPl => "pl-PL", + PtMinusPt => "pt-PT", + SkMinusSk => "sk-SK", + SvMinusSe => "sv-SE", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*; + match s { + "cs-CZ" => Ok(CsMinusCz), + "da-DK" => Ok(DaMinusDk), + "de-AT" => Ok(DeMinusAt), + "de-DE" => Ok(DeMinusDe), + "de-LU" => Ok(DeMinusLu), + "el-GR" => Ok(ElMinusGr), + "en-GB" => Ok(EnMinusGb), + "en-US" => Ok(EnMinusUs), + "es-ES" => Ok(EsMinusEs), + "fi-FI" => Ok(FiMinusFi), + "fr-BE" => Ok(FrMinusBe), + "fr-FR" => Ok(FrMinusFr), + "fr-LU" => Ok(FrMinusLu), + "hu-HU" => Ok(HuMinusHu), + "it-IT" => Ok(ItMinusIt), + "nl-BE" => Ok(NlMinusBe), + "nl-NL" => Ok(NlMinusNl), + "pl-PL" => Ok(PlMinusPl), + "pt-PT" => Ok(PtMinusPt), + "sk-SK" => Ok(SkMinusSk), + "sv-SE" => Ok(SvMinusSe), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + None, + OffSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsPix { + /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. + /// + /// Defaults to 86400 seconds. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_seconds: Option, + /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). + /// + /// Defaults to 1 day in the future. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPix { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsPromptpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPromptpay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Demo Pay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsRevolutPay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsRevolutPay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + None, + OffSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsSepaDebit<'a> { + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option<&'a serde_json::Value>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsSepaDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsSofort { + /// Language shown to the payer on redirect. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsSofort { + pub fn new() -> Self { + Self::default() + } +} +/// Language shown to the payer on redirect. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + De, + En, + Es, + Fr, + It, + Nl, + Pl, +} +impl ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*; + match self { + De => "de", + En => "en", + Es => "es", + Fr => "fr", + It => "it", + Nl => "nl", + Pl => "pl", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "es" => Ok(Es), + "fr" => Ok(Fr), + "it" => Ok(It), + "nl" => Ok(Nl), + "pl" => Ok(Pl), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + None, + OffSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: + Option>, + /// Additional fields for network related functions. + #[serde(skip_serializing_if = "Option::is_none")] + pub networks: Option>, + /// Preferred transaction settlement speed. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_settlement_speed: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[serde(skip_serializing_if = "Option::is_none")] +pub permissions: Option<&'a [ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions]>, + /// List of data features that you would like to retrieve upon account creation. +#[serde(skip_serializing_if = "Option::is_none")] +pub prefetch: Option<&'a [ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch]>, + /// For webview integrations only. + /// + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. +#[serde(skip_serializing_if = "Option::is_none")] +pub return_url: Option<&'a str>, + +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl AsRef + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, +} +impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + _ => Err(()), + } + } +} +impl AsRef + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for network related functions. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + /// Triggers validations to run across the selected networks. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: + Option<&'a [ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested]>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Triggers validations to run across the selected networks. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + Ach, + UsDomesticWire, +} +impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Preferred transaction settlement speed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + Fastest, + Standard, +} +impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*; + match self { + Fastest => "fastest", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*; + match s { + "fastest" => Ok(Fastest), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsWechatPay<'a> { + /// The app ID registered with WeChat Pay. + /// + /// Only required when client is ios or android. + #[serde(skip_serializing_if = "Option::is_none")] + pub app_id: Option<&'a str>, + /// The client type that the end customer will pay from. + pub client: ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsWechatPay<'a> { + pub fn new(client: ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient) -> Self { + Self { app_id: Default::default(), client, setup_future_usage: Default::default() } + } +} +/// The client type that the end customer will pay from. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient { + Android, + Ios, + Web, +} +impl ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient::*; + match self { + Android => "android", + Ios => "ios", + Web => "web", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient::*; + match s { + "android" => Ok(Android), + "ios" => Ok(Ios), + "web" => Ok(Web), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsZip { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsZip { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options to configure Radar. +/// +/// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentRadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentRadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentSetupFutureUsage { + OffSession, + OnSession, +} +impl ConfirmPaymentIntentSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentSetupFutureUsage::*; + match self { + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentSetupFutureUsage::*; + match s { + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for ConfirmPaymentIntentSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmPaymentIntentSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Shipping information for this PaymentIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentShipping<'a> { + /// Shipping address. + pub address: ConfirmPaymentIntentShippingAddress<'a>, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// Recipient name. + pub name: &'a str, + /// Recipient phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The tracking number for a physical product, obtained from the delivery service. + /// + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub tracking_number: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentShipping<'a> { + pub fn new(address: ConfirmPaymentIntentShippingAddress<'a>, name: &'a str) -> Self { + Self { + address, + carrier: Default::default(), + name, + phone: Default::default(), + tracking_number: Default::default(), + } + } +} +/// Shipping address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentShippingAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentShippingAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ConfirmPaymentIntent<'a> { + /// Confirm that your customer intends to pay with current or provided + /// payment method. + /// + /// Upon confirmation, the PaymentIntent will attempt to initiate a payment. If the selected payment method requires additional authentication steps, the PaymentIntent will transition to the `requires_action` status and suggest additional actions via `next_action`. + /// If payment fails, the PaymentIntent transitions to the `requires_payment_method` status or the `canceled` status if the confirmation limit is reached. + /// If payment succeeds, the PaymentIntent will transition to the `succeeded` status (or `requires_capture`, if `capture_method` is set to `manual`). If the `confirmation_method` is `automatic`, payment may be attempted using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) and the PaymentIntent’s [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). After `next_action`s are handled by the client, no additional confirmation is required to complete the payment. If the `confirmation_method` is `manual`, all payment attempts must be initiated using a secret key. If any actions are required for the payment, the PaymentIntent will return to the `requires_confirmation` state after those actions are completed. + /// Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. + /// Read the [expanded documentation](https://stripe.com/docs/payments/payment-intents/web-manual) to learn more about manual confirmation. + pub fn send( + &self, + client: &stripe::Client, + intent: &str, + ) -> stripe::Response { + client.send_form( + &format!("/payment_intents/{intent}/confirm"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelPaymentIntent<'a> { + /// Reason for canceling this PaymentIntent. + /// + /// Possible values are: `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelPaymentIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Reason for canceling this PaymentIntent. +/// +/// Possible values are: `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CancelPaymentIntentCancellationReason { + Abandoned, + Duplicate, + Fraudulent, + RequestedByCustomer, +} +impl CancelPaymentIntentCancellationReason { + pub fn as_str(self) -> &'static str { + use CancelPaymentIntentCancellationReason::*; + match self { + Abandoned => "abandoned", + Duplicate => "duplicate", + Fraudulent => "fraudulent", + RequestedByCustomer => "requested_by_customer", + } + } +} + +impl std::str::FromStr for CancelPaymentIntentCancellationReason { + type Err = (); + fn from_str(s: &str) -> Result { + use CancelPaymentIntentCancellationReason::*; + match s { + "abandoned" => Ok(Abandoned), + "duplicate" => Ok(Duplicate), + "fraudulent" => Ok(Fraudulent), + "requested_by_customer" => Ok(RequestedByCustomer), + _ => Err(()), + } + } +} +impl AsRef for CancelPaymentIntentCancellationReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CancelPaymentIntentCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CancelPaymentIntentCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CancelPaymentIntentCancellationReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CancelPaymentIntent<'a> { + /// You can cancel a PaymentIntent object when it’s in one of these statuses: `requires_payment_method`, `requires_capture`, `requires_confirmation`, `requires_action` or, [in rare cases](https://stripe.com/docs/payments/intents), `processing`. + /// + /// After it’s canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. + /// For PaymentIntents with a `status` of `requires_capture`, the remaining `amount_capturable` is automatically refunded. + /// You can’t cancel the PaymentIntent for a Checkout Session. + /// [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. + pub fn send( + &self, + client: &stripe::Client, + intent: &str, + ) -> stripe::Response { + client.send_form( + &format!("/payment_intents/{intent}/cancel"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CapturePaymentIntent<'a> { + /// The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. + /// + /// Any additional amount is automatically refunded. + /// Defaults to the full `amount_capturable` if it's not provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_to_capture: Option, + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// + /// The amount of the application fee collected will be capped at the total payment amount. + /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Defaults to `true`. + /// + /// When capturing a PaymentIntent, setting `final_capture` to `false` notifies Stripe to not release the remaining uncaptured funds to make sure that they're captured in future requests. + /// You can only use this setting when [multicapture](https://stripe.com/docs/payments/multicapture) is available for PaymentIntents. + #[serde(skip_serializing_if = "Option::is_none")] + pub final_capture: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// For non-card charges, you can use this value as the complete description that appears on your customers’ statements. + /// + /// Must contain at least one letter, maximum 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// Provides information about a card payment that customers see on their statements. + /// + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. + /// The concatenated descriptor must be 1-22 characters long. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix: Option<&'a str>, + /// The parameters that you can use to automatically create a transfer after the payment + /// is captured. + /// + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option, +} +impl<'a> CapturePaymentIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The parameters that you can use to automatically create a transfer after the payment +/// is captured. +/// +/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CapturePaymentIntentTransferData { + /// The amount that will be transferred automatically when a charge succeeds. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, +} +impl CapturePaymentIntentTransferData { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CapturePaymentIntent<'a> { + /// Capture the funds of an existing uncaptured PaymentIntent when its status is `requires_capture`. + /// + /// Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. + /// + /// Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). + pub fn send( + &self, + client: &stripe::Client, + intent: &str, + ) -> stripe::Response { + client.send_form( + &format!("/payment_intents/{intent}/capture"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct IncrementAuthorizationPaymentIntent<'a> { + /// The updated total amount that you intend to collect from the cardholder. + /// + /// This amount must be greater than the currently authorized amount. + pub amount: i64, + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// + /// The amount of the application fee collected will be capped at the total payment amount. + /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// For non-card charges, you can use this value as the complete description that appears on your customers’ statements. + /// + /// Must contain at least one letter, maximum 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// The parameters used to automatically create a transfer after the payment is captured. + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option, +} +impl<'a> IncrementAuthorizationPaymentIntent<'a> { + pub fn new(amount: i64) -> Self { + Self { + amount, + application_fee_amount: Default::default(), + description: Default::default(), + expand: Default::default(), + metadata: Default::default(), + statement_descriptor: Default::default(), + transfer_data: Default::default(), + } + } +} +/// The parameters used to automatically create a transfer after the payment is captured. +/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct IncrementAuthorizationPaymentIntentTransferData { + /// The amount that will be transferred automatically when a charge succeeds. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, +} +impl IncrementAuthorizationPaymentIntentTransferData { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> IncrementAuthorizationPaymentIntent<'a> { + /// Perform an incremental authorization on an eligible + /// [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). + /// + /// To be eligible, the PaymentIntent’s status must be `requires_capture` and [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) must be `true`. Incremental authorizations attempt to increase the authorized amount on your customer’s card to the new, higher `amount` provided. + /// Similar to the initial authorization, incremental authorizations can be declined. + /// A single PaymentIntent can call this endpoint multiple times to further increase the authorized amount. If the incremental authorization succeeds, the PaymentIntent object returns with the updated [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). If the incremental authorization fails, a [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other fields on the PaymentIntent or Charge update. + /// The PaymentIntent object remains capturable for the previously authorized amount. Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. After it’s captured, a PaymentIntent can no longer be incremented. Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). + pub fn send( + &self, + client: &stripe::Client, + intent: &str, + ) -> stripe::Response { + client.send_form( + &format!("/payment_intents/{intent}/increment_authorization"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct VerifyMicrodepositsPaymentIntent<'a> { + /// Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub amounts: Option<&'a [i64]>, + /// A six-character code starting with SM present in the microdeposit sent to the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub descriptor_code: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> VerifyMicrodepositsPaymentIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> VerifyMicrodepositsPaymentIntent<'a> { + /// Verifies microdeposits on a PaymentIntent object. + pub fn send( + &self, + client: &stripe::Client, + intent: &str, + ) -> stripe::Response { + client.send_form( + &format!("/payment_intents/{intent}/verify_microdeposits"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ApplyCustomerBalancePaymentIntent<'a> { + /// Amount that you intend to apply to this PaymentIntent from the customer’s cash balance. + /// + /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (for example, 100 cents to charge 1 USD or 100 to charge 100 JPY, a zero-decimal currency). + /// + /// The maximum amount is the amount of the PaymentIntent. + /// + /// When you omit the amount, it defaults to the remaining amount requested on the PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ApplyCustomerBalancePaymentIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ApplyCustomerBalancePaymentIntent<'a> { + /// Manually reconcile the remaining amount for a `customer_balance` PaymentIntent. + pub fn send( + &self, + client: &stripe::Client, + intent: &str, + ) -> stripe::Response { + client.send_form( + &format!("/payment_intents/{intent}/apply_customer_balance"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_core/src/payment_intent_card_processing/mod.rs b/generated/stripe_core/src/payment_intent_card_processing/mod.rs new file mode 100644 index 000000000..48092cc67 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_card_processing/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_card_processing::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action/mod.rs b/generated/stripe_core/src/payment_intent_next_action/mod.rs new file mode 100644 index 000000000..b6baa8936 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_alipay_handle_redirect/mod.rs b/generated/stripe_core/src/payment_intent_next_action_alipay_handle_redirect/mod.rs new file mode 100644 index 000000000..320806df9 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_alipay_handle_redirect/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_alipay_handle_redirect::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_boleto/mod.rs b/generated/stripe_core/src/payment_intent_next_action_boleto/mod.rs new file mode 100644 index 000000000..7da799730 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_boleto/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_boleto::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_card_await_notification/mod.rs b/generated/stripe_core/src/payment_intent_next_action_card_await_notification/mod.rs new file mode 100644 index 000000000..ed484a9cb --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_card_await_notification/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_card_await_notification::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code/mod.rs b/generated/stripe_core/src/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code/mod.rs new file mode 100644 index 000000000..d5f9e8df3 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_cashapp_qr_code/mod.rs b/generated/stripe_core/src/payment_intent_next_action_cashapp_qr_code/mod.rs new file mode 100644 index 000000000..d4543b461 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_cashapp_qr_code/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_cashapp_qr_code::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_display_bank_transfer_instructions/mod.rs b/generated/stripe_core/src/payment_intent_next_action_display_bank_transfer_instructions/mod.rs new file mode 100644 index 000000000..3c9db686a --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_display_bank_transfer_instructions/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_display_bank_transfer_instructions::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_display_oxxo_details/mod.rs b/generated/stripe_core/src/payment_intent_next_action_display_oxxo_details/mod.rs new file mode 100644 index 000000000..ebd375bae --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_display_oxxo_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_display_oxxo_details::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_konbini/mod.rs b/generated/stripe_core/src/payment_intent_next_action_konbini/mod.rs new file mode 100644 index 000000000..e486110a2 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_konbini/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_konbini::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_konbini_familymart/mod.rs b/generated/stripe_core/src/payment_intent_next_action_konbini_familymart/mod.rs new file mode 100644 index 000000000..a83472b91 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_konbini_familymart/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_konbini_familymart::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_konbini_lawson/mod.rs b/generated/stripe_core/src/payment_intent_next_action_konbini_lawson/mod.rs new file mode 100644 index 000000000..36f72bbd6 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_konbini_lawson/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_konbini_lawson::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_konbini_ministop/mod.rs b/generated/stripe_core/src/payment_intent_next_action_konbini_ministop/mod.rs new file mode 100644 index 000000000..fa25e6c4e --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_konbini_ministop/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_konbini_ministop::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_konbini_seicomart/mod.rs b/generated/stripe_core/src/payment_intent_next_action_konbini_seicomart/mod.rs new file mode 100644 index 000000000..5881c9da2 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_konbini_seicomart/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_konbini_seicomart::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_konbini_stores/mod.rs b/generated/stripe_core/src/payment_intent_next_action_konbini_stores/mod.rs new file mode 100644 index 000000000..89590d249 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_konbini_stores/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_konbini_stores::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_paynow_display_qr_code/mod.rs b/generated/stripe_core/src/payment_intent_next_action_paynow_display_qr_code/mod.rs new file mode 100644 index 000000000..39a698f9a --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_paynow_display_qr_code/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_paynow_display_qr_code::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_pix_display_qr_code/mod.rs b/generated/stripe_core/src/payment_intent_next_action_pix_display_qr_code/mod.rs new file mode 100644 index 000000000..11b34b823 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_pix_display_qr_code/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_pix_display_qr_code::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_promptpay_display_qr_code/mod.rs b/generated/stripe_core/src/payment_intent_next_action_promptpay_display_qr_code/mod.rs new file mode 100644 index 000000000..6fad7f008 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_promptpay_display_qr_code/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_promptpay_display_qr_code::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_redirect_to_url/mod.rs b/generated/stripe_core/src/payment_intent_next_action_redirect_to_url/mod.rs new file mode 100644 index 000000000..a09dfb9f4 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_redirect_to_url/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_redirect_to_url::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_verify_with_microdeposits/mod.rs b/generated/stripe_core/src/payment_intent_next_action_verify_with_microdeposits/mod.rs new file mode 100644 index 000000000..ebe6c8440 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_verify_with_microdeposits/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_verify_with_microdeposits::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_wechat_pay_display_qr_code/mod.rs b/generated/stripe_core/src/payment_intent_next_action_wechat_pay_display_qr_code/mod.rs new file mode 100644 index 000000000..ee2c50ed3 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_wechat_pay_display_qr_code/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_wechat_pay_display_qr_code::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_wechat_pay_redirect_to_android_app/mod.rs b/generated/stripe_core/src/payment_intent_next_action_wechat_pay_redirect_to_android_app/mod.rs new file mode 100644 index 000000000..82df666f7 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_wechat_pay_redirect_to_android_app/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_wechat_pay_redirect_to_android_app::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_next_action_wechat_pay_redirect_to_ios_app/mod.rs b/generated/stripe_core/src/payment_intent_next_action_wechat_pay_redirect_to_ios_app/mod.rs new file mode 100644 index 000000000..81f281dcd --- /dev/null +++ b/generated/stripe_core/src/payment_intent_next_action_wechat_pay_redirect_to_ios_app/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_next_action_wechat_pay_redirect_to_ios_app::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_payment_method_options/mod.rs b/generated/stripe_core/src/payment_intent_payment_method_options/mod.rs new file mode 100644 index 000000000..deda4efa9 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_payment_method_options/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_payment_method_options::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_payment_method_options_acss_debit/mod.rs b/generated/stripe_core/src/payment_intent_payment_method_options_acss_debit/mod.rs new file mode 100644 index 000000000..1c7f64586 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_payment_method_options_acss_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_payment_method_options_acss_debit::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_payment_method_options_au_becs_debit/mod.rs b/generated/stripe_core/src/payment_intent_payment_method_options_au_becs_debit/mod.rs new file mode 100644 index 000000000..f496c6a02 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_payment_method_options_au_becs_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_payment_method_options_au_becs_debit::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_payment_method_options_blik/mod.rs b/generated/stripe_core/src/payment_intent_payment_method_options_blik/mod.rs new file mode 100644 index 000000000..94cb9a9b6 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_payment_method_options_blik/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_payment_method_options_blik::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_payment_method_options_card/mod.rs b/generated/stripe_core/src/payment_intent_payment_method_options_card/mod.rs new file mode 100644 index 000000000..f651ff70d --- /dev/null +++ b/generated/stripe_core/src/payment_intent_payment_method_options_card/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_payment_method_options_card::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_payment_method_options_eps/mod.rs b/generated/stripe_core/src/payment_intent_payment_method_options_eps/mod.rs new file mode 100644 index 000000000..6f723892f --- /dev/null +++ b/generated/stripe_core/src/payment_intent_payment_method_options_eps/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_payment_method_options_eps::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_payment_method_options_link/mod.rs b/generated/stripe_core/src/payment_intent_payment_method_options_link/mod.rs new file mode 100644 index 000000000..58b71c290 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_payment_method_options_link/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_payment_method_options_link::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_payment_method_options_mandate_options_acss_debit/mod.rs b/generated/stripe_core/src/payment_intent_payment_method_options_mandate_options_acss_debit/mod.rs new file mode 100644 index 000000000..8fd3d77c6 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_payment_method_options_mandate_options_acss_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_payment_method_options_mandate_options_acss_debit::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_payment_method_options_mandate_options_sepa_debit/mod.rs b/generated/stripe_core/src/payment_intent_payment_method_options_mandate_options_sepa_debit/mod.rs new file mode 100644 index 000000000..4034b5fb9 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_payment_method_options_mandate_options_sepa_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_payment_method_options_mandate_options_sepa_debit::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_payment_method_options_sepa_debit/mod.rs b/generated/stripe_core/src/payment_intent_payment_method_options_sepa_debit/mod.rs new file mode 100644 index 000000000..a5582fb02 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_payment_method_options_sepa_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_payment_method_options_sepa_debit::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_payment_method_options_us_bank_account/mod.rs b/generated/stripe_core/src/payment_intent_payment_method_options_us_bank_account/mod.rs new file mode 100644 index 000000000..f9c5c0a48 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_payment_method_options_us_bank_account/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_payment_method_options_us_bank_account::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_processing/mod.rs b/generated/stripe_core/src/payment_intent_processing/mod.rs new file mode 100644 index 000000000..e0c0dae56 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_processing/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_processing::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_intent_processing_customer_notification/mod.rs b/generated/stripe_core/src/payment_intent_processing_customer_notification/mod.rs new file mode 100644 index 000000000..a2c09a8e7 --- /dev/null +++ b/generated/stripe_core/src/payment_intent_processing_customer_notification/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_intent_processing_customer_notification::*; \ No newline at end of file diff --git a/generated/stripe_core/src/payment_source/mod.rs b/generated/stripe_core/src/payment_source/mod.rs new file mode 100644 index 000000000..92941e6c5 --- /dev/null +++ b/generated/stripe_core/src/payment_source/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::payment_source::*; +#[cfg(feature = "payment_source")] +mod requests; +#[cfg(feature = "payment_source")] +pub use requests::*; diff --git a/generated/stripe_core/src/payment_source/requests.rs b/generated/stripe_core/src/payment_source/requests.rs new file mode 100644 index 000000000..37f426400 --- /dev/null +++ b/generated/stripe_core/src/payment_source/requests.rs @@ -0,0 +1,111 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPaymentSource<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Filter sources according to a particular object type. + #[serde(skip_serializing_if = "Option::is_none")] + pub object: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListPaymentSource<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPaymentSource<'a> { + /// List sources for a specified customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::Response> { + client.get_query(&format!("/customers/{customer}/sources"), self) + } + pub fn paginate( + self, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params(&format!("/customers/{customer}/sources"), self) + } +} +impl<'a> stripe::PaginationParams for ListPaymentSource<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePaymentSource<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePaymentSource<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePaymentSource<'a> { + /// Retrieve a specified source for a given customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + id: &str, + ) -> stripe::Response { + client.get_query(&format!("/customers/{customer}/sources/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentSource<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Please refer to full [documentation](https://stripe.com/docs/api) instead. + pub source: &'a str, + #[serde(skip_serializing_if = "Option::is_none")] + pub validate: Option, +} +impl<'a> CreatePaymentSource<'a> { + pub fn new(source: &'a str) -> Self { + Self { + expand: Default::default(), + metadata: Default::default(), + source, + validate: Default::default(), + } + } +} +impl<'a> CreatePaymentSource<'a> { + /// When you create a new credit card, you must specify a customer or recipient on which to create it. + /// + /// If the card’s owner has no default card, then the new card will become the default. + /// However, if the owner already has a default, then it will not change. + /// To change the default, you should [update the customer](https://stripe.com/docs/api#update_customer) to have a new `default_source`. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + ) -> stripe::Response { + client.send_form(&format!("/customers/{customer}/sources"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_core/src/payout/mod.rs b/generated/stripe_core/src/payout/mod.rs new file mode 100644 index 000000000..bdba2c664 --- /dev/null +++ b/generated/stripe_core/src/payout/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::payout::*; +#[cfg(feature = "payout")] +mod requests; +#[cfg(feature = "payout")] +pub use requests::*; diff --git a/generated/stripe_core/src/payout/requests.rs b/generated/stripe_core/src/payout/requests.rs new file mode 100644 index 000000000..db22773b3 --- /dev/null +++ b/generated/stripe_core/src/payout/requests.rs @@ -0,0 +1,349 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePayout<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePayout<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePayout<'a> { + /// Retrieves the details of an existing payout. + /// + /// Supply the unique payout ID from either a payout creation request or the payout list. + /// Stripe returns the corresponding payout information. + pub fn send( + &self, + client: &stripe::Client, + payout: &stripe_types::payout::PayoutId, + ) -> stripe::Response { + client.get_query(&format!("/payouts/{payout}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPayout<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub arrival_date: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// The ID of an external account - only return payouts sent to this external account. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return payouts that have the given status: `pending`, `paid`, `failed`, or `canceled`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option<&'a str>, +} +impl<'a> ListPayout<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPayout<'a> { + /// Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. + /// + /// The payouts return in sorted order, with the most recently created payouts appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/payouts", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/payouts", self) + } +} +impl<'a> stripe::PaginationParams for ListPayout<'a> {} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePayout<'a> { + /// A positive integer in cents representing how much to payout. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The ID of a bank account or a card to send the payout to. + /// + /// If you don't provide a destination, we use the default external account for the specified currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The method used to send this payout, which is `standard` or `instant`. + /// + /// We support `instant` for payouts to debit cards and bank accounts in certain countries. + /// Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, + /// The balance type of your Stripe balance to draw this payout from. + /// + /// Balances for different payment sources are kept separately. + /// You can find the amounts with the Balances API. + /// One of `bank_account`, `card`, or `fpx`. + #[serde(skip_serializing_if = "Option::is_none")] + pub source_type: Option, + /// A string that displays on the recipient's bank or card statement (up to 22 characters). + /// + /// A `statement_descriptor` that's longer than 22 characters return an error. + /// Most banks truncate this information and display it inconsistently. + /// Some banks might not display it at all. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, +} +impl<'a> CreatePayout<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { + amount, + currency, + description: Default::default(), + destination: Default::default(), + expand: Default::default(), + metadata: Default::default(), + method: Default::default(), + source_type: Default::default(), + statement_descriptor: Default::default(), + } + } +} +/// The method used to send this payout, which is `standard` or `instant`. +/// +/// We support `instant` for payouts to debit cards and bank accounts in certain countries. +/// Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePayoutMethod { + Instant, + Standard, +} +impl CreatePayoutMethod { + pub fn as_str(self) -> &'static str { + use CreatePayoutMethod::*; + match self { + Instant => "instant", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreatePayoutMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePayoutMethod::*; + match s { + "instant" => Ok(Instant), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreatePayoutMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePayoutMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePayoutMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePayoutMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The balance type of your Stripe balance to draw this payout from. +/// +/// Balances for different payment sources are kept separately. +/// You can find the amounts with the Balances API. +/// One of `bank_account`, `card`, or `fpx`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePayoutSourceType { + BankAccount, + Card, + Fpx, +} +impl CreatePayoutSourceType { + pub fn as_str(self) -> &'static str { + use CreatePayoutSourceType::*; + match self { + BankAccount => "bank_account", + Card => "card", + Fpx => "fpx", + } + } +} + +impl std::str::FromStr for CreatePayoutSourceType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePayoutSourceType::*; + match s { + "bank_account" => Ok(BankAccount), + "card" => Ok(Card), + "fpx" => Ok(Fpx), + _ => Err(()), + } + } +} +impl AsRef for CreatePayoutSourceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePayoutSourceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePayoutSourceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePayoutSourceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreatePayout<'a> { + /// To send funds to your own bank account, create a new payout object. + /// + /// Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. + /// If it doesn’t, you receive an “Insufficient Funds” error. If your API key is in test mode, money won’t actually be sent, though every other action occurs as if you’re in live mode. If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. + /// The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/payouts", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePayout<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdatePayout<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdatePayout<'a> { + /// Updates the specified payout by setting the values of the parameters you pass. + /// + /// We don’t change parameters that you don’t provide. + /// This request only accepts the metadata as arguments. + pub fn send( + &self, + client: &stripe::Client, + payout: &stripe_types::payout::PayoutId, + ) -> stripe::Response { + client.send_form(&format!("/payouts/{payout}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelPayout<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelPayout<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelPayout<'a> { + /// You can cancel a previously created payout if it hasn’t been paid out yet. + /// + /// Stripe refunds the funds to your available balance. + /// You can’t cancel automatic Stripe payouts. + pub fn send( + &self, + client: &stripe::Client, + payout: &stripe_types::payout::PayoutId, + ) -> stripe::Response { + client.send_form(&format!("/payouts/{payout}/cancel"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReversePayout<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> ReversePayout<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ReversePayout<'a> { + /// Reverses a payout by debiting the destination bank account. + /// + /// At this time, you can only reverse payouts for connected accounts to US bank accounts. + /// If the payout is in the `pending` status, use `/v1/payouts/:id/cancel` instead. By requesting a reversal through `/v1/payouts/:id/reverse`, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. + pub fn send( + &self, + client: &stripe::Client, + payout: &stripe_types::payout::PayoutId, + ) -> stripe::Response { + client.send_form(&format!("/payouts/{payout}/reverse"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_core/src/platform_tax/mod.rs b/generated/stripe_core/src/platform_tax/mod.rs new file mode 100644 index 000000000..a7d10c0f4 --- /dev/null +++ b/generated/stripe_core/src/platform_tax/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::platform_tax::*; \ No newline at end of file diff --git a/generated/stripe_core/src/refund/mod.rs b/generated/stripe_core/src/refund/mod.rs new file mode 100644 index 000000000..449f46cb6 --- /dev/null +++ b/generated/stripe_core/src/refund/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::refund::*; +#[cfg(feature = "refund")] +mod requests; +#[cfg(feature = "refund")] +pub use requests::*; diff --git a/generated/stripe_core/src/refund/requests.rs b/generated/stripe_core/src/refund/requests.rs new file mode 100644 index 000000000..32b84fc16 --- /dev/null +++ b/generated/stripe_core/src/refund/requests.rs @@ -0,0 +1,331 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListRefund<'a> { + /// Only return refunds for the charge specified by this charge ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub charge: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return refunds for the PaymentIntent specified by this ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListRefund<'a> { + /// Returns a list of all refunds you created. + /// + /// We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/refunds", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/refunds", self) + } +} +impl<'a> stripe::PaginationParams for ListRefund<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateRefund<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The identifier of the charge to refund. + #[serde(skip_serializing_if = "Option::is_none")] + pub charge: Option<&'a str>, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Customer whose customer balance to refund from. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// For payment methods without native refund support (e.g., Konbini, PromptPay), use this email from the customer to receive refund instructions. + #[serde(skip_serializing_if = "Option::is_none")] + pub instructions_email: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Origin of the refund. + #[serde(skip_serializing_if = "Option::is_none")] + pub origin: Option, + /// The identifier of the PaymentIntent to refund. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option<&'a str>, + /// String indicating the reason for the refund. + /// + /// If set, possible values are `duplicate`, `fraudulent`, and `requested_by_customer`. + /// If you believe the charge to be fraudulent, specifying `fraudulent` as the reason will add the associated card and email to your [block lists](https://stripe.com/docs/radar/lists), and will also help us improve our fraud detection algorithms. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// Boolean indicating whether the application fee should be refunded when refunding this charge. + /// + /// If a full charge refund is given, the full application fee will be refunded. + /// Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. + /// An application fee can be refunded only by the application that created the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_application_fee: Option, + /// Boolean indicating whether the transfer should be reversed when refunding this charge. + /// + /// The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_transfer: Option, +} +impl<'a> CreateRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Origin of the refund. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateRefundOrigin { + CustomerBalance, +} +impl CreateRefundOrigin { + pub fn as_str(self) -> &'static str { + use CreateRefundOrigin::*; + match self { + CustomerBalance => "customer_balance", + } + } +} + +impl std::str::FromStr for CreateRefundOrigin { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateRefundOrigin::*; + match s { + "customer_balance" => Ok(CustomerBalance), + _ => Err(()), + } + } +} +impl AsRef for CreateRefundOrigin { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateRefundOrigin { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateRefundOrigin { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateRefundOrigin { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// String indicating the reason for the refund. +/// +/// If set, possible values are `duplicate`, `fraudulent`, and `requested_by_customer`. +/// If you believe the charge to be fraudulent, specifying `fraudulent` as the reason will add the associated card and email to your [block lists](https://stripe.com/docs/radar/lists), and will also help us improve our fraud detection algorithms. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateRefundReason { + Duplicate, + Fraudulent, + RequestedByCustomer, +} +impl CreateRefundReason { + pub fn as_str(self) -> &'static str { + use CreateRefundReason::*; + match self { + Duplicate => "duplicate", + Fraudulent => "fraudulent", + RequestedByCustomer => "requested_by_customer", + } + } +} + +impl std::str::FromStr for CreateRefundReason { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateRefundReason::*; + match s { + "duplicate" => Ok(Duplicate), + "fraudulent" => Ok(Fraudulent), + "requested_by_customer" => Ok(RequestedByCustomer), + _ => Err(()), + } + } +} +impl AsRef for CreateRefundReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateRefundReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateRefundReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateRefundReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateRefund<'a> { + /// When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it. + /// + /// Creating a new refund will refund a charge that has previously been created but not yet refunded. + /// Funds will be refunded to the credit or debit card that was originally charged. + /// + /// You can optionally refund only part of a charge. + /// You can do so multiple times, until the entire charge has been refunded. + /// + /// Once entirely refunded, a charge can’t be refunded again. + /// This method will raise an error when called on an already-refunded charge, + /// or when trying to refund more money than is left on a charge. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/refunds", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveRefund<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveRefund<'a> { + /// Retrieves the details of an existing refund. + pub fn send( + &self, + client: &stripe::Client, + refund: &stripe_types::refund::RefundId, + ) -> stripe::Response { + client.get_query(&format!("/refunds/{refund}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateRefund<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateRefund<'a> { + /// Updates the refund that you specify by setting the values of the passed parameters. + /// + /// Any parameters that you don’t provide remain unchanged. This request only accepts `metadata` as an argument. + pub fn send( + &self, + client: &stripe::Client, + refund: &stripe_types::refund::RefundId, + ) -> stripe::Response { + client.send_form(&format!("/refunds/{refund}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelRefund<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelRefund<'a> { + /// Cancels a refund with a status of `requires_action`. + /// + /// You can’t cancel refunds in other states. + /// + /// Only refunds for payment methods that require customer action can enter the `requires_action` state. + pub fn send( + &self, + client: &stripe::Client, + refund: &stripe_types::refund::RefundId, + ) -> stripe::Response { + client.send_form(&format!("/refunds/{refund}/cancel"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ExpireRefund<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ExpireRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ExpireRefund<'a> { + /// Expire a refund with a status of `requires_action`. + pub fn send( + &self, + client: &stripe::Client, + refund: &stripe_types::refund::RefundId, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/refunds/{refund}/expire"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_core/src/refund_next_action/mod.rs b/generated/stripe_core/src/refund_next_action/mod.rs new file mode 100644 index 000000000..ce2cb335b --- /dev/null +++ b/generated/stripe_core/src/refund_next_action/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::refund_next_action::*; \ No newline at end of file diff --git a/generated/stripe_core/src/refund_next_action_display_details/mod.rs b/generated/stripe_core/src/refund_next_action_display_details/mod.rs new file mode 100644 index 000000000..ecedc1e05 --- /dev/null +++ b/generated/stripe_core/src/refund_next_action_display_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::refund_next_action_display_details::*; \ No newline at end of file diff --git a/generated/stripe_core/src/reserve_transaction/mod.rs b/generated/stripe_core/src/reserve_transaction/mod.rs new file mode 100644 index 000000000..5edf27517 --- /dev/null +++ b/generated/stripe_core/src/reserve_transaction/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::reserve_transaction::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details/mod.rs new file mode 100644 index 000000000..e4f4ea991 --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details_acss_debit/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details_acss_debit/mod.rs new file mode 100644 index 000000000..3c28de226 --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details_acss_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details_acss_debit::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details_au_becs_debit/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details_au_becs_debit/mod.rs new file mode 100644 index 000000000..d209d68b7 --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details_au_becs_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details_au_becs_debit::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details_bacs_debit/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details_bacs_debit/mod.rs new file mode 100644 index 000000000..9ddbe8db0 --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details_bacs_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details_bacs_debit::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details_bancontact/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details_bancontact/mod.rs new file mode 100644 index 000000000..e69140fd3 --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details_bancontact/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details_bancontact::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details_boleto/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details_boleto/mod.rs new file mode 100644 index 000000000..320d24bb5 --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details_boleto/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details_boleto::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details_card/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details_card/mod.rs new file mode 100644 index 000000000..248e1b515 --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details_card/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details_card::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details_card_checks/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details_card_checks/mod.rs new file mode 100644 index 000000000..3a0ca23c7 --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details_card_checks/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details_card_checks::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details_card_present/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details_card_present/mod.rs new file mode 100644 index 000000000..8c331562a --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details_card_present/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details_card_present::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details_card_wallet/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details_card_wallet/mod.rs new file mode 100644 index 000000000..ccdbd8ec5 --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details_card_wallet/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details_card_wallet::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details_cashapp/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details_cashapp/mod.rs new file mode 100644 index 000000000..b60f340c0 --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details_cashapp/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details_cashapp::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details_ideal/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details_ideal/mod.rs new file mode 100644 index 000000000..12912f8c9 --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details_ideal/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details_ideal::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details_klarna/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details_klarna/mod.rs new file mode 100644 index 000000000..1194dd429 --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details_klarna/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details_klarna::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details_link/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details_link/mod.rs new file mode 100644 index 000000000..579b1fb16 --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details_link/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details_link::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details_paypal/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details_paypal/mod.rs new file mode 100644 index 000000000..ac2f3ce24 --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details_paypal/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details_paypal::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details_sepa_debit/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details_sepa_debit/mod.rs new file mode 100644 index 000000000..b22d4029d --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details_sepa_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details_sepa_debit::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details_sofort/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details_sofort/mod.rs new file mode 100644 index 000000000..a7b162e37 --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details_sofort/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details_sofort::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_attempt_payment_method_details_us_bank_account/mod.rs b/generated/stripe_core/src/setup_attempt_payment_method_details_us_bank_account/mod.rs new file mode 100644 index 000000000..9741a3e94 --- /dev/null +++ b/generated/stripe_core/src/setup_attempt_payment_method_details_us_bank_account/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_attempt_payment_method_details_us_bank_account::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_intent/mod.rs b/generated/stripe_core/src/setup_intent/mod.rs new file mode 100644 index 000000000..8ee8b8ee9 --- /dev/null +++ b/generated/stripe_core/src/setup_intent/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::setup_intent::*; +#[cfg(feature = "setup_intent")] +mod requests; +#[cfg(feature = "setup_intent")] +pub use requests::*; diff --git a/generated/stripe_core/src/setup_intent/requests.rs b/generated/stripe_core/src/setup_intent/requests.rs new file mode 100644 index 000000000..533e0d477 --- /dev/null +++ b/generated/stripe_core/src/setup_intent/requests.rs @@ -0,0 +1,8007 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntent<'a> { + /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + /// + /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. + /// + /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub attach_to_self: Option, + /// When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_payment_methods: Option, + /// Set to `true` to attempt to confirm this SetupIntent immediately. + /// + /// This parameter defaults to `false`. + /// If a card is the attached payment method, you can provide a `return_url` in case further authentication is necessary. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirm: Option, + /// ID of the Customer this SetupIntent belongs to, if one exists. + /// + /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup. + /// + /// Payment methods attached to other Customers cannot be used with this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Indicates the directions of money movement for which this payment method is intended to be used. + /// + /// Include `inbound` if you intend to use the payment method as the origin to pull funds from. + /// + /// Include `outbound` if you intend to use the payment method as the destination to send funds to. + /// You can include both if you intend to use the payment method for both purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub flow_directions: Option<&'a [CreateSetupIntentFlowDirections]>, + /// This hash contains details about the mandate to create. + /// + /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_data: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The Stripe account ID created for this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// The ID of the payment method configuration to use with this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_configuration: Option<&'a str>, + /// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) + /// value in the SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_data: Option>, + /// Payment method-specific configuration for this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The list of payment method types (for example, card) that this SetupIntent can use. + /// + /// If you don't provide this, it defaults to ["card"]. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [&'a str]>, + /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. + /// + /// To redirect to a mobile application, you can alternatively supply an application URI scheme. + /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, + /// If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion. + #[serde(skip_serializing_if = "Option::is_none")] + pub single_use: Option, + /// Indicates how the payment method is intended to be used in the future. + /// + /// If not provided, this value defaults to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub usage: Option, + /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_stripe_sdk: Option, +} +impl<'a> CreateSetupIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentAutomaticPaymentMethods { + /// Controls whether this SetupIntent will accept redirect-based payment methods. + /// + /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. + /// + /// To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redirects: Option, + /// Whether this feature is enabled. + pub enabled: bool, +} +impl CreateSetupIntentAutomaticPaymentMethods { + pub fn new(enabled: bool) -> Self { + Self { allow_redirects: Default::default(), enabled } + } +} +/// Controls whether this SetupIntent will accept redirect-based payment methods. +/// +/// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. +/// +/// To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + Always, + Never, +} +impl CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::*; + match self { + Always => "always", + Never => "never", + } + } +} + +impl std::str::FromStr for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::*; + match s { + "always" => Ok(Always), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates the directions of money movement for which this payment method is intended to be used. +/// +/// Include `inbound` if you intend to use the payment method as the origin to pull funds from. +/// +/// Include `outbound` if you intend to use the payment method as the destination to send funds to. +/// You can include both if you intend to use the payment method for both purposes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentFlowDirections { + Inbound, + Outbound, +} +impl CreateSetupIntentFlowDirections { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentFlowDirections::*; + match self { + Inbound => "inbound", + Outbound => "outbound", + } + } +} + +impl std::str::FromStr for CreateSetupIntentFlowDirections { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentFlowDirections::*; + match s { + "inbound" => Ok(Inbound), + "outbound" => Ok(Outbound), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentFlowDirections { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentFlowDirections { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentFlowDirections { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentFlowDirections { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This hash contains details about the mandate to create. +/// +/// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentMandateData<'a> { + /// This hash contains details about the customer acceptance of the Mandate. + pub customer_acceptance: CreateSetupIntentMandateDataCustomerAcceptance<'a>, +} +impl<'a> CreateSetupIntentMandateData<'a> { + pub fn new(customer_acceptance: CreateSetupIntentMandateDataCustomerAcceptance<'a>) -> Self { + Self { customer_acceptance } + } +} +/// This hash contains details about the customer acceptance of the Mandate. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentMandateDataCustomerAcceptance<'a> { + /// The time at which the customer accepted the Mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub accepted_at: Option, + /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option<&'a serde_json::Value>, + /// If this is a Mandate accepted online, this hash contains details about the online acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub online: Option>, + /// The type of customer acceptance information included with the Mandate. + /// + /// One of `online` or `offline`. + #[serde(rename = "type")] + pub type_: CreateSetupIntentMandateDataCustomerAcceptanceType, +} +impl<'a> CreateSetupIntentMandateDataCustomerAcceptance<'a> { + pub fn new(type_: CreateSetupIntentMandateDataCustomerAcceptanceType) -> Self { + Self { + accepted_at: Default::default(), + offline: Default::default(), + online: Default::default(), + type_, + } + } +} +/// If this is a Mandate accepted online, this hash contains details about the online acceptance. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentMandateDataCustomerAcceptanceOnline<'a> { + /// The IP address from which the Mandate was accepted by the customer. + pub ip_address: &'a str, + /// The user agent of the browser from which the Mandate was accepted by the customer. + pub user_agent: &'a str, +} +impl<'a> CreateSetupIntentMandateDataCustomerAcceptanceOnline<'a> { + pub fn new(ip_address: &'a str, user_agent: &'a str) -> Self { + Self { ip_address, user_agent } + } +} +/// The type of customer acceptance information included with the Mandate. +/// +/// One of `online` or `offline`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentMandateDataCustomerAcceptanceType { + Offline, + Online, +} +impl CreateSetupIntentMandateDataCustomerAcceptanceType { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentMandateDataCustomerAcceptanceType::*; + match self { + Offline => "offline", + Online => "online", + } + } +} + +impl std::str::FromStr for CreateSetupIntentMandateDataCustomerAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentMandateDataCustomerAcceptanceType::*; + match s { + "offline" => Ok(Offline), + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentMandateDataCustomerAcceptanceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentMandateDataCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentMandateDataCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentMandateDataCustomerAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) +/// value in the SetupIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodData<'a> { + /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option<&'a serde_json::Value>, + /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option<&'a serde_json::Value>, + /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option<&'a serde_json::Value>, + /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option>, + /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option>, + /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option<&'a serde_json::Value>, + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: Option>, + /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option<&'a serde_json::Value>, + /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option>, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option<&'a serde_json::Value>, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option<&'a serde_json::Value>, + /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option<&'a serde_json::Value>, + /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option<&'a serde_json::Value>, + /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option<&'a serde_json::Value>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option<&'a serde_json::Value>, + /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option<&'a serde_json::Value>, + /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option<&'a serde_json::Value>, + /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option<&'a serde_json::Value>, + /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option<&'a serde_json::Value>, + /// Options to configure Radar. + /// + /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option<&'a serde_json::Value>, + /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// The type of the PaymentMethod. + /// + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + pub type_: CreateSetupIntentPaymentMethodDataType, + /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option<&'a serde_json::Value>, + /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option<&'a serde_json::Value>, +} +impl<'a> CreateSetupIntentPaymentMethodData<'a> { + pub fn new(type_: CreateSetupIntentPaymentMethodDataType) -> Self { + Self { + acss_debit: Default::default(), + affirm: Default::default(), + afterpay_clearpay: Default::default(), + alipay: Default::default(), + au_becs_debit: Default::default(), + bacs_debit: Default::default(), + bancontact: Default::default(), + billing_details: Default::default(), + blik: Default::default(), + boleto: Default::default(), + cashapp: Default::default(), + customer_balance: Default::default(), + eps: Default::default(), + fpx: Default::default(), + giropay: Default::default(), + grabpay: Default::default(), + ideal: Default::default(), + interac_present: Default::default(), + klarna: Default::default(), + konbini: Default::default(), + link: Default::default(), + metadata: Default::default(), + oxxo: Default::default(), + p24: Default::default(), + paynow: Default::default(), + paypal: Default::default(), + pix: Default::default(), + promptpay: Default::default(), + radar_options: Default::default(), + revolut_pay: Default::default(), + sepa_debit: Default::default(), + sofort: Default::default(), + type_, + us_bank_account: Default::default(), + wechat_pay: Default::default(), + zip: Default::default(), + } + } +} +/// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataAcssDebit<'a> { + /// Customer's bank account number. + pub account_number: &'a str, + /// Institution number of the customer's bank. + pub institution_number: &'a str, + /// Transit number of the customer's bank. + pub transit_number: &'a str, +} +impl<'a> CreateSetupIntentPaymentMethodDataAcssDebit<'a> { + pub fn new( + account_number: &'a str, + institution_number: &'a str, + transit_number: &'a str, + ) -> Self { + Self { account_number, institution_number, transit_number } + } +} +/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataAuBecsDebit<'a> { + /// The account number for the bank account. + pub account_number: &'a str, + /// Bank-State-Branch number of the bank account. + pub bsb_number: &'a str, +} +impl<'a> CreateSetupIntentPaymentMethodDataAuBecsDebit<'a> { + pub fn new(account_number: &'a str, bsb_number: &'a str) -> Self { + Self { account_number, bsb_number } + } +} +/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataBacsDebit<'a> { + /// Account number of the bank account that the funds will be debited from. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Sort code of the bank account. + /// + /// (e.g., `10-20-30`). + #[serde(skip_serializing_if = "Option::is_none")] + pub sort_code: Option<&'a str>, +} +impl<'a> CreateSetupIntentPaymentMethodDataBacsDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataBillingDetails<'a> { + /// Billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Billing phone number (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> CreateSetupIntentPaymentMethodDataBillingDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataBillingDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateSetupIntentPaymentMethodDataBillingDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataBoleto<'a> { + /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers). + pub tax_id: &'a str, +} +impl<'a> CreateSetupIntentPaymentMethodDataBoleto<'a> { + pub fn new(tax_id: &'a str) -> Self { + Self { tax_id } + } +} +/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataEps { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreateSetupIntentPaymentMethodDataEps { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateSetupIntentPaymentMethodDataEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateSetupIntentPaymentMethodDataEpsBank { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodDataEpsBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataFpx { + /// Account holder type for FPX transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The customer's bank. + pub bank: CreateSetupIntentPaymentMethodDataFpxBank, +} +impl CreateSetupIntentPaymentMethodDataFpx { + pub fn new(bank: CreateSetupIntentPaymentMethodDataFpxBank) -> Self { + Self { account_holder_type: Default::default(), bank } + } +} +/// Account holder type for FPX transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodDataFpxAccountHolderType { + Company, + Individual, +} +impl CreateSetupIntentPaymentMethodDataFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodDataFpxAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateSetupIntentPaymentMethodDataFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateSetupIntentPaymentMethodDataFpxBank { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodDataFpxBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataIdeal { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreateSetupIntentPaymentMethodDataIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateSetupIntentPaymentMethodDataIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateSetupIntentPaymentMethodDataIdealBank { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodDataIdealBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataKlarna { + /// Customer's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, +} +impl CreateSetupIntentPaymentMethodDataKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Customer's date of birth. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataKlarnaDob { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl CreateSetupIntentPaymentMethodDataKlarnaDob { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataP24 { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreateSetupIntentPaymentMethodDataP24 { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateSetupIntentPaymentMethodDataP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateSetupIntentPaymentMethodDataP24Bank { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodDataP24Bank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options to configure Radar. +/// +/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataRadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> CreateSetupIntentPaymentMethodDataRadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataSepaDebit<'a> { + /// IBAN of the bank account. + pub iban: &'a str, +} +impl<'a> CreateSetupIntentPaymentMethodDataSepaDebit<'a> { + pub fn new(iban: &'a str) -> Self { + Self { iban } + } +} +/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataSofort { + /// Two-letter ISO code representing the country the bank account is located in. + pub country: CreateSetupIntentPaymentMethodDataSofortCountry, +} +impl CreateSetupIntentPaymentMethodDataSofort { + pub fn new(country: CreateSetupIntentPaymentMethodDataSofortCountry) -> Self { + Self { country } + } +} +/// Two-letter ISO code representing the country the bank account is located in. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodDataSofortCountry { + At, + Be, + De, + Es, + It, + Nl, +} +impl CreateSetupIntentPaymentMethodDataSofortCountry { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataSofortCountry::*; + match self { + At => "AT", + Be => "BE", + De => "DE", + Es => "ES", + It => "IT", + Nl => "NL", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataSofortCountry { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataSofortCountry::*; + match s { + "AT" => Ok(At), + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "IT" => Ok(It), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodDataSofortCountry { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataSofortCountry { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of the PaymentMethod. +/// +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateSetupIntentPaymentMethodDataType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateSetupIntentPaymentMethodDataType { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodDataType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataUsBankAccount<'a> { + /// Account holder type: individual or company. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: + Option, + /// Account number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Account type: checkings or savings. + /// + /// Defaults to checking if omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// The ID of a Financial Connections Account to use as a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections_account: Option<&'a str>, + /// Routing number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> CreateSetupIntentPaymentMethodDataUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + Company, + Individual, +} +impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Account type: checkings or savings. +/// +/// Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { + Checking, + Savings, +} +impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment method-specific configuration for this SetupIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptions<'a> { + /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// Configuration for any card setup attempted on this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option>, + /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option>, + /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, +} +impl<'a> CreateSetupIntentPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsAcssDebit<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsAcssDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. +/// +/// Must be a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + Cad, + Usd, +} +impl CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*; + match self { + Cad => "cad", + Usd => "usd", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*; + match s { + "cad" => Ok(Cad), + "usd" => Ok(Usd), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for Mandate creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + /// A URL for custom mandate text to render during confirmation step. + /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option<&'a str>, + /// List of Stripe products where this mandate can be selected automatically. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for: + Option<&'a [CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor]>, + /// Description of the mandate interval. + /// + /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_description: Option<&'a str>, + /// Payment schedule for the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_schedule: + Option, + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: + Option, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// List of Stripe products where this mandate can be selected automatically. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + Invoice, + Subscription, +} +impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*; + match self { + Invoice => "invoice", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*; + match s { + "invoice" => Ok(Invoice), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr + for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for any card setup attempted on this SetupIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsCard<'a> { + /// Configuration options for setting up an eMandate for cards issued in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// When specified, this parameter signals that a card has been collected + /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. + /// + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub moto: Option, + /// Selected network to process this SetupIntent on. + /// + /// Depends on the available networks of the card attached to the SetupIntent. + /// Can be only set confirm-time. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, + /// 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). + /// + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// Permitted values include: `automatic` or `any`. + /// If not provided, defaults to `automatic`. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration options for setting up an eMandate for cards issued in India. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsCardMandateOptions<'a> { + /// Amount to be charged for future payments. + pub amount: i64, + /// One of `fixed` or `maximum`. + /// + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, + /// Currency in which future payments will be charged. + /// + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// End date of the mandate or subscription. + /// + /// If not provided, the mandate will be active until canceled. + /// If provided, end date should be after start date. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// Specifies payment frequency. + /// + /// One of `day`, `week`, `month`, `year`, or `sporadic`. + pub interval: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval, + /// The number of intervals between payments. + /// + /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// This parameter is optional when `interval=sporadic`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, + /// Unique identifier for the mandate or subscription. + pub reference: &'a str, + /// Start date of the mandate or subscription. + /// + /// Start date should not be lesser than yesterday. + pub start_date: stripe_types::Timestamp, + /// Specifies the type of mandates supported. + /// + /// Possible values are `india`. + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_types: + Option<&'a [CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes]>, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsCardMandateOptions<'a> { + pub fn new( + amount: i64, + amount_type: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, + currency: stripe_types::Currency, + interval: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval, + reference: &'a str, + start_date: stripe_types::Timestamp, + ) -> Self { + Self { + amount, + amount_type, + currency, + description: Default::default(), + end_date: Default::default(), + interval, + interval_count: Default::default(), + reference, + start_date, + supported_types: Default::default(), + } + } +} +/// One of `fixed` or `maximum`. +/// +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies payment frequency. +/// +/// One of `day`, `week`, `month`, `year`, or `sporadic`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + Day, + Month, + Sporadic, + Week, + Year, +} +impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match self { + Day => "day", + Month => "month", + Sporadic => "sporadic", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "sporadic" => Ok(Sporadic), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies the type of mandates supported. +/// +/// Possible values are `india`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + India, +} +impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match self { + India => "india", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match s { + "india" => Ok(India), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Selected network to process this SetupIntent on. +/// +/// Depends on the available networks of the card attached to the SetupIntent. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl CreateSetupIntentPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodOptionsCardNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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). +/// +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// Permitted values include: `automatic` or `any`. +/// If not provided, defaults to `automatic`. +/// 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. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, +} +impl CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsLink<'a> { + /// \[Deprecated\] This is a legacy parameter that no longer has any function. + #[serde(skip_serializing_if = "Option::is_none")] + pub persistent_token: Option<&'a str>, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsPaypal<'a> { + /// The PayPal Billing Agreement ID (BAID). + /// + /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_agreement_id: Option<&'a str>, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsPaypal<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsSepaDebit<'a> { + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option<&'a serde_json::Value>, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsSepaDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: + Option>, + /// Additional fields for network related functions. + #[serde(skip_serializing_if = "Option::is_none")] + pub networks: Option>, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: Option< + &'a [CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions], + >, + /// List of data features that you would like to retrieve upon account creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prefetch: Option< + &'a [CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch], + >, + /// For webview integrations only. + /// + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl AsRef + for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, +} +impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + } + } +} + +impl std::str::FromStr + for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for network related functions. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + /// Triggers validations to run across the selected networks. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: + Option<&'a [CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested]>, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Triggers validations to run across the selected networks. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + Ach, + UsDomesticWire, +} +impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentSingleUse { + /// Amount the customer is granting permission to collect later. + /// + /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, +} +impl CreateSetupIntentSingleUse { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { amount, currency } + } +} +/// Indicates how the payment method is intended to be used in the future. +/// +/// If not provided, this value defaults to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentUsage { + OffSession, + OnSession, +} +impl CreateSetupIntentUsage { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentUsage::*; + match self { + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateSetupIntentUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentUsage::*; + match s { + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreateSetupIntentUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSetupIntentUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateSetupIntent<'a> { + /// Creates a SetupIntent object. + /// + /// After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm) + /// it to collect any required permissions to charge the payment method later. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/setup_intents", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListSetupIntent<'a> { + /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + /// + /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. + /// + /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub attach_to_self: Option, + /// A filter on the list, based on the object `created` field. + /// + /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return SetupIntents for the customer specified by this customer ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return SetupIntents that associate with the specified payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListSetupIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListSetupIntent<'a> { + /// Returns a list of SetupIntents. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/setup_intents", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/setup_intents", self) + } +} +impl<'a> stripe::PaginationParams for ListSetupIntent<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveSetupIntent<'a> { + /// The client secret of the SetupIntent. + /// + /// We require this string if you use a publishable key to retrieve the SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub client_secret: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveSetupIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveSetupIntent<'a> { + /// Retrieves the details of a SetupIntent that has previously been created. + /// + /// Client-side retrieval using a publishable key is allowed when the `client_secret` is provided in the query string. + /// When retrieved with a publishable key, only a subset of properties will be returned. + /// Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details. + pub fn send( + &self, + client: &stripe::Client, + intent: &str, + ) -> stripe::Response { + client.get_query(&format!("/setup_intents/{intent}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntent<'a> { + /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + /// + /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. + /// + /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub attach_to_self: Option, + /// ID of the Customer this SetupIntent belongs to, if one exists. + /// + /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup. + /// + /// Payment methods attached to other Customers cannot be used with this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Indicates the directions of money movement for which this payment method is intended to be used. + /// + /// Include `inbound` if you intend to use the payment method as the origin to pull funds from. + /// + /// Include `outbound` if you intend to use the payment method as the destination to send funds to. + /// You can include both if you intend to use the payment method for both purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub flow_directions: Option<&'a [UpdateSetupIntentFlowDirections]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// The ID of the payment method configuration to use with this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_configuration: Option<&'a str>, + /// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) + /// value in the SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_data: Option>, + /// Payment method-specific configuration for this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The list of payment method types (for example, card) that this SetupIntent can set up. + /// + /// If you don't provide this array, it defaults to ["card"]. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [&'a str]>, +} +impl<'a> UpdateSetupIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates the directions of money movement for which this payment method is intended to be used. +/// +/// Include `inbound` if you intend to use the payment method as the origin to pull funds from. +/// +/// Include `outbound` if you intend to use the payment method as the destination to send funds to. +/// You can include both if you intend to use the payment method for both purposes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentFlowDirections { + Inbound, + Outbound, +} +impl UpdateSetupIntentFlowDirections { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentFlowDirections::*; + match self { + Inbound => "inbound", + Outbound => "outbound", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentFlowDirections { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentFlowDirections::*; + match s { + "inbound" => Ok(Inbound), + "outbound" => Ok(Outbound), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentFlowDirections { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentFlowDirections { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentFlowDirections { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentFlowDirections { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) +/// value in the SetupIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodData<'a> { + /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option<&'a serde_json::Value>, + /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option<&'a serde_json::Value>, + /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option<&'a serde_json::Value>, + /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option>, + /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option>, + /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option<&'a serde_json::Value>, + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: Option>, + /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option<&'a serde_json::Value>, + /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option>, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option<&'a serde_json::Value>, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option<&'a serde_json::Value>, + /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option<&'a serde_json::Value>, + /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option<&'a serde_json::Value>, + /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option<&'a serde_json::Value>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option<&'a serde_json::Value>, + /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option<&'a serde_json::Value>, + /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option<&'a serde_json::Value>, + /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option<&'a serde_json::Value>, + /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option<&'a serde_json::Value>, + /// Options to configure Radar. + /// + /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option<&'a serde_json::Value>, + /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// The type of the PaymentMethod. + /// + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + pub type_: UpdateSetupIntentPaymentMethodDataType, + /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option<&'a serde_json::Value>, + /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option<&'a serde_json::Value>, +} +impl<'a> UpdateSetupIntentPaymentMethodData<'a> { + pub fn new(type_: UpdateSetupIntentPaymentMethodDataType) -> Self { + Self { + acss_debit: Default::default(), + affirm: Default::default(), + afterpay_clearpay: Default::default(), + alipay: Default::default(), + au_becs_debit: Default::default(), + bacs_debit: Default::default(), + bancontact: Default::default(), + billing_details: Default::default(), + blik: Default::default(), + boleto: Default::default(), + cashapp: Default::default(), + customer_balance: Default::default(), + eps: Default::default(), + fpx: Default::default(), + giropay: Default::default(), + grabpay: Default::default(), + ideal: Default::default(), + interac_present: Default::default(), + klarna: Default::default(), + konbini: Default::default(), + link: Default::default(), + metadata: Default::default(), + oxxo: Default::default(), + p24: Default::default(), + paynow: Default::default(), + paypal: Default::default(), + pix: Default::default(), + promptpay: Default::default(), + radar_options: Default::default(), + revolut_pay: Default::default(), + sepa_debit: Default::default(), + sofort: Default::default(), + type_, + us_bank_account: Default::default(), + wechat_pay: Default::default(), + zip: Default::default(), + } + } +} +/// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataAcssDebit<'a> { + /// Customer's bank account number. + pub account_number: &'a str, + /// Institution number of the customer's bank. + pub institution_number: &'a str, + /// Transit number of the customer's bank. + pub transit_number: &'a str, +} +impl<'a> UpdateSetupIntentPaymentMethodDataAcssDebit<'a> { + pub fn new( + account_number: &'a str, + institution_number: &'a str, + transit_number: &'a str, + ) -> Self { + Self { account_number, institution_number, transit_number } + } +} +/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataAuBecsDebit<'a> { + /// The account number for the bank account. + pub account_number: &'a str, + /// Bank-State-Branch number of the bank account. + pub bsb_number: &'a str, +} +impl<'a> UpdateSetupIntentPaymentMethodDataAuBecsDebit<'a> { + pub fn new(account_number: &'a str, bsb_number: &'a str) -> Self { + Self { account_number, bsb_number } + } +} +/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataBacsDebit<'a> { + /// Account number of the bank account that the funds will be debited from. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Sort code of the bank account. + /// + /// (e.g., `10-20-30`). + #[serde(skip_serializing_if = "Option::is_none")] + pub sort_code: Option<&'a str>, +} +impl<'a> UpdateSetupIntentPaymentMethodDataBacsDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataBillingDetails<'a> { + /// Billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Billing phone number (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> UpdateSetupIntentPaymentMethodDataBillingDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataBillingDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateSetupIntentPaymentMethodDataBillingDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataBoleto<'a> { + /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers). + pub tax_id: &'a str, +} +impl<'a> UpdateSetupIntentPaymentMethodDataBoleto<'a> { + pub fn new(tax_id: &'a str) -> Self { + Self { tax_id } + } +} +/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataEps { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl UpdateSetupIntentPaymentMethodDataEps { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateSetupIntentPaymentMethodDataEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateSetupIntentPaymentMethodDataEpsBank { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodDataEpsBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataFpx { + /// Account holder type for FPX transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The customer's bank. + pub bank: UpdateSetupIntentPaymentMethodDataFpxBank, +} +impl UpdateSetupIntentPaymentMethodDataFpx { + pub fn new(bank: UpdateSetupIntentPaymentMethodDataFpxBank) -> Self { + Self { account_holder_type: Default::default(), bank } + } +} +/// Account holder type for FPX transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { + Company, + Individual, +} +impl UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateSetupIntentPaymentMethodDataFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateSetupIntentPaymentMethodDataFpxBank { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodDataFpxBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataIdeal { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl UpdateSetupIntentPaymentMethodDataIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateSetupIntentPaymentMethodDataIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateSetupIntentPaymentMethodDataIdealBank { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodDataIdealBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataKlarna { + /// Customer's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, +} +impl UpdateSetupIntentPaymentMethodDataKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Customer's date of birth. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataKlarnaDob { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl UpdateSetupIntentPaymentMethodDataKlarnaDob { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataP24 { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl UpdateSetupIntentPaymentMethodDataP24 { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateSetupIntentPaymentMethodDataP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateSetupIntentPaymentMethodDataP24Bank { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodDataP24Bank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options to configure Radar. +/// +/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataRadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> UpdateSetupIntentPaymentMethodDataRadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataSepaDebit<'a> { + /// IBAN of the bank account. + pub iban: &'a str, +} +impl<'a> UpdateSetupIntentPaymentMethodDataSepaDebit<'a> { + pub fn new(iban: &'a str) -> Self { + Self { iban } + } +} +/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataSofort { + /// Two-letter ISO code representing the country the bank account is located in. + pub country: UpdateSetupIntentPaymentMethodDataSofortCountry, +} +impl UpdateSetupIntentPaymentMethodDataSofort { + pub fn new(country: UpdateSetupIntentPaymentMethodDataSofortCountry) -> Self { + Self { country } + } +} +/// Two-letter ISO code representing the country the bank account is located in. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodDataSofortCountry { + At, + Be, + De, + Es, + It, + Nl, +} +impl UpdateSetupIntentPaymentMethodDataSofortCountry { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataSofortCountry::*; + match self { + At => "AT", + Be => "BE", + De => "DE", + Es => "ES", + It => "IT", + Nl => "NL", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataSofortCountry { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataSofortCountry::*; + match s { + "AT" => Ok(At), + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "IT" => Ok(It), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodDataSofortCountry { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataSofortCountry { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of the PaymentMethod. +/// +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateSetupIntentPaymentMethodDataType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateSetupIntentPaymentMethodDataType { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodDataType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataUsBankAccount<'a> { + /// Account holder type: individual or company. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: + Option, + /// Account number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Account type: checkings or savings. + /// + /// Defaults to checking if omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// The ID of a Financial Connections Account to use as a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections_account: Option<&'a str>, + /// Routing number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> UpdateSetupIntentPaymentMethodDataUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + Company, + Individual, +} +impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Account type: checkings or savings. +/// +/// Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { + Checking, + Savings, +} +impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment method-specific configuration for this SetupIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptions<'a> { + /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// Configuration for any card setup attempted on this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option>, + /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option>, + /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, +} +impl<'a> UpdateSetupIntentPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebit<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsAcssDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. +/// +/// Must be a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + Cad, + Usd, +} +impl UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*; + match self { + Cad => "cad", + Usd => "usd", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*; + match s { + "cad" => Ok(Cad), + "usd" => Ok(Usd), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for Mandate creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + /// A URL for custom mandate text to render during confirmation step. + /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option<&'a str>, + /// List of Stripe products where this mandate can be selected automatically. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for: + Option<&'a [UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor]>, + /// Description of the mandate interval. + /// + /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_description: Option<&'a str>, + /// Payment schedule for the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_schedule: + Option, + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: + Option, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// List of Stripe products where this mandate can be selected automatically. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + Invoice, + Subscription, +} +impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*; + match self { + Invoice => "invoice", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*; + match s { + "invoice" => Ok(Invoice), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr + for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for any card setup attempted on this SetupIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsCard<'a> { + /// Configuration options for setting up an eMandate for cards issued in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// When specified, this parameter signals that a card has been collected + /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. + /// + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub moto: Option, + /// Selected network to process this SetupIntent on. + /// + /// Depends on the available networks of the card attached to the SetupIntent. + /// Can be only set confirm-time. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, + /// 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). + /// + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// Permitted values include: `automatic` or `any`. + /// If not provided, defaults to `automatic`. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration options for setting up an eMandate for cards issued in India. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsCardMandateOptions<'a> { + /// Amount to be charged for future payments. + pub amount: i64, + /// One of `fixed` or `maximum`. + /// + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, + /// Currency in which future payments will be charged. + /// + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// End date of the mandate or subscription. + /// + /// If not provided, the mandate will be active until canceled. + /// If provided, end date should be after start date. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// Specifies payment frequency. + /// + /// One of `day`, `week`, `month`, `year`, or `sporadic`. + pub interval: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval, + /// The number of intervals between payments. + /// + /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// This parameter is optional when `interval=sporadic`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, + /// Unique identifier for the mandate or subscription. + pub reference: &'a str, + /// Start date of the mandate or subscription. + /// + /// Start date should not be lesser than yesterday. + pub start_date: stripe_types::Timestamp, + /// Specifies the type of mandates supported. + /// + /// Possible values are `india`. + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_types: + Option<&'a [UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes]>, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsCardMandateOptions<'a> { + pub fn new( + amount: i64, + amount_type: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, + currency: stripe_types::Currency, + interval: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval, + reference: &'a str, + start_date: stripe_types::Timestamp, + ) -> Self { + Self { + amount, + amount_type, + currency, + description: Default::default(), + end_date: Default::default(), + interval, + interval_count: Default::default(), + reference, + start_date, + supported_types: Default::default(), + } + } +} +/// One of `fixed` or `maximum`. +/// +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies payment frequency. +/// +/// One of `day`, `week`, `month`, `year`, or `sporadic`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + Day, + Month, + Sporadic, + Week, + Year, +} +impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match self { + Day => "day", + Month => "month", + Sporadic => "sporadic", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "sporadic" => Ok(Sporadic), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies the type of mandates supported. +/// +/// Possible values are `india`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + India, +} +impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match self { + India => "india", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match s { + "india" => Ok(India), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Selected network to process this SetupIntent on. +/// +/// Depends on the available networks of the card attached to the SetupIntent. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl UpdateSetupIntentPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodOptionsCardNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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). +/// +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// Permitted values include: `automatic` or `any`. +/// If not provided, defaults to `automatic`. +/// 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. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, +} +impl UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsLink<'a> { + /// \[Deprecated\] This is a legacy parameter that no longer has any function. + #[serde(skip_serializing_if = "Option::is_none")] + pub persistent_token: Option<&'a str>, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsPaypal<'a> { + /// The PayPal Billing Agreement ID (BAID). + /// + /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_agreement_id: Option<&'a str>, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsPaypal<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebit<'a> { + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option<&'a serde_json::Value>, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsSepaDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: + Option>, + /// Additional fields for network related functions. + #[serde(skip_serializing_if = "Option::is_none")] + pub networks: Option>, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: Option< + &'a [UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions], + >, + /// List of data features that you would like to retrieve upon account creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prefetch: Option< + &'a [UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch], + >, + /// For webview integrations only. + /// + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl AsRef + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, +} +impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + } + } +} + +impl std::str::FromStr + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for network related functions. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + /// Triggers validations to run across the selected networks. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: + Option<&'a [UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested]>, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Triggers validations to run across the selected networks. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + Ach, + UsDomesticWire, +} +impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateSetupIntent<'a> { + /// Updates a SetupIntent object. + pub fn send( + &self, + client: &stripe::Client, + intent: &str, + ) -> stripe::Response { + client.send_form(&format!("/setup_intents/{intent}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntent<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_data: Option>, + /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) + /// value in the SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_data: Option>, + /// Payment method-specific configuration for this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The URL to redirect your customer back to after they authenticate on the payment method's app or site. + /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + /// This parameter is only used for cards and other redirect-based payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, + /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_stripe_sdk: Option, +} +impl<'a> ConfirmSetupIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum ConfirmSetupIntentMandateData<'a> { + SecretKeyParam(ConfirmSetupIntentSecretKeyParam<'a>), + ClientKeyParam(ConfirmSetupIntentClientKeyParam<'a>), +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentSecretKeyParam<'a> { + /// This hash contains details about the customer acceptance of the Mandate. + pub customer_acceptance: ConfirmSetupIntentSecretKeyParamCustomerAcceptance<'a>, +} +impl<'a> ConfirmSetupIntentSecretKeyParam<'a> { + pub fn new( + customer_acceptance: ConfirmSetupIntentSecretKeyParamCustomerAcceptance<'a>, + ) -> Self { + Self { customer_acceptance } + } +} +/// This hash contains details about the customer acceptance of the Mandate. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentSecretKeyParamCustomerAcceptance<'a> { + /// The time at which the customer accepted the Mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub accepted_at: Option, + /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option<&'a serde_json::Value>, + /// If this is a Mandate accepted online, this hash contains details about the online acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub online: Option>, + /// The type of customer acceptance information included with the Mandate. + /// + /// One of `online` or `offline`. + #[serde(rename = "type")] + pub type_: ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType, +} +impl<'a> ConfirmSetupIntentSecretKeyParamCustomerAcceptance<'a> { + pub fn new(type_: ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType) -> Self { + Self { + accepted_at: Default::default(), + offline: Default::default(), + online: Default::default(), + type_, + } + } +} +/// If this is a Mandate accepted online, this hash contains details about the online acceptance. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentSecretKeyParamCustomerAcceptanceOnline<'a> { + /// The IP address from which the Mandate was accepted by the customer. + pub ip_address: &'a str, + /// The user agent of the browser from which the Mandate was accepted by the customer. + pub user_agent: &'a str, +} +impl<'a> ConfirmSetupIntentSecretKeyParamCustomerAcceptanceOnline<'a> { + pub fn new(ip_address: &'a str, user_agent: &'a str) -> Self { + Self { ip_address, user_agent } + } +} +/// The type of customer acceptance information included with the Mandate. +/// +/// One of `online` or `offline`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType { + Offline, + Online, +} +impl ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*; + match self { + Offline => "offline", + Online => "online", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*; + match s { + "offline" => Ok(Offline), + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentClientKeyParam<'a> { + /// This hash contains details about the customer acceptance of the Mandate. + pub customer_acceptance: ConfirmSetupIntentClientKeyParamCustomerAcceptance<'a>, +} +impl<'a> ConfirmSetupIntentClientKeyParam<'a> { + pub fn new( + customer_acceptance: ConfirmSetupIntentClientKeyParamCustomerAcceptance<'a>, + ) -> Self { + Self { customer_acceptance } + } +} +/// This hash contains details about the customer acceptance of the Mandate. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptance<'a> { + /// If this is a Mandate accepted online, this hash contains details about the online acceptance. + pub online: ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline<'a>, + /// The type of customer acceptance information included with the Mandate. + #[serde(rename = "type")] + pub type_: ConfirmSetupIntentClientKeyParamCustomerAcceptanceType, +} +impl<'a> ConfirmSetupIntentClientKeyParamCustomerAcceptance<'a> { + pub fn new( + online: ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline<'a>, + type_: ConfirmSetupIntentClientKeyParamCustomerAcceptanceType, + ) -> Self { + Self { online, type_ } + } +} +/// If this is a Mandate accepted online, this hash contains details about the online acceptance. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline<'a> { + /// The IP address from which the Mandate was accepted by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_address: Option<&'a str>, + /// The user agent of the browser from which the Mandate was accepted by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of customer acceptance information included with the Mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentClientKeyParamCustomerAcceptanceType { + Online, +} +impl ConfirmSetupIntentClientKeyParamCustomerAcceptanceType { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*; + match self { + Online => "online", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*; + match s { + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) +/// value in the SetupIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodData<'a> { + /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option<&'a serde_json::Value>, + /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option<&'a serde_json::Value>, + /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option<&'a serde_json::Value>, + /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option>, + /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option>, + /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option<&'a serde_json::Value>, + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: Option>, + /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option<&'a serde_json::Value>, + /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option>, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option<&'a serde_json::Value>, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option<&'a serde_json::Value>, + /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option<&'a serde_json::Value>, + /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option<&'a serde_json::Value>, + /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option<&'a serde_json::Value>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option<&'a serde_json::Value>, + /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option<&'a serde_json::Value>, + /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option<&'a serde_json::Value>, + /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option<&'a serde_json::Value>, + /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option<&'a serde_json::Value>, + /// Options to configure Radar. + /// + /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option<&'a serde_json::Value>, + /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// The type of the PaymentMethod. + /// + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + pub type_: ConfirmSetupIntentPaymentMethodDataType, + /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option<&'a serde_json::Value>, + /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option<&'a serde_json::Value>, +} +impl<'a> ConfirmSetupIntentPaymentMethodData<'a> { + pub fn new(type_: ConfirmSetupIntentPaymentMethodDataType) -> Self { + Self { + acss_debit: Default::default(), + affirm: Default::default(), + afterpay_clearpay: Default::default(), + alipay: Default::default(), + au_becs_debit: Default::default(), + bacs_debit: Default::default(), + bancontact: Default::default(), + billing_details: Default::default(), + blik: Default::default(), + boleto: Default::default(), + cashapp: Default::default(), + customer_balance: Default::default(), + eps: Default::default(), + fpx: Default::default(), + giropay: Default::default(), + grabpay: Default::default(), + ideal: Default::default(), + interac_present: Default::default(), + klarna: Default::default(), + konbini: Default::default(), + link: Default::default(), + metadata: Default::default(), + oxxo: Default::default(), + p24: Default::default(), + paynow: Default::default(), + paypal: Default::default(), + pix: Default::default(), + promptpay: Default::default(), + radar_options: Default::default(), + revolut_pay: Default::default(), + sepa_debit: Default::default(), + sofort: Default::default(), + type_, + us_bank_account: Default::default(), + wechat_pay: Default::default(), + zip: Default::default(), + } + } +} +/// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataAcssDebit<'a> { + /// Customer's bank account number. + pub account_number: &'a str, + /// Institution number of the customer's bank. + pub institution_number: &'a str, + /// Transit number of the customer's bank. + pub transit_number: &'a str, +} +impl<'a> ConfirmSetupIntentPaymentMethodDataAcssDebit<'a> { + pub fn new( + account_number: &'a str, + institution_number: &'a str, + transit_number: &'a str, + ) -> Self { + Self { account_number, institution_number, transit_number } + } +} +/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataAuBecsDebit<'a> { + /// The account number for the bank account. + pub account_number: &'a str, + /// Bank-State-Branch number of the bank account. + pub bsb_number: &'a str, +} +impl<'a> ConfirmSetupIntentPaymentMethodDataAuBecsDebit<'a> { + pub fn new(account_number: &'a str, bsb_number: &'a str) -> Self { + Self { account_number, bsb_number } + } +} +/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataBacsDebit<'a> { + /// Account number of the bank account that the funds will be debited from. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Sort code of the bank account. + /// + /// (e.g., `10-20-30`). + #[serde(skip_serializing_if = "Option::is_none")] + pub sort_code: Option<&'a str>, +} +impl<'a> ConfirmSetupIntentPaymentMethodDataBacsDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataBillingDetails<'a> { + /// Billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Billing phone number (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> ConfirmSetupIntentPaymentMethodDataBillingDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataBillingDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> ConfirmSetupIntentPaymentMethodDataBillingDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataBoleto<'a> { + /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers). + pub tax_id: &'a str, +} +impl<'a> ConfirmSetupIntentPaymentMethodDataBoleto<'a> { + pub fn new(tax_id: &'a str) -> Self { + Self { tax_id } + } +} +/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataEps { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl ConfirmSetupIntentPaymentMethodDataEps { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmSetupIntentPaymentMethodDataEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmSetupIntentPaymentMethodDataEpsBank { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodDataEpsBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataFpx { + /// Account holder type for FPX transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The customer's bank. + pub bank: ConfirmSetupIntentPaymentMethodDataFpxBank, +} +impl ConfirmSetupIntentPaymentMethodDataFpx { + pub fn new(bank: ConfirmSetupIntentPaymentMethodDataFpxBank) -> Self { + Self { account_holder_type: Default::default(), bank } + } +} +/// Account holder type for FPX transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType { + Company, + Individual, +} +impl ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmSetupIntentPaymentMethodDataFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmSetupIntentPaymentMethodDataFpxBank { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodDataFpxBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataIdeal { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl ConfirmSetupIntentPaymentMethodDataIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmSetupIntentPaymentMethodDataIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmSetupIntentPaymentMethodDataIdealBank { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodDataIdealBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataKlarna { + /// Customer's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, +} +impl ConfirmSetupIntentPaymentMethodDataKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Customer's date of birth. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataKlarnaDob { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl ConfirmSetupIntentPaymentMethodDataKlarnaDob { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataP24 { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl ConfirmSetupIntentPaymentMethodDataP24 { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmSetupIntentPaymentMethodDataP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmSetupIntentPaymentMethodDataP24Bank { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodDataP24Bank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options to configure Radar. +/// +/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataRadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> ConfirmSetupIntentPaymentMethodDataRadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataSepaDebit<'a> { + /// IBAN of the bank account. + pub iban: &'a str, +} +impl<'a> ConfirmSetupIntentPaymentMethodDataSepaDebit<'a> { + pub fn new(iban: &'a str) -> Self { + Self { iban } + } +} +/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataSofort { + /// Two-letter ISO code representing the country the bank account is located in. + pub country: ConfirmSetupIntentPaymentMethodDataSofortCountry, +} +impl ConfirmSetupIntentPaymentMethodDataSofort { + pub fn new(country: ConfirmSetupIntentPaymentMethodDataSofortCountry) -> Self { + Self { country } + } +} +/// Two-letter ISO code representing the country the bank account is located in. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodDataSofortCountry { + At, + Be, + De, + Es, + It, + Nl, +} +impl ConfirmSetupIntentPaymentMethodDataSofortCountry { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataSofortCountry::*; + match self { + At => "AT", + Be => "BE", + De => "DE", + Es => "ES", + It => "IT", + Nl => "NL", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataSofortCountry { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataSofortCountry::*; + match s { + "AT" => Ok(At), + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "IT" => Ok(It), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodDataSofortCountry { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataSofortCountry { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of the PaymentMethod. +/// +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmSetupIntentPaymentMethodDataType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmSetupIntentPaymentMethodDataType { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodDataType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataUsBankAccount<'a> { + /// Account holder type: individual or company. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: + Option, + /// Account number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Account type: checkings or savings. + /// + /// Defaults to checking if omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// The ID of a Financial Connections Account to use as a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections_account: Option<&'a str>, + /// Routing number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> ConfirmSetupIntentPaymentMethodDataUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + Company, + Individual, +} +impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Account type: checkings or savings. +/// +/// Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType { + Checking, + Savings, +} +impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment method-specific configuration for this SetupIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptions<'a> { + /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// Configuration for any card setup attempted on this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option>, + /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option>, + /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebit<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsAcssDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. +/// +/// Must be a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency { + Cad, + Usd, +} +impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*; + match self { + Cad => "cad", + Usd => "usd", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*; + match s { + "cad" => Ok(Cad), + "usd" => Ok(Usd), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for Mandate creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + /// A URL for custom mandate text to render during confirmation step. + /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option<&'a str>, + /// List of Stripe products where this mandate can be selected automatically. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for: + Option<&'a [ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor]>, + /// Description of the mandate interval. + /// + /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_description: Option<&'a str>, + /// Payment schedule for the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_schedule: + Option, + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: + Option, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// List of Stripe products where this mandate can be selected automatically. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + Invoice, + Subscription, +} +impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*; + match self { + Invoice => "invoice", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*; + match s { + "invoice" => Ok(Invoice), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr + for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for any card setup attempted on this SetupIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsCard<'a> { + /// Configuration options for setting up an eMandate for cards issued in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// When specified, this parameter signals that a card has been collected + /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. + /// + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub moto: Option, + /// Selected network to process this SetupIntent on. + /// + /// Depends on the available networks of the card attached to the SetupIntent. + /// Can be only set confirm-time. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, + /// 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). + /// + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// Permitted values include: `automatic` or `any`. + /// If not provided, defaults to `automatic`. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration options for setting up an eMandate for cards issued in India. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions<'a> { + /// Amount to be charged for future payments. + pub amount: i64, + /// One of `fixed` or `maximum`. + /// + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, + /// Currency in which future payments will be charged. + /// + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// End date of the mandate or subscription. + /// + /// If not provided, the mandate will be active until canceled. + /// If provided, end date should be after start date. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// Specifies payment frequency. + /// + /// One of `day`, `week`, `month`, `year`, or `sporadic`. + pub interval: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval, + /// The number of intervals between payments. + /// + /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// This parameter is optional when `interval=sporadic`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, + /// Unique identifier for the mandate or subscription. + pub reference: &'a str, + /// Start date of the mandate or subscription. + /// + /// Start date should not be lesser than yesterday. + pub start_date: stripe_types::Timestamp, + /// Specifies the type of mandates supported. + /// + /// Possible values are `india`. + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_types: + Option<&'a [ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes]>, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions<'a> { + pub fn new( + amount: i64, + amount_type: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, + currency: stripe_types::Currency, + interval: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval, + reference: &'a str, + start_date: stripe_types::Timestamp, + ) -> Self { + Self { + amount, + amount_type, + currency, + description: Default::default(), + end_date: Default::default(), + interval, + interval_count: Default::default(), + reference, + start_date, + supported_types: Default::default(), + } + } +} +/// One of `fixed` or `maximum`. +/// +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies payment frequency. +/// +/// One of `day`, `week`, `month`, `year`, or `sporadic`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + Day, + Month, + Sporadic, + Week, + Year, +} +impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match self { + Day => "day", + Month => "month", + Sporadic => "sporadic", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "sporadic" => Ok(Sporadic), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies the type of mandates supported. +/// +/// Possible values are `india`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + India, +} +impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match self { + India => "india", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match s { + "india" => Ok(India), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Selected network to process this SetupIntent on. +/// +/// Depends on the available networks of the card attached to the SetupIntent. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl ConfirmSetupIntentPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodOptionsCardNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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). +/// +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// Permitted values include: `automatic` or `any`. +/// If not provided, defaults to `automatic`. +/// 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. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, +} +impl ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsLink<'a> { + /// \[Deprecated\] This is a legacy parameter that no longer has any function. + #[serde(skip_serializing_if = "Option::is_none")] + pub persistent_token: Option<&'a str>, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsPaypal<'a> { + /// The PayPal Billing Agreement ID (BAID). + /// + /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_agreement_id: Option<&'a str>, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsPaypal<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsSepaDebit<'a> { + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option<&'a serde_json::Value>, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsSepaDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: + Option>, + /// Additional fields for network related functions. + #[serde(skip_serializing_if = "Option::is_none")] + pub networks: Option>, + /// Verification method for the intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: Option< + &'a [ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions], + >, + /// List of data features that you would like to retrieve upon account creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prefetch: Option< + &'a [ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch], + >, + /// For webview integrations only. + /// + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl AsRef + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, +} +impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + } + } +} + +impl std::str::FromStr + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + _ => Err(()), + } + } +} +impl AsRef + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for network related functions. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + /// Triggers validations to run across the selected networks. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: + Option<&'a [ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested]>, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Triggers validations to run across the selected networks. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + Ach, + UsDomesticWire, +} +impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ConfirmSetupIntent<'a> { + /// Confirm that your customer intends to set up the current or + /// provided payment method. + /// + /// For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website. If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the `succeeded` status. Otherwise, it will transition to the `requires_action` status and suggest additional actions via `next_action`. + /// If setup fails, the SetupIntent will transition to the `requires_payment_method` status or the `canceled` status if the confirmation limit is reached. + pub fn send( + &self, + client: &stripe::Client, + intent: &str, + ) -> stripe::Response { + client.send_form( + &format!("/setup_intents/{intent}/confirm"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelSetupIntent<'a> { + /// Reason for canceling this SetupIntent. + /// + /// Possible values are: `abandoned`, `requested_by_customer`, or `duplicate`. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelSetupIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Reason for canceling this SetupIntent. +/// +/// Possible values are: `abandoned`, `requested_by_customer`, or `duplicate`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CancelSetupIntentCancellationReason { + Abandoned, + Duplicate, + RequestedByCustomer, +} +impl CancelSetupIntentCancellationReason { + pub fn as_str(self) -> &'static str { + use CancelSetupIntentCancellationReason::*; + match self { + Abandoned => "abandoned", + Duplicate => "duplicate", + RequestedByCustomer => "requested_by_customer", + } + } +} + +impl std::str::FromStr for CancelSetupIntentCancellationReason { + type Err = (); + fn from_str(s: &str) -> Result { + use CancelSetupIntentCancellationReason::*; + match s { + "abandoned" => Ok(Abandoned), + "duplicate" => Ok(Duplicate), + "requested_by_customer" => Ok(RequestedByCustomer), + _ => Err(()), + } + } +} +impl AsRef for CancelSetupIntentCancellationReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CancelSetupIntentCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CancelSetupIntentCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CancelSetupIntentCancellationReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CancelSetupIntent<'a> { + /// You can cancel a SetupIntent object when it’s in one of these statuses: `requires_payment_method`, `requires_confirmation`, or `requires_action`. + /// + /// After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. + pub fn send( + &self, + client: &stripe::Client, + intent: &str, + ) -> stripe::Response { + client.send_form(&format!("/setup_intents/{intent}/cancel"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct VerifyMicrodepositsSetupIntent<'a> { + /// Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub amounts: Option<&'a [i64]>, + /// A six-character code starting with SM present in the microdeposit sent to the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub descriptor_code: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> VerifyMicrodepositsSetupIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> VerifyMicrodepositsSetupIntent<'a> { + /// Verifies microdeposits on a SetupIntent object. + pub fn send( + &self, + client: &stripe::Client, + intent: &str, + ) -> stripe::Response { + client.send_form( + &format!("/setup_intents/{intent}/verify_microdeposits"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_core/src/setup_intent_next_action/mod.rs b/generated/stripe_core/src/setup_intent_next_action/mod.rs new file mode 100644 index 000000000..caa08f603 --- /dev/null +++ b/generated/stripe_core/src/setup_intent_next_action/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_intent_next_action::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_intent_next_action_redirect_to_url/mod.rs b/generated/stripe_core/src/setup_intent_next_action_redirect_to_url/mod.rs new file mode 100644 index 000000000..f9b68ad68 --- /dev/null +++ b/generated/stripe_core/src/setup_intent_next_action_redirect_to_url/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_intent_next_action_redirect_to_url::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_intent_next_action_verify_with_microdeposits/mod.rs b/generated/stripe_core/src/setup_intent_next_action_verify_with_microdeposits/mod.rs new file mode 100644 index 000000000..60d90f68a --- /dev/null +++ b/generated/stripe_core/src/setup_intent_next_action_verify_with_microdeposits/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_intent_next_action_verify_with_microdeposits::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_intent_payment_method_options/mod.rs b/generated/stripe_core/src/setup_intent_payment_method_options/mod.rs new file mode 100644 index 000000000..e25e99c63 --- /dev/null +++ b/generated/stripe_core/src/setup_intent_payment_method_options/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_intent_payment_method_options::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_intent_payment_method_options_acss_debit/mod.rs b/generated/stripe_core/src/setup_intent_payment_method_options_acss_debit/mod.rs new file mode 100644 index 000000000..412071261 --- /dev/null +++ b/generated/stripe_core/src/setup_intent_payment_method_options_acss_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_intent_payment_method_options_acss_debit::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_intent_payment_method_options_card/mod.rs b/generated/stripe_core/src/setup_intent_payment_method_options_card/mod.rs new file mode 100644 index 000000000..84c0f7b28 --- /dev/null +++ b/generated/stripe_core/src/setup_intent_payment_method_options_card/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_intent_payment_method_options_card::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_intent_payment_method_options_card_mandate_options/mod.rs b/generated/stripe_core/src/setup_intent_payment_method_options_card_mandate_options/mod.rs new file mode 100644 index 000000000..7b6d8c11f --- /dev/null +++ b/generated/stripe_core/src/setup_intent_payment_method_options_card_mandate_options/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_intent_payment_method_options_card_mandate_options::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_intent_payment_method_options_link/mod.rs b/generated/stripe_core/src/setup_intent_payment_method_options_link/mod.rs new file mode 100644 index 000000000..147b48f82 --- /dev/null +++ b/generated/stripe_core/src/setup_intent_payment_method_options_link/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_intent_payment_method_options_link::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_intent_payment_method_options_mandate_options_acss_debit/mod.rs b/generated/stripe_core/src/setup_intent_payment_method_options_mandate_options_acss_debit/mod.rs new file mode 100644 index 000000000..785e28555 --- /dev/null +++ b/generated/stripe_core/src/setup_intent_payment_method_options_mandate_options_acss_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_intent_payment_method_options_mandate_options_acss_debit::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_intent_payment_method_options_mandate_options_sepa_debit/mod.rs b/generated/stripe_core/src/setup_intent_payment_method_options_mandate_options_sepa_debit/mod.rs new file mode 100644 index 000000000..b2e18bf3d --- /dev/null +++ b/generated/stripe_core/src/setup_intent_payment_method_options_mandate_options_sepa_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_intent_payment_method_options_mandate_options_sepa_debit::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_intent_payment_method_options_paypal/mod.rs b/generated/stripe_core/src/setup_intent_payment_method_options_paypal/mod.rs new file mode 100644 index 000000000..18f069dac --- /dev/null +++ b/generated/stripe_core/src/setup_intent_payment_method_options_paypal/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_intent_payment_method_options_paypal::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_intent_payment_method_options_sepa_debit/mod.rs b/generated/stripe_core/src/setup_intent_payment_method_options_sepa_debit/mod.rs new file mode 100644 index 000000000..f30cc2e83 --- /dev/null +++ b/generated/stripe_core/src/setup_intent_payment_method_options_sepa_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_intent_payment_method_options_sepa_debit::*; \ No newline at end of file diff --git a/generated/stripe_core/src/setup_intent_payment_method_options_us_bank_account/mod.rs b/generated/stripe_core/src/setup_intent_payment_method_options_us_bank_account/mod.rs new file mode 100644 index 000000000..55b9280c7 --- /dev/null +++ b/generated/stripe_core/src/setup_intent_payment_method_options_us_bank_account/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::setup_intent_payment_method_options_us_bank_account::*; \ No newline at end of file diff --git a/generated/stripe_core/src/tax_deducted_at_source/mod.rs b/generated/stripe_core/src/tax_deducted_at_source/mod.rs new file mode 100644 index 000000000..43216e4b2 --- /dev/null +++ b/generated/stripe_core/src/tax_deducted_at_source/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::tax_deducted_at_source::*; \ No newline at end of file diff --git a/generated/stripe_core/src/three_d_secure_details/mod.rs b/generated/stripe_core/src/three_d_secure_details/mod.rs new file mode 100644 index 000000000..19b0044a2 --- /dev/null +++ b/generated/stripe_core/src/three_d_secure_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::three_d_secure_details::*; \ No newline at end of file diff --git a/generated/stripe_core/src/token/mod.rs b/generated/stripe_core/src/token/mod.rs new file mode 100644 index 000000000..430941105 --- /dev/null +++ b/generated/stripe_core/src/token/mod.rs @@ -0,0 +1,43 @@ +/// Tokenization is the process Stripe uses to collect sensitive card or bank +/// account details, or personally identifiable information (PII), directly from +/// your customers in a secure manner. +/// +/// A token representing this information is returned to your server to use. +/// Use our [recommended payments integrations](https://stripe.com/docs/payments) to perform this process on the client-side. +/// This guarantees that no sensitive card data touches your server, and allows your integration to operate in a PCI-compliant way. If you can't use client-side tokenization, you can also create tokens using the API with either your publishable or secret API key. +/// If your integration uses this method, you're responsible for any PCI compliance that it might require, and you must keep your secret API key safe. +/// Unlike with client-side tokenization, your customer's information isn't sent directly to Stripe, so we can't determine how it's handled or stored. You can't store or use tokens more than once. +/// To store card or bank account information for later use, create [Customer](https://stripe.com/docs/api#customers) objects or [Custom accounts](https://stripe.com/docs/api#external_accounts). [Radar](https://stripe.com/docs/radar), our integrated solution for automatic fraud protection, performs best with integrations that use client-side tokenization. For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Token { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_account: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + /// IP address of the client that generates the token. + pub client_ip: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Unique identifier for the object. + pub id: stripe_core::token::TokenId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Type of the token: `account`, `bank_account`, `card`, or `pii`. + #[serde(rename = "type")] + pub type_: String, + /// Determines if you have already used this token (you can only use tokens once). + pub used: bool, +} +impl stripe_types::Object for Token { + type Id = stripe_core::token::TokenId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TokenId); +#[cfg(feature = "token")] +mod requests; +#[cfg(feature = "token")] +pub use requests::*; diff --git a/generated/stripe_core/src/token/requests.rs b/generated/stripe_core/src/token/requests.rs new file mode 100644 index 000000000..fe277cc54 --- /dev/null +++ b/generated/stripe_core/src/token/requests.rs @@ -0,0 +1,1465 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveToken<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveToken<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveToken<'a> { + /// Retrieves the token with the given ID. + pub fn send( + &self, + client: &stripe::Client, + token: &stripe_core::token::TokenId, + ) -> stripe::Response { + client.get_query(&format!("/tokens/{token}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateToken<'a> { + /// Information for the account this token represents. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option>, + /// The bank account this token will represent. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_account: Option>, + /// The card this token will represent. + /// + /// If you also pass in a customer, the card must be the ID of a card belonging to the customer. + /// Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// Create a token for the customer, which is owned by the application's account. + /// + /// You can only use this with an [OAuth access token](https://stripe.com/docs/connect/standard-accounts) or [Stripe-Account header](https://stripe.com/docs/connect/authentication). + /// Learn more about [cloning saved payment methods](https://stripe.com/docs/connect/cloning-saved-payment-methods). + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// The updated CVC value this token represents. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc_update: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Information for the person this token represents. + #[serde(skip_serializing_if = "Option::is_none")] + pub person: Option>, + /// The PII this token represents. + #[serde(skip_serializing_if = "Option::is_none")] + pub pii: Option>, +} +impl<'a> CreateToken<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information for the account this token represents. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccount<'a> { + /// The business type. + #[serde(skip_serializing_if = "Option::is_none")] + pub business_type: Option, + /// Information about the company or business. + #[serde(skip_serializing_if = "Option::is_none")] + pub company: Option>, + /// Information about the person represented by the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub individual: Option>, + /// Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/docs/connect/account-tokens#stripe-connected-account-agreement). + /// + /// When creating an account token to create a new Connect account, this value must be `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_shown_and_accepted: Option, +} +impl<'a> CreateTokenAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The business type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTokenAccountBusinessType { + Company, + GovernmentEntity, + Individual, + NonProfit, +} +impl CreateTokenAccountBusinessType { + pub fn as_str(self) -> &'static str { + use CreateTokenAccountBusinessType::*; + match self { + Company => "company", + GovernmentEntity => "government_entity", + Individual => "individual", + NonProfit => "non_profit", + } + } +} + +impl std::str::FromStr for CreateTokenAccountBusinessType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTokenAccountBusinessType::*; + match s { + "company" => Ok(Company), + "government_entity" => Ok(GovernmentEntity), + "individual" => Ok(Individual), + "non_profit" => Ok(NonProfit), + _ => Err(()), + } + } +} +impl AsRef for CreateTokenAccountBusinessType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTokenAccountBusinessType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTokenAccountBusinessType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTokenAccountBusinessType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about the company or business. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountCompany<'a> { + /// The company's primary address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the company's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the company's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// Whether the company's directors have been provided. + /// + /// Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. + /// This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub directors_provided: Option, + /// Whether the company's executives have been provided. + /// + /// Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. + #[serde(skip_serializing_if = "Option::is_none")] + pub executives_provided: Option, + /// The export license ID number of the company, also referred as Import Export Code (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_license_id: Option<&'a str>, + /// The purpose code to use for export transactions (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_purpose_code: Option<&'a str>, + /// The company's legal name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// The Kana variation of the company's legal name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub name_kana: Option<&'a str>, + /// The Kanji variation of the company's legal name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub name_kanji: Option<&'a str>, + /// Whether the company's owners have been provided. + /// + /// Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. + #[serde(skip_serializing_if = "Option::is_none")] + pub owners_provided: Option, + /// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. + #[serde(skip_serializing_if = "Option::is_none")] + pub ownership_declaration: Option>, + /// Whether the user described by the data in the token has been shown the Ownership Declaration and indicated that it is correct. + #[serde(skip_serializing_if = "Option::is_none")] + pub ownership_declaration_shown_and_signed: Option, + /// The company's phone number (used for verification). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. + /// + /// (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). + #[serde(skip_serializing_if = "Option::is_none")] + pub registration_number: Option<&'a str>, + /// The category identifying the legal structure of the company or legal entity. + /// + /// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub structure: Option, + /// The business ID number of the company, as appropriate for the company’s country. + /// + /// (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.). + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id: Option<&'a str>, + /// The jurisdiction in which the `tax_id` is registered (Germany-based companies only). + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_registrar: Option<&'a str>, + /// The VAT number of the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub vat_id: Option<&'a str>, + /// Information on the verification state of the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> CreateTokenAccountCompany<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The company's primary address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountCompanyAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateTokenAccountCompanyAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the company's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountCompanyAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateTokenAccountCompanyAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the company's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountCompanyAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateTokenAccountCompanyAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountCompanyOwnershipDeclaration<'a> { + /// The Unix timestamp marking when the beneficial owner attestation was made. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the beneficial owner attestation was made. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the beneficial owner attestation was made. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> CreateTokenAccountCompanyOwnershipDeclaration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The category identifying the legal structure of the company or legal entity. +/// +/// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateTokenAccountCompanyStructure { + FreeZoneEstablishment, + FreeZoneLlc, + GovernmentInstrumentality, + GovernmentalUnit, + IncorporatedNonProfit, + IncorporatedPartnership, + LimitedLiabilityPartnership, + Llc, + MultiMemberLlc, + PrivateCompany, + PrivateCorporation, + PrivatePartnership, + PublicCompany, + PublicCorporation, + PublicPartnership, + SingleMemberLlc, + SoleEstablishment, + SoleProprietorship, + TaxExemptGovernmentInstrumentality, + UnincorporatedAssociation, + UnincorporatedNonProfit, + UnincorporatedPartnership, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateTokenAccountCompanyStructure { + pub fn as_str(self) -> &'static str { + use CreateTokenAccountCompanyStructure::*; + match self { + FreeZoneEstablishment => "free_zone_establishment", + FreeZoneLlc => "free_zone_llc", + GovernmentInstrumentality => "government_instrumentality", + GovernmentalUnit => "governmental_unit", + IncorporatedNonProfit => "incorporated_non_profit", + IncorporatedPartnership => "incorporated_partnership", + LimitedLiabilityPartnership => "limited_liability_partnership", + Llc => "llc", + MultiMemberLlc => "multi_member_llc", + PrivateCompany => "private_company", + PrivateCorporation => "private_corporation", + PrivatePartnership => "private_partnership", + PublicCompany => "public_company", + PublicCorporation => "public_corporation", + PublicPartnership => "public_partnership", + SingleMemberLlc => "single_member_llc", + SoleEstablishment => "sole_establishment", + SoleProprietorship => "sole_proprietorship", + TaxExemptGovernmentInstrumentality => "tax_exempt_government_instrumentality", + UnincorporatedAssociation => "unincorporated_association", + UnincorporatedNonProfit => "unincorporated_non_profit", + UnincorporatedPartnership => "unincorporated_partnership", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateTokenAccountCompanyStructure { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTokenAccountCompanyStructure::*; + match s { + "free_zone_establishment" => Ok(FreeZoneEstablishment), + "free_zone_llc" => Ok(FreeZoneLlc), + "government_instrumentality" => Ok(GovernmentInstrumentality), + "governmental_unit" => Ok(GovernmentalUnit), + "incorporated_non_profit" => Ok(IncorporatedNonProfit), + "incorporated_partnership" => Ok(IncorporatedPartnership), + "limited_liability_partnership" => Ok(LimitedLiabilityPartnership), + "llc" => Ok(Llc), + "multi_member_llc" => Ok(MultiMemberLlc), + "private_company" => Ok(PrivateCompany), + "private_corporation" => Ok(PrivateCorporation), + "private_partnership" => Ok(PrivatePartnership), + "public_company" => Ok(PublicCompany), + "public_corporation" => Ok(PublicCorporation), + "public_partnership" => Ok(PublicPartnership), + "single_member_llc" => Ok(SingleMemberLlc), + "sole_establishment" => Ok(SoleEstablishment), + "sole_proprietorship" => Ok(SoleProprietorship), + "tax_exempt_government_instrumentality" => Ok(TaxExemptGovernmentInstrumentality), + "unincorporated_association" => Ok(UnincorporatedAssociation), + "unincorporated_non_profit" => Ok(UnincorporatedNonProfit), + "unincorporated_partnership" => Ok(UnincorporatedPartnership), + _ => Err(()), + } + } +} +impl AsRef for CreateTokenAccountCompanyStructure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTokenAccountCompanyStructure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTokenAccountCompanyStructure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTokenAccountCompanyStructure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information on the verification state of the company. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountCompanyVerification<'a> { + /// A document verifying the business. + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> CreateTokenAccountCompanyVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A document verifying the business. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountCompanyVerificationDocument<'a> { + /// The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> CreateTokenAccountCompanyVerificationDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about the person represented by the account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountIndividual<'a> { + /// The individual's primary address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the the individual's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the the individual's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// The individual's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, + /// The individual's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// The individual's first name. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option<&'a str>, + /// The Kana variation of the the individual's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kana: Option<&'a str>, + /// The Kanji variation of the individual's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kanji: Option<&'a str>, + /// A list of alternate names or aliases that the individual is known by. + #[serde(skip_serializing_if = "Option::is_none")] + pub full_name_aliases: Option<&'a [&'a str]>, + /// The individual's gender (International regulations require either "male" or "female"). + #[serde(skip_serializing_if = "Option::is_none")] + pub gender: Option<&'a str>, + /// The government-issued ID number of the individual, as appropriate for the representative's country. + /// + /// (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). + /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option<&'a str>, + /// The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. + /// + /// In Thailand, this would be the laser code found on the back of an ID card. + /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number_secondary: Option<&'a str>, + /// The individual's last name. + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option<&'a str>, + /// The Kana variation of the individual's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kana: Option<&'a str>, + /// The Kanji variation of the individual's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kanji: Option<&'a str>, + /// The individual's maiden name. + #[serde(skip_serializing_if = "Option::is_none")] + pub maiden_name: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The individual's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + #[serde(skip_serializing_if = "Option::is_none")] + pub political_exposure: Option, + /// The individual's registered address. + #[serde(skip_serializing_if = "Option::is_none")] + pub registered_address: Option>, + /// The last four digits of the individual's Social Security Number (U.S. + /// + /// only). + #[serde(skip_serializing_if = "Option::is_none")] + pub ssn_last_4: Option<&'a str>, + /// The individual's verification document information. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> CreateTokenAccountIndividual<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The individual's primary address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountIndividualAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateTokenAccountIndividualAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the the individual's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountIndividualAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateTokenAccountIndividualAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the the individual's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountIndividualAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateTokenAccountIndividualAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The individual's date of birth. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTokenAccountIndividualDob { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl CreateTokenAccountIndividualDob { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +/// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTokenAccountIndividualPoliticalExposure { + Existing, + None, +} +impl CreateTokenAccountIndividualPoliticalExposure { + pub fn as_str(self) -> &'static str { + use CreateTokenAccountIndividualPoliticalExposure::*; + match self { + Existing => "existing", + None => "none", + } + } +} + +impl std::str::FromStr for CreateTokenAccountIndividualPoliticalExposure { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTokenAccountIndividualPoliticalExposure::*; + match s { + "existing" => Ok(Existing), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateTokenAccountIndividualPoliticalExposure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTokenAccountIndividualPoliticalExposure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTokenAccountIndividualPoliticalExposure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTokenAccountIndividualPoliticalExposure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The individual's registered address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountIndividualRegisteredAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateTokenAccountIndividualRegisteredAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The individual's verification document information. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountIndividualVerification<'a> { + /// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_document: Option>, + /// An identifying document, either a passport or local ID card. + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> CreateTokenAccountIndividualVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountIndividualVerificationAdditionalDocument<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> CreateTokenAccountIndividualVerificationAdditionalDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An identifying document, either a passport or local ID card. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountIndividualVerificationDocument<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> CreateTokenAccountIndividualVerificationDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The bank account this token will represent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTokenBankAccount<'a> { + /// The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_name: Option<&'a str>, + /// The type of entity that holds the account. + /// + /// It can be `company` or `individual`. + /// This field is required when attaching the bank account to a `Customer` object. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The account number for the bank account, in string form. + /// + /// Must be a checking account. + pub account_number: &'a str, + /// The bank account type. + /// + /// This can only be `checking` or `savings` in most countries. + /// In Japan, this can only be `futsu` or `toza`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// The country in which the bank account is located. + pub country: &'a str, + /// The currency the bank account is in. + /// + /// This must be a country/currency pairing that [Stripe supports.](https://stripe.com/docs/payouts). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The routing number, sort code, or other country-appropriateinstitution number for the bank account. + /// + /// For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. + /// If you are providing an IBAN for`account_number`, this field is not required. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> CreateTokenBankAccount<'a> { + pub fn new(account_number: &'a str, country: &'a str) -> Self { + Self { + account_holder_name: Default::default(), + account_holder_type: Default::default(), + account_number, + account_type: Default::default(), + country, + currency: Default::default(), + routing_number: Default::default(), + } + } +} +/// The type of entity that holds the account. +/// +/// It can be `company` or `individual`. +/// This field is required when attaching the bank account to a `Customer` object. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTokenBankAccountAccountHolderType { + Company, + Individual, +} +impl CreateTokenBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreateTokenBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreateTokenBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTokenBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for CreateTokenBankAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTokenBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTokenBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTokenBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The bank account type. +/// +/// This can only be `checking` or `savings` in most countries. +/// In Japan, this can only be `futsu` or `toza`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTokenBankAccountAccountType { + Checking, + Futsu, + Savings, + Toza, +} +impl CreateTokenBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use CreateTokenBankAccountAccountType::*; + match self { + Checking => "checking", + Futsu => "futsu", + Savings => "savings", + Toza => "toza", + } + } +} + +impl std::str::FromStr for CreateTokenBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTokenBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "futsu" => Ok(Futsu), + "savings" => Ok(Savings), + "toza" => Ok(Toza), + _ => Err(()), + } + } +} +impl AsRef for CreateTokenBankAccountAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTokenBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTokenBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTokenBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The card this token will represent. +/// +/// If you also pass in a customer, the card must be the ID of a card belonging to the customer. +/// Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreateTokenCard<'a> { + CreditCardSpecs(CreateTokenCreditCardSpecs<'a>), + Str(&'a str), +} +/// The card this token will represent. +/// +/// If you also pass in a customer, the card must be the ID of a card belonging to the customer. +/// Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTokenCreditCardSpecs<'a> { + /// City / District / Suburb / Town / Village. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_city: Option<&'a str>, + /// Billing address country, if provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_country: Option<&'a str>, + /// Address line 1 (Street address / PO Box / Company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1: Option<&'a str>, + /// Address line 2 (Apartment / Suite / Unit / Building). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line2: Option<&'a str>, + /// State / County / Province / Region. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_state: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_zip: Option<&'a str>, + /// Required in order to add the card to an account; in all other cases, this parameter is not used. + /// + /// When added to an account, the card (which must be a debit card) can be used as a transfer destination for funds in this currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Card security code. + /// + /// Highly recommended to always include this value. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc: Option<&'a str>, + /// Two-digit number representing the card's expiration month. + pub exp_month: &'a str, + /// Two- or four-digit number representing the card's expiration year. + pub exp_year: &'a str, + /// Cardholder's full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// The card number, as a string without any separators. + pub number: &'a str, +} +impl<'a> CreateTokenCreditCardSpecs<'a> { + pub fn new(exp_month: &'a str, exp_year: &'a str, number: &'a str) -> Self { + Self { + address_city: Default::default(), + address_country: Default::default(), + address_line1: Default::default(), + address_line2: Default::default(), + address_state: Default::default(), + address_zip: Default::default(), + currency: Default::default(), + cvc: Default::default(), + exp_month, + exp_year, + name: Default::default(), + number, + } + } +} +/// The updated CVC value this token represents. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTokenCvcUpdate<'a> { + /// The CVC value, in string form. + pub cvc: &'a str, +} +impl<'a> CreateTokenCvcUpdate<'a> { + pub fn new(cvc: &'a str) -> Self { + Self { cvc } + } +} +/// Information for the person this token represents. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPerson<'a> { + /// Details on the legal guardian's acceptance of the required Stripe agreements. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_tos_acceptances: Option>, + /// The person's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the person's address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the person's address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// The person's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, + /// Documents that may be submitted to satisfy various informational requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub documents: Option>, + /// The person's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// The person's first name. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option<&'a str>, + /// The Kana variation of the person's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kana: Option<&'a str>, + /// The Kanji variation of the person's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kanji: Option<&'a str>, + /// A list of alternate names or aliases that the person is known by. + #[serde(skip_serializing_if = "Option::is_none")] + pub full_name_aliases: Option<&'a [&'a str]>, + /// The person's gender (International regulations require either "male" or "female"). + #[serde(skip_serializing_if = "Option::is_none")] + pub gender: Option<&'a str>, + /// The person's ID number, as appropriate for their country. + /// + /// For example, a social security number in the U.S., social insurance number in Canada, etc. + /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option<&'a str>, + /// The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. + /// + /// In Thailand, this would be the laser code found on the back of an ID card. + /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number_secondary: Option<&'a str>, + /// The person's last name. + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option<&'a str>, + /// The Kana variation of the person's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kana: Option<&'a str>, + /// The Kanji variation of the person's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kanji: Option<&'a str>, + /// The person's maiden name. + #[serde(skip_serializing_if = "Option::is_none")] + pub maiden_name: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The country where the person is a national. + /// + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. + #[serde(skip_serializing_if = "Option::is_none")] + pub nationality: Option<&'a str>, + /// The person's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + #[serde(skip_serializing_if = "Option::is_none")] + pub political_exposure: Option<&'a str>, + /// The person's registered address. + #[serde(skip_serializing_if = "Option::is_none")] + pub registered_address: Option>, + /// The relationship that this person has with the account's legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub relationship: Option>, + /// The last four digits of the person's Social Security number (U.S. + /// + /// only). + #[serde(skip_serializing_if = "Option::is_none")] + pub ssn_last_4: Option<&'a str>, + /// The person's verification status. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> CreateTokenPerson<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on the legal guardian's acceptance of the required Stripe agreements. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonAdditionalTosAcceptances<'a> { + /// Details on the legal guardian's acceptance of the main Stripe service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option>, +} +impl<'a> CreateTokenPersonAdditionalTosAcceptances<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on the legal guardian's acceptance of the main Stripe service agreement. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonAdditionalTosAcceptancesAccount<'a> { + /// The Unix timestamp marking when the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> CreateTokenPersonAdditionalTosAcceptancesAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The person's address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateTokenPersonAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the person's address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateTokenPersonAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the person's address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateTokenPersonAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The person's date of birth. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTokenPersonDob { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl CreateTokenPersonDob { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +/// Documents that may be submitted to satisfy various informational requests. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonDocuments<'a> { + /// One or more documents that demonstrate proof that this person is authorized to represent the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_authorization: Option>, + /// One or more documents showing the person's passport page with photo and personal data. + #[serde(skip_serializing_if = "Option::is_none")] + pub passport: Option>, + /// One or more documents showing the person's visa required for living in the country where they are residing. + #[serde(skip_serializing_if = "Option::is_none")] + pub visa: Option>, +} +impl<'a> CreateTokenPersonDocuments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents that demonstrate proof that this person is authorized to represent the company. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonDocumentsCompanyAuthorization<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> CreateTokenPersonDocumentsCompanyAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents showing the person's passport page with photo and personal data. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonDocumentsPassport<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> CreateTokenPersonDocumentsPassport<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents showing the person's visa required for living in the country where they are residing. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonDocumentsVisa<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> CreateTokenPersonDocumentsVisa<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The person's registered address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonRegisteredAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateTokenPersonRegisteredAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The relationship that this person has with the account's legal entity. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonRelationship<'a> { + /// Whether the person is a director of the account's legal entity. + /// + /// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + #[serde(skip_serializing_if = "Option::is_none")] + pub director: Option, + /// Whether the person has significant responsibility to control, manage, or direct the organization. + #[serde(skip_serializing_if = "Option::is_none")] + pub executive: Option, + /// Whether the person is the legal guardian of the account's representative. + #[serde(skip_serializing_if = "Option::is_none")] + pub legal_guardian: Option, + /// Whether the person is an owner of the account’s legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option, + /// The percent owned by the person of the account's legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub percent_ownership: Option, + /// Whether the person is authorized as the primary representative of the account. + /// + /// This is the person nominated by the business to provide information about themselves, and general information about the account. + /// There can only be one representative at any given time. + /// At the time the account is created, this person should be set to the person responsible for opening the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub representative: Option, + /// The person's title (e.g., CEO, Support Engineer). + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option<&'a str>, +} +impl<'a> CreateTokenPersonRelationship<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The person's verification status. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonVerification<'a> { + /// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_document: Option>, + /// An identifying document, either a passport or local ID card. + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> CreateTokenPersonVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonVerificationAdditionalDocument<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> CreateTokenPersonVerificationAdditionalDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An identifying document, either a passport or local ID card. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonVerificationDocument<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> CreateTokenPersonVerificationDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The PII this token represents. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPii<'a> { + /// The `id_number` for the PII, in string form. + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option<&'a str>, +} +impl<'a> CreateTokenPii<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateToken<'a> { + /// Creates a single-use token that represents a bank account’s details. + /// You can use this token with any API method in place of a bank account dictionary. + /// + /// You can only use this token once. + /// To do so, attach it to a [Custom account](https://stripe.com/docs/api#accounts). + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/tokens", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_fraud/Cargo.toml b/generated/stripe_fraud/Cargo.toml new file mode 100644 index 000000000..ec06b5222 --- /dev/null +++ b/generated/stripe_fraud/Cargo.toml @@ -0,0 +1,47 @@ +[package] +name = "stripe_fraud" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + +[dependencies] +serde.workspace = true +http-types.workspace = true +smol_str.workspace = true +serde_json.workspace = true +async-stripe = {path = "../../async-stripe"} + +stripe_types = {path = "../../stripe_types"} + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +radar_early_fraud_warning = [] +radar_list_list = [] +radar_list_list_item = [] +radar_review = [] + +full = ["radar_early_fraud_warning", +"radar_list_list", +"radar_list_list_item", +"radar_review"] + diff --git a/generated/stripe_fraud/src/mod.rs b/generated/stripe_fraud/src/mod.rs new file mode 100644 index 000000000..326c574cc --- /dev/null +++ b/generated/stripe_fraud/src/mod.rs @@ -0,0 +1,19 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::invalid_html_tags)] +extern crate self as stripe_fraud; +pub mod radar_list_deleted_list; +pub use radar_list_deleted_list::RadarListDeletedList; +pub mod radar_list_deleted_list_item; +pub use radar_list_deleted_list_item::RadarListDeletedListItem; +pub mod radar_early_fraud_warning; +pub use radar_early_fraud_warning::RadarEarlyFraudWarning; +pub mod radar_list_list; +pub use radar_list_list::RadarListList; +pub mod radar_list_list_item; +pub use radar_list_list_item::RadarListListItem; +pub use stripe_types::RadarReview; +pub use stripe_types::RadarReviewResourceLocation; +pub use stripe_types::RadarReviewResourceSession; +pub mod radar_review; +pub use stripe_types::RadarRule; diff --git a/generated/stripe_fraud/src/radar_early_fraud_warning/mod.rs b/generated/stripe_fraud/src/radar_early_fraud_warning/mod.rs new file mode 100644 index 000000000..6e9b8ed35 --- /dev/null +++ b/generated/stripe_fraud/src/radar_early_fraud_warning/mod.rs @@ -0,0 +1,39 @@ +/// An early fraud warning indicates that the card issuer has notified us that a +/// charge may be fraudulent. +/// +/// Related guide: [Early fraud warnings](https://stripe.com/docs/disputes/measuring#early-fraud-warnings). +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct RadarEarlyFraudWarning { + /// An EFW is actionable if it has not received a dispute and has not been fully refunded. + /// + /// You may wish to proactively refund a charge that receives an EFW, in order to avoid receiving a dispute later. + pub actionable: bool, + /// ID of the charge this early fraud warning is for, optionally expanded. + pub charge: stripe_types::Expandable, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The type of fraud labelled by the issuer. + /// + /// One of `card_never_received`, `fraudulent_card_application`, `made_with_counterfeit_card`, `made_with_lost_card`, `made_with_stolen_card`, `misc`, `unauthorized_use_of_card`. + pub fraud_type: String, + /// Unique identifier for the object. + pub id: stripe_fraud::radar_early_fraud_warning::RadarEarlyFraudWarningId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// ID of the Payment Intent this early fraud warning is for, optionally expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option>, +} +impl stripe_types::Object for RadarEarlyFraudWarning { + type Id = stripe_fraud::radar_early_fraud_warning::RadarEarlyFraudWarningId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(RadarEarlyFraudWarningId); +#[cfg(feature = "radar_early_fraud_warning")] +mod requests; +#[cfg(feature = "radar_early_fraud_warning")] +pub use requests::*; diff --git a/generated/stripe_fraud/src/radar_early_fraud_warning/requests.rs b/generated/stripe_fraud/src/radar_early_fraud_warning/requests.rs new file mode 100644 index 000000000..2a0f1cff8 --- /dev/null +++ b/generated/stripe_fraud/src/radar_early_fraud_warning/requests.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListRadarEarlyFraudWarning<'a> { + /// Only return early fraud warnings for the charge specified by this charge ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub charge: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return early fraud warnings for charges that were created by the PaymentIntent specified by this PaymentIntent ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListRadarEarlyFraudWarning<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListRadarEarlyFraudWarning<'a> { + /// Returns a list of early fraud warnings. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/radar/early_fraud_warnings", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/radar/early_fraud_warnings", self) + } +} +impl<'a> stripe::PaginationParams for ListRadarEarlyFraudWarning<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveRadarEarlyFraudWarning<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveRadarEarlyFraudWarning<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveRadarEarlyFraudWarning<'a> { + /// Retrieves the details of an early fraud warning that has previously been created. + /// + /// Please refer to the [early fraud warning](https://stripe.com/docs/api#early_fraud_warning_object) object reference for more details. + pub fn send( + &self, + client: &stripe::Client, + early_fraud_warning: &str, + ) -> stripe::Response { + client.get_query(&format!("/radar/early_fraud_warnings/{early_fraud_warning}"), self) + } +} diff --git a/generated/stripe_fraud/src/radar_list_deleted_list/mod.rs b/generated/stripe_fraud/src/radar_list_deleted_list/mod.rs new file mode 100644 index 000000000..0a31711dd --- /dev/null +++ b/generated/stripe_fraud/src/radar_list_deleted_list/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct RadarListDeletedList { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_fraud::radar_list_list::RadarValueListId, +} +impl stripe_types::Object for RadarListDeletedList { + type Id = stripe_fraud::radar_list_list::RadarValueListId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/generated/stripe_fraud/src/radar_list_deleted_list_item/mod.rs b/generated/stripe_fraud/src/radar_list_deleted_list_item/mod.rs new file mode 100644 index 000000000..10f7b00ca --- /dev/null +++ b/generated/stripe_fraud/src/radar_list_deleted_list_item/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct RadarListDeletedListItem { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_fraud::radar_list_list_item::RadarValueListItemId, +} +impl stripe_types::Object for RadarListDeletedListItem { + type Id = stripe_fraud::radar_list_list_item::RadarValueListItemId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/generated/stripe_fraud/src/radar_list_list/mod.rs b/generated/stripe_fraud/src/radar_list_list/mod.rs new file mode 100644 index 000000000..2e4dd8220 --- /dev/null +++ b/generated/stripe_fraud/src/radar_list_list/mod.rs @@ -0,0 +1,128 @@ +/// Value lists allow you to group values together which can then be referenced in rules. +/// +/// Related guide: [Default Stripe lists](https://stripe.com/docs/radar/lists#managing-list-items) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct RadarListList { + /// The name of the value list for use in rules. + pub alias: String, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The name or email address of the user who created this value list. + pub created_by: String, + /// Unique identifier for the object. + pub id: stripe_fraud::radar_list_list::RadarValueListId, + /// The type of items in the value list. + /// + /// One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. + pub item_type: RadarListListItemType, + /// List of items contained within this value list. + pub list_items: stripe_types::List, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The name of the value list. + pub name: String, +} +/// The type of items in the value list. +/// +/// One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum RadarListListItemType { + CardBin, + CardFingerprint, + CaseSensitiveString, + Country, + CustomerId, + Email, + IpAddress, + SepaDebitFingerprint, + String, + UsBankAccountFingerprint, +} +impl RadarListListItemType { + pub fn as_str(self) -> &'static str { + use RadarListListItemType::*; + match self { + CardBin => "card_bin", + CardFingerprint => "card_fingerprint", + CaseSensitiveString => "case_sensitive_string", + Country => "country", + CustomerId => "customer_id", + Email => "email", + IpAddress => "ip_address", + SepaDebitFingerprint => "sepa_debit_fingerprint", + String => "string", + UsBankAccountFingerprint => "us_bank_account_fingerprint", + } + } +} + +impl std::str::FromStr for RadarListListItemType { + type Err = (); + fn from_str(s: &str) -> Result { + use RadarListListItemType::*; + match s { + "card_bin" => Ok(CardBin), + "card_fingerprint" => Ok(CardFingerprint), + "case_sensitive_string" => Ok(CaseSensitiveString), + "country" => Ok(Country), + "customer_id" => Ok(CustomerId), + "email" => Ok(Email), + "ip_address" => Ok(IpAddress), + "sepa_debit_fingerprint" => Ok(SepaDebitFingerprint), + "string" => Ok(String), + "us_bank_account_fingerprint" => Ok(UsBankAccountFingerprint), + _ => Err(()), + } + } +} +impl AsRef for RadarListListItemType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for RadarListListItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for RadarListListItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for RadarListListItemType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for RadarListListItemType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for RadarListListItemType")) + } +} +impl stripe_types::Object for RadarListList { + type Id = stripe_fraud::radar_list_list::RadarValueListId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(RadarValueListId); +#[cfg(feature = "radar_list_list")] +mod requests; +#[cfg(feature = "radar_list_list")] +pub use requests::*; diff --git a/generated/stripe_fraud/src/radar_list_list/requests.rs b/generated/stripe_fraud/src/radar_list_list/requests.rs new file mode 100644 index 000000000..37fe548e1 --- /dev/null +++ b/generated/stripe_fraud/src/radar_list_list/requests.rs @@ -0,0 +1,254 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListRadarListList<'a> { + /// The alias used to reference the value list when writing rules. + #[serde(skip_serializing_if = "Option::is_none")] + pub alias: Option<&'a str>, + /// A value contained within a value list - returns all value lists containing this value. + #[serde(skip_serializing_if = "Option::is_none")] + pub contains: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListRadarListList<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListRadarListList<'a> { + /// Returns a list of `ValueList` objects. + /// + /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/radar/value_lists", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/radar/value_lists", self) + } +} +impl<'a> stripe::PaginationParams for ListRadarListList<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveRadarListList<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveRadarListList<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveRadarListList<'a> { + /// Retrieves a `ValueList` object. + pub fn send( + &self, + client: &stripe::Client, + value_list: &str, + ) -> stripe::Response { + client.get_query(&format!("/radar/value_lists/{value_list}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateRadarListList<'a> { + /// The name of the value list for use in rules. + pub alias: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Type of the items in the value list. + /// + /// One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. + /// Use `string` if the item type is unknown or mixed. + #[serde(skip_serializing_if = "Option::is_none")] + pub item_type: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The human-readable name of the value list. + pub name: &'a str, +} +impl<'a> CreateRadarListList<'a> { + pub fn new(alias: &'a str, name: &'a str) -> Self { + Self { + alias, + expand: Default::default(), + item_type: Default::default(), + metadata: Default::default(), + name, + } + } +} +/// Type of the items in the value list. +/// +/// One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. +/// Use `string` if the item type is unknown or mixed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateRadarListListItemType { + CardBin, + CardFingerprint, + CaseSensitiveString, + Country, + CustomerId, + Email, + IpAddress, + SepaDebitFingerprint, + String, + UsBankAccountFingerprint, +} +impl CreateRadarListListItemType { + pub fn as_str(self) -> &'static str { + use CreateRadarListListItemType::*; + match self { + CardBin => "card_bin", + CardFingerprint => "card_fingerprint", + CaseSensitiveString => "case_sensitive_string", + Country => "country", + CustomerId => "customer_id", + Email => "email", + IpAddress => "ip_address", + SepaDebitFingerprint => "sepa_debit_fingerprint", + String => "string", + UsBankAccountFingerprint => "us_bank_account_fingerprint", + } + } +} + +impl std::str::FromStr for CreateRadarListListItemType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateRadarListListItemType::*; + match s { + "card_bin" => Ok(CardBin), + "card_fingerprint" => Ok(CardFingerprint), + "case_sensitive_string" => Ok(CaseSensitiveString), + "country" => Ok(Country), + "customer_id" => Ok(CustomerId), + "email" => Ok(Email), + "ip_address" => Ok(IpAddress), + "sepa_debit_fingerprint" => Ok(SepaDebitFingerprint), + "string" => Ok(String), + "us_bank_account_fingerprint" => Ok(UsBankAccountFingerprint), + _ => Err(()), + } + } +} +impl AsRef for CreateRadarListListItemType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateRadarListListItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateRadarListListItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateRadarListListItemType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateRadarListList<'a> { + /// Creates a new `ValueList` object, which can then be referenced in rules. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/radar/value_lists", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateRadarListList<'a> { + /// The name of the value list for use in rules. + #[serde(skip_serializing_if = "Option::is_none")] + pub alias: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The human-readable name of the value list. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, +} +impl<'a> UpdateRadarListList<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateRadarListList<'a> { + /// Updates a `ValueList` object by setting the values of the parameters passed. + /// + /// Any parameters not provided will be left unchanged. + /// Note that `item_type` is immutable. + pub fn send( + &self, + client: &stripe::Client, + value_list: &str, + ) -> stripe::Response { + client.send_form( + &format!("/radar/value_lists/{value_list}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteRadarListList {} +impl DeleteRadarListList { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteRadarListList { + /// Deletes a `ValueList` object, also deleting any items contained within the value list. + /// + /// To be deleted, a value list must not be referenced in any rules. + pub fn send( + &self, + client: &stripe::Client, + value_list: &str, + ) -> stripe::Response { + client.send_form( + &format!("/radar/value_lists/{value_list}"), + self, + http_types::Method::Delete, + ) + } +} diff --git a/generated/stripe_fraud/src/radar_list_list_item/mod.rs b/generated/stripe_fraud/src/radar_list_list_item/mod.rs new file mode 100644 index 000000000..ee3ef1a60 --- /dev/null +++ b/generated/stripe_fraud/src/radar_list_list_item/mod.rs @@ -0,0 +1,33 @@ +/// Value list items allow you to add specific values to a given Radar value list, which can then be used in rules. +/// +/// Related guide: [Managing list items](https://stripe.com/docs/radar/lists#managing-list-items) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct RadarListListItem { + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The name or email address of the user who added this item to the value list. + pub created_by: String, + /// Unique identifier for the object. + pub id: stripe_fraud::radar_list_list_item::RadarValueListItemId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The value of the item. + pub value: String, + /// The identifier of the value list this item belongs to. + pub value_list: String, +} +impl stripe_types::Object for RadarListListItem { + type Id = stripe_fraud::radar_list_list_item::RadarValueListItemId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(RadarValueListItemId); +#[cfg(feature = "radar_list_list_item")] +mod requests; +#[cfg(feature = "radar_list_list_item")] +pub use requests::*; diff --git a/generated/stripe_fraud/src/radar_list_list_item/requests.rs b/generated/stripe_fraud/src/radar_list_list_item/requests.rs new file mode 100644 index 000000000..67e193ee5 --- /dev/null +++ b/generated/stripe_fraud/src/radar_list_list_item/requests.rs @@ -0,0 +1,124 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListRadarListListItem<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Return items belonging to the parent list whose value matches the specified value (using an "is like" match). + #[serde(skip_serializing_if = "Option::is_none")] + pub value: Option<&'a str>, + /// Identifier for the parent value list this item belongs to. + pub value_list: &'a str, +} +impl<'a> ListRadarListListItem<'a> { + pub fn new(value_list: &'a str) -> Self { + Self { + created: Default::default(), + ending_before: Default::default(), + expand: Default::default(), + limit: Default::default(), + starting_after: Default::default(), + value: Default::default(), + value_list, + } + } +} +impl<'a> ListRadarListListItem<'a> { + /// Returns a list of `ValueListItem` objects. + /// + /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/radar/value_list_items", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/radar/value_list_items", self) + } +} +impl<'a> stripe::PaginationParams for ListRadarListListItem<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveRadarListListItem<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveRadarListListItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveRadarListListItem<'a> { + /// Retrieves a `ValueListItem` object. + pub fn send( + &self, + client: &stripe::Client, + item: &stripe_types::line_item::ItemId, + ) -> stripe::Response { + client.get_query(&format!("/radar/value_list_items/{item}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateRadarListListItem<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The value of the item (whose type must match the type of the parent value list). + pub value: &'a str, + /// The identifier of the value list which the created item will be added to. + pub value_list: &'a str, +} +impl<'a> CreateRadarListListItem<'a> { + pub fn new(value: &'a str, value_list: &'a str) -> Self { + Self { expand: Default::default(), value, value_list } + } +} +impl<'a> CreateRadarListListItem<'a> { + /// Creates a new `ValueListItem` object, which is added to the specified parent value list. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/radar/value_list_items", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteRadarListListItem {} +impl DeleteRadarListListItem { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteRadarListListItem { + /// Deletes a `ValueListItem` object, removing it from its parent value list. + pub fn send( + &self, + client: &stripe::Client, + item: &stripe_types::line_item::ItemId, + ) -> stripe::Response { + client.send_form( + &format!("/radar/value_list_items/{item}"), + self, + http_types::Method::Delete, + ) + } +} diff --git a/generated/stripe_fraud/src/radar_review/mod.rs b/generated/stripe_fraud/src/radar_review/mod.rs new file mode 100644 index 000000000..b97d002f8 --- /dev/null +++ b/generated/stripe_fraud/src/radar_review/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::radar_review::*; +#[cfg(feature = "radar_review")] +mod requests; +#[cfg(feature = "radar_review")] +pub use requests::*; diff --git a/generated/stripe_fraud/src/radar_review/requests.rs b/generated/stripe_fraud/src/radar_review/requests.rs new file mode 100644 index 000000000..5fad22136 --- /dev/null +++ b/generated/stripe_fraud/src/radar_review/requests.rs @@ -0,0 +1,87 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListRadarReview<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListRadarReview<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListRadarReview<'a> { + /// Returns a list of `Review` objects that have `open` set to `true`. + /// + /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/reviews", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/reviews", self) + } +} +impl<'a> stripe::PaginationParams for ListRadarReview<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveRadarReview<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveRadarReview<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveRadarReview<'a> { + /// Retrieves a `Review` object. + pub fn send( + &self, + client: &stripe::Client, + review: &stripe_types::radar_review::ReviewId, + ) -> stripe::Response { + client.get_query(&format!("/reviews/{review}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ApproveRadarReview<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ApproveRadarReview<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ApproveRadarReview<'a> { + /// Approves a `Review` object, closing it and removing it from the list of reviews. + pub fn send( + &self, + client: &stripe::Client, + review: &stripe_types::radar_review::ReviewId, + ) -> stripe::Response { + client.send_form(&format!("/reviews/{review}/approve"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_fraud/src/radar_review_resource_location/mod.rs b/generated/stripe_fraud/src/radar_review_resource_location/mod.rs new file mode 100644 index 000000000..0c4a6af30 --- /dev/null +++ b/generated/stripe_fraud/src/radar_review_resource_location/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::radar_review_resource_location::*; \ No newline at end of file diff --git a/generated/stripe_fraud/src/radar_review_resource_session/mod.rs b/generated/stripe_fraud/src/radar_review_resource_session/mod.rs new file mode 100644 index 000000000..72d1f9f77 --- /dev/null +++ b/generated/stripe_fraud/src/radar_review_resource_session/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::radar_review_resource_session::*; \ No newline at end of file diff --git a/generated/stripe_fraud/src/radar_rule/mod.rs b/generated/stripe_fraud/src/radar_rule/mod.rs new file mode 100644 index 000000000..b41facd61 --- /dev/null +++ b/generated/stripe_fraud/src/radar_rule/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::radar_rule::*; \ No newline at end of file diff --git a/generated/stripe_issuing/Cargo.toml b/generated/stripe_issuing/Cargo.toml new file mode 100644 index 000000000..09125c07f --- /dev/null +++ b/generated/stripe_issuing/Cargo.toml @@ -0,0 +1,51 @@ +[package] +name = "stripe_issuing" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + +[dependencies] +serde.workspace = true +http-types.workspace = true +smol_str.workspace = true +serde_json.workspace = true +async-stripe = {path = "../../async-stripe"} + +stripe_types = {path = "../../stripe_types"} + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +issuing_authorization = [] +issuing_card = [] +issuing_cardholder = [] +issuing_dispute = [] +issuing_network_token = [] +issuing_transaction = [] + +full = ["issuing_authorization", +"issuing_card", +"issuing_cardholder", +"issuing_dispute", +"issuing_network_token", +"issuing_transaction"] + diff --git a/generated/stripe_issuing/src/customer_balance_funding_instructions_customer_balance_funding_instructions/mod.rs b/generated/stripe_issuing/src/customer_balance_funding_instructions_customer_balance_funding_instructions/mod.rs new file mode 100644 index 000000000..efeecc9fb --- /dev/null +++ b/generated/stripe_issuing/src/customer_balance_funding_instructions_customer_balance_funding_instructions/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::customer_balance_funding_instructions_customer_balance_funding_instructions::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/funding_instructions_bank_transfer/mod.rs b/generated/stripe_issuing/src/funding_instructions_bank_transfer/mod.rs new file mode 100644 index 000000000..38e154aa6 --- /dev/null +++ b/generated/stripe_issuing/src/funding_instructions_bank_transfer/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::funding_instructions_bank_transfer::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/funding_instructions_bank_transfer_aba_record/mod.rs b/generated/stripe_issuing/src/funding_instructions_bank_transfer_aba_record/mod.rs new file mode 100644 index 000000000..6e8b1549f --- /dev/null +++ b/generated/stripe_issuing/src/funding_instructions_bank_transfer_aba_record/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::funding_instructions_bank_transfer_aba_record::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/funding_instructions_bank_transfer_financial_address/mod.rs b/generated/stripe_issuing/src/funding_instructions_bank_transfer_financial_address/mod.rs new file mode 100644 index 000000000..5aa819c24 --- /dev/null +++ b/generated/stripe_issuing/src/funding_instructions_bank_transfer_financial_address/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::funding_instructions_bank_transfer_financial_address::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/funding_instructions_bank_transfer_iban_record/mod.rs b/generated/stripe_issuing/src/funding_instructions_bank_transfer_iban_record/mod.rs new file mode 100644 index 000000000..310e76419 --- /dev/null +++ b/generated/stripe_issuing/src/funding_instructions_bank_transfer_iban_record/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::funding_instructions_bank_transfer_iban_record::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/funding_instructions_bank_transfer_sort_code_record/mod.rs b/generated/stripe_issuing/src/funding_instructions_bank_transfer_sort_code_record/mod.rs new file mode 100644 index 000000000..7c3d0898e --- /dev/null +++ b/generated/stripe_issuing/src/funding_instructions_bank_transfer_sort_code_record/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::funding_instructions_bank_transfer_sort_code_record::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/funding_instructions_bank_transfer_spei_record/mod.rs b/generated/stripe_issuing/src/funding_instructions_bank_transfer_spei_record/mod.rs new file mode 100644 index 000000000..4e2562dd7 --- /dev/null +++ b/generated/stripe_issuing/src/funding_instructions_bank_transfer_spei_record/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::funding_instructions_bank_transfer_spei_record::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/funding_instructions_bank_transfer_swift_record/mod.rs b/generated/stripe_issuing/src/funding_instructions_bank_transfer_swift_record/mod.rs new file mode 100644 index 000000000..3dc5b26c9 --- /dev/null +++ b/generated/stripe_issuing/src/funding_instructions_bank_transfer_swift_record/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::funding_instructions_bank_transfer_swift_record::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/funding_instructions_bank_transfer_zengin_record/mod.rs b/generated/stripe_issuing/src/funding_instructions_bank_transfer_zengin_record/mod.rs new file mode 100644 index 000000000..a75345d86 --- /dev/null +++ b/generated/stripe_issuing/src/funding_instructions_bank_transfer_zengin_record/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::funding_instructions_bank_transfer_zengin_record::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_authorization/mod.rs b/generated/stripe_issuing/src/issuing_authorization/mod.rs new file mode 100644 index 000000000..8348b378a --- /dev/null +++ b/generated/stripe_issuing/src/issuing_authorization/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::issuing_authorization::*; +#[cfg(feature = "issuing_authorization")] +mod requests; +#[cfg(feature = "issuing_authorization")] +pub use requests::*; diff --git a/generated/stripe_issuing/src/issuing_authorization/requests.rs b/generated/stripe_issuing/src/issuing_authorization/requests.rs new file mode 100644 index 000000000..f0fd7381b --- /dev/null +++ b/generated/stripe_issuing/src/issuing_authorization/requests.rs @@ -0,0 +1,2350 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListIssuingAuthorization<'a> { + /// Only return authorizations that belong to the given card. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option<&'a str>, + /// Only return authorizations that belong to the given cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub cardholder: Option<&'a str>, + /// Only return authorizations that were created during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return authorizations with the given status. + /// + /// One of `pending`, `closed`, or `reversed`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListIssuingAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Only return authorizations with the given status. +/// +/// One of `pending`, `closed`, or `reversed`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListIssuingAuthorizationStatus { + Closed, + Pending, + Reversed, +} +impl ListIssuingAuthorizationStatus { + pub fn as_str(self) -> &'static str { + use ListIssuingAuthorizationStatus::*; + match self { + Closed => "closed", + Pending => "pending", + Reversed => "reversed", + } + } +} + +impl std::str::FromStr for ListIssuingAuthorizationStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListIssuingAuthorizationStatus::*; + match s { + "closed" => Ok(Closed), + "pending" => Ok(Pending), + "reversed" => Ok(Reversed), + _ => Err(()), + } + } +} +impl AsRef for ListIssuingAuthorizationStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListIssuingAuthorizationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListIssuingAuthorizationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListIssuingAuthorizationStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListIssuingAuthorization<'a> { + /// Returns a list of Issuing `Authorization` objects. + /// + /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/issuing/authorizations", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/issuing/authorizations", self) + } +} +impl<'a> stripe::PaginationParams for ListIssuingAuthorization<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveIssuingAuthorization<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveIssuingAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveIssuingAuthorization<'a> { + /// Retrieves an Issuing `Authorization` object. + pub fn send( + &self, + client: &stripe::Client, + authorization: &str, + ) -> stripe::Response { + client.get_query(&format!("/issuing/authorizations/{authorization}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingAuthorization<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateIssuingAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateIssuingAuthorization<'a> { + /// Updates the specified Issuing `Authorization` object by setting the values of the parameters passed. + /// + /// Any parameters not provided will be left unchanged. + pub fn send( + &self, + client: &stripe::Client, + authorization: &str, + ) -> stripe::Response { + client.send_form( + &format!("/issuing/authorizations/{authorization}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ApproveIssuingAuthorization<'a> { + /// If the authorization's `pending_request.is_amount_controllable` property is `true`, you may provide this value to control how much to hold for the authorization. + /// + /// Must be positive (use [`decline`](https://stripe.com/docs/api/issuing/authorizations/decline) to decline an authorization request). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> ApproveIssuingAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ApproveIssuingAuthorization<'a> { + /// \[Deprecated\] Approves a pending Issuing `Authorization` object. + /// + /// This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. + /// This method is deprecated. + /// Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). + pub fn send( + &self, + client: &stripe::Client, + authorization: &str, + ) -> stripe::Response { + client.send_form( + &format!("/issuing/authorizations/{authorization}/approve"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeclineIssuingAuthorization<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> DeclineIssuingAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> DeclineIssuingAuthorization<'a> { + /// \[Deprecated\] Declines a pending Issuing `Authorization` object. + /// + /// This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. + /// Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). + pub fn send( + &self, + client: &stripe::Client, + authorization: &str, + ) -> stripe::Response { + client.send_form( + &format!("/issuing/authorizations/{authorization}/decline"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingAuthorization<'a> { + /// The total amount to attempt to authorize. + /// + /// This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Detailed breakdown of amount components. + /// + /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_details: Option, + /// How the card details were provided. + /// + /// Defaults to online. + #[serde(skip_serializing_if = "Option::is_none")] + pub authorization_method: Option, + /// Card associated with this authorization. + pub card: &'a str, + /// The currency of the authorization. + /// + /// If not provided, defaults to the currency of the card. + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_amount_controllable: Option, + /// Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. + #[serde(skip_serializing_if = "Option::is_none")] + pub merchant_data: Option>, + /// Details about the authorization, such as identifiers, set by the card network. + #[serde(skip_serializing_if = "Option::is_none")] + pub network_data: Option>, + /// Verifications that Stripe performed on information that the cardholder provided to the merchant. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_data: Option, + /// The digital wallet used for this transaction. + /// + /// One of `apple_pay`, `google_pay`, or `samsung_pay`. + /// Will populate as `null` when no digital wallet was utilized. + #[serde(skip_serializing_if = "Option::is_none")] + pub wallet: Option, +} +impl<'a> CreateIssuingAuthorization<'a> { + pub fn new(amount: i64, card: &'a str) -> Self { + Self { + amount, + amount_details: Default::default(), + authorization_method: Default::default(), + card, + currency: Default::default(), + expand: Default::default(), + is_amount_controllable: Default::default(), + merchant_data: Default::default(), + network_data: Default::default(), + verification_data: Default::default(), + wallet: Default::default(), + } + } +} +/// Detailed breakdown of amount components. +/// +/// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingAuthorizationAmountDetails { + /// The ATM withdrawal fee. + #[serde(skip_serializing_if = "Option::is_none")] + pub atm_fee: Option, + /// The amount of cash requested by the cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashback_amount: Option, +} +impl CreateIssuingAuthorizationAmountDetails { + pub fn new() -> Self { + Self::default() + } +} +/// How the card details were provided. +/// +/// Defaults to online. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingAuthorizationAuthorizationMethod { + Chip, + Contactless, + KeyedIn, + Online, + Swipe, +} +impl CreateIssuingAuthorizationAuthorizationMethod { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationAuthorizationMethod::*; + match self { + Chip => "chip", + Contactless => "contactless", + KeyedIn => "keyed_in", + Online => "online", + Swipe => "swipe", + } + } +} + +impl std::str::FromStr for CreateIssuingAuthorizationAuthorizationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationAuthorizationMethod::*; + match s { + "chip" => Ok(Chip), + "contactless" => Ok(Contactless), + "keyed_in" => Ok(KeyedIn), + "online" => Ok(Online), + "swipe" => Ok(Swipe), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingAuthorizationAuthorizationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingAuthorizationAuthorizationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingAuthorizationAuthorizationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingAuthorizationAuthorizationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingAuthorizationMerchantData<'a> { + /// A categorization of the seller's type of business. + /// + /// See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. + #[serde(skip_serializing_if = "Option::is_none")] + pub category: Option, + /// City where the seller is located. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Country where the seller is located. + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Name of the seller. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Identifier assigned to the seller by the card network. + /// + /// Different card networks may assign different network_id fields to the same merchant. + #[serde(skip_serializing_if = "Option::is_none")] + pub network_id: Option<&'a str>, + /// Postal code where the seller is located. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State where the seller is located. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// An ID assigned by the seller to the location of the sale. + #[serde(skip_serializing_if = "Option::is_none")] + pub terminal_id: Option<&'a str>, + /// URL provided by the merchant on a 3DS request. + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option<&'a str>, +} +impl<'a> CreateIssuingAuthorizationMerchantData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A categorization of the seller's type of business. +/// +/// See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateIssuingAuthorizationMerchantDataCategory { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateIssuingAuthorizationMerchantDataCategory { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationMerchantDataCategory::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateIssuingAuthorizationMerchantDataCategory { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationMerchantDataCategory::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingAuthorizationMerchantDataCategory { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingAuthorizationMerchantDataCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingAuthorizationMerchantDataCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingAuthorizationMerchantDataCategory { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Details about the authorization, such as identifiers, set by the card network. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingAuthorizationNetworkData<'a> { + /// Identifier assigned to the acquirer by the card network. + #[serde(skip_serializing_if = "Option::is_none")] + pub acquiring_institution_id: Option<&'a str>, +} +impl<'a> CreateIssuingAuthorizationNetworkData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Verifications that Stripe performed on information that the cardholder provided to the merchant. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingAuthorizationVerificationData { + /// Whether the cardholder provided an address first line and if it matched the cardholder’s `billing.address.line1`. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1_check: Option, + /// Whether the cardholder provided a postal code and if it matched the cardholder’s `billing.address.postal_code`. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_postal_code_check: + Option, + /// The exemption applied to this authorization. + #[serde(skip_serializing_if = "Option::is_none")] + pub authentication_exemption: + Option, + /// Whether the cardholder provided a CVC and if it matched Stripe’s record. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc_check: Option, + /// Whether the cardholder provided an expiry date and if it matched Stripe’s record. + #[serde(skip_serializing_if = "Option::is_none")] + pub expiry_check: Option, + /// 3D Secure details. + #[serde(skip_serializing_if = "Option::is_none")] + pub three_d_secure: Option, +} +impl CreateIssuingAuthorizationVerificationData { + pub fn new() -> Self { + Self::default() + } +} +/// Whether the cardholder provided an address first line and if it matched the cardholder’s `billing.address.line1`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingAuthorizationVerificationDataAddressLine1Check { + Match, + Mismatch, + NotProvided, +} +impl CreateIssuingAuthorizationVerificationDataAddressLine1Check { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationVerificationDataAddressLine1Check::*; + match self { + Match => "match", + Mismatch => "mismatch", + NotProvided => "not_provided", + } + } +} + +impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataAddressLine1Check { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationVerificationDataAddressLine1Check::*; + match s { + "match" => Ok(Match), + "mismatch" => Ok(Mismatch), + "not_provided" => Ok(NotProvided), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingAuthorizationVerificationDataAddressLine1Check { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataAddressLine1Check { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataAddressLine1Check { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingAuthorizationVerificationDataAddressLine1Check { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether the cardholder provided a postal code and if it matched the cardholder’s `billing.address.postal_code`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck { + Match, + Mismatch, + NotProvided, +} +impl CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck::*; + match self { + Match => "match", + Mismatch => "mismatch", + NotProvided => "not_provided", + } + } +} + +impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck::*; + match s { + "match" => Ok(Match), + "mismatch" => Ok(Mismatch), + "not_provided" => Ok(NotProvided), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The exemption applied to this authorization. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingAuthorizationVerificationDataAuthenticationExemption { + /// The entity that requested the exemption, either the acquiring merchant or the Issuing user. + pub claimed_by: CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy, + /// The specific exemption claimed for this authorization. + #[serde(rename = "type")] + pub type_: CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType, +} +impl CreateIssuingAuthorizationVerificationDataAuthenticationExemption { + pub fn new( + claimed_by: CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy, + type_: CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType, + ) -> Self { + Self { claimed_by, type_ } + } +} +/// The entity that requested the exemption, either the acquiring merchant or the Issuing user. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy { + Acquirer, + Issuer, +} +impl CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy::*; + match self { + Acquirer => "acquirer", + Issuer => "issuer", + } + } +} + +impl std::str::FromStr + for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy::*; + match s { + "acquirer" => Ok(Acquirer), + "issuer" => Ok(Issuer), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The specific exemption claimed for this authorization. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType { + LowValueTransaction, + TransactionRiskAnalysis, +} +impl CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType::*; + match self { + LowValueTransaction => "low_value_transaction", + TransactionRiskAnalysis => "transaction_risk_analysis", + } + } +} + +impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType::*; + match s { + "low_value_transaction" => Ok(LowValueTransaction), + "transaction_risk_analysis" => Ok(TransactionRiskAnalysis), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether the cardholder provided a CVC and if it matched Stripe’s record. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingAuthorizationVerificationDataCvcCheck { + Match, + Mismatch, + NotProvided, +} +impl CreateIssuingAuthorizationVerificationDataCvcCheck { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationVerificationDataCvcCheck::*; + match self { + Match => "match", + Mismatch => "mismatch", + NotProvided => "not_provided", + } + } +} + +impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataCvcCheck { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationVerificationDataCvcCheck::*; + match s { + "match" => Ok(Match), + "mismatch" => Ok(Mismatch), + "not_provided" => Ok(NotProvided), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingAuthorizationVerificationDataCvcCheck { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataCvcCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataCvcCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingAuthorizationVerificationDataCvcCheck { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether the cardholder provided an expiry date and if it matched Stripe’s record. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingAuthorizationVerificationDataExpiryCheck { + Match, + Mismatch, + NotProvided, +} +impl CreateIssuingAuthorizationVerificationDataExpiryCheck { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationVerificationDataExpiryCheck::*; + match self { + Match => "match", + Mismatch => "mismatch", + NotProvided => "not_provided", + } + } +} + +impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataExpiryCheck { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationVerificationDataExpiryCheck::*; + match s { + "match" => Ok(Match), + "mismatch" => Ok(Mismatch), + "not_provided" => Ok(NotProvided), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingAuthorizationVerificationDataExpiryCheck { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataExpiryCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataExpiryCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingAuthorizationVerificationDataExpiryCheck { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 3D Secure details. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingAuthorizationVerificationDataThreeDSecure { + /// The outcome of the 3D Secure authentication request. + pub result: CreateIssuingAuthorizationVerificationDataThreeDSecureResult, +} +impl CreateIssuingAuthorizationVerificationDataThreeDSecure { + pub fn new(result: CreateIssuingAuthorizationVerificationDataThreeDSecureResult) -> Self { + Self { result } + } +} +/// The outcome of the 3D Secure authentication request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingAuthorizationVerificationDataThreeDSecureResult { + AttemptAcknowledged, + Authenticated, + Failed, + Required, +} +impl CreateIssuingAuthorizationVerificationDataThreeDSecureResult { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationVerificationDataThreeDSecureResult::*; + match self { + AttemptAcknowledged => "attempt_acknowledged", + Authenticated => "authenticated", + Failed => "failed", + Required => "required", + } + } +} + +impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataThreeDSecureResult { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationVerificationDataThreeDSecureResult::*; + match s { + "attempt_acknowledged" => Ok(AttemptAcknowledged), + "authenticated" => Ok(Authenticated), + "failed" => Ok(Failed), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingAuthorizationVerificationDataThreeDSecureResult { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataThreeDSecureResult { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataThreeDSecureResult { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingAuthorizationVerificationDataThreeDSecureResult { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The digital wallet used for this transaction. +/// +/// One of `apple_pay`, `google_pay`, or `samsung_pay`. +/// Will populate as `null` when no digital wallet was utilized. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingAuthorizationWallet { + ApplePay, + GooglePay, + SamsungPay, +} +impl CreateIssuingAuthorizationWallet { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationWallet::*; + match self { + ApplePay => "apple_pay", + GooglePay => "google_pay", + SamsungPay => "samsung_pay", + } + } +} + +impl std::str::FromStr for CreateIssuingAuthorizationWallet { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationWallet::*; + match s { + "apple_pay" => Ok(ApplePay), + "google_pay" => Ok(GooglePay), + "samsung_pay" => Ok(SamsungPay), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingAuthorizationWallet { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingAuthorizationWallet { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingAuthorizationWallet { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingAuthorizationWallet { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateIssuingAuthorization<'a> { + /// Create a test-mode authorization. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/test_helpers/issuing/authorizations", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct IncrementIssuingAuthorization<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The amount to increment the authorization by. + /// + /// This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub increment_amount: i64, + /// If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_amount_controllable: Option, +} +impl<'a> IncrementIssuingAuthorization<'a> { + pub fn new(increment_amount: i64) -> Self { + Self { + expand: Default::default(), + increment_amount, + is_amount_controllable: Default::default(), + } + } +} +impl<'a> IncrementIssuingAuthorization<'a> { + /// Increment a test-mode Authorization. + pub fn send( + &self, + client: &stripe::Client, + authorization: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/authorizations/{authorization}/increment"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReverseIssuingAuthorization<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The amount to reverse from the authorization. + /// + /// If not provided, the full amount of the authorization will be reversed. + /// This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_amount: Option, +} +impl<'a> ReverseIssuingAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ReverseIssuingAuthorization<'a> { + /// Reverse a test-mode Authorization. + pub fn send( + &self, + client: &stripe::Client, + authorization: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/authorizations/{authorization}/reverse"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ExpireIssuingAuthorization<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ExpireIssuingAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ExpireIssuingAuthorization<'a> { + /// Expire a test-mode Authorization. + pub fn send( + &self, + client: &stripe::Client, + authorization: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/authorizations/{authorization}/expire"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureIssuingAuthorization<'a> { + /// The amount to capture from the authorization. + /// + /// If not provided, the full amount of the authorization will be captured. + /// This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_amount: Option, + /// Whether to close the authorization after capture. + /// + /// Defaults to true. + /// Set to false to enable multi-capture flows. + #[serde(skip_serializing_if = "Option::is_none")] + pub close_authorization: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Additional purchase information that is optionally provided by the merchant. + #[serde(skip_serializing_if = "Option::is_none")] + pub purchase_details: Option>, +} +impl<'a> CaptureIssuingAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional purchase information that is optionally provided by the merchant. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureIssuingAuthorizationPurchaseDetails<'a> { + /// Information about the flight that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub flight: Option>, + /// Information about fuel that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub fuel: Option>, + /// Information about lodging that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub lodging: Option, + /// The line items in the purchase. + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt: Option<&'a [CaptureIssuingAuthorizationPurchaseDetailsReceipt<'a>]>, + /// A merchant-specific order number. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, +} +impl<'a> CaptureIssuingAuthorizationPurchaseDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about the flight that was purchased with this transaction. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureIssuingAuthorizationPurchaseDetailsFlight<'a> { + /// The time that the flight departed. + #[serde(skip_serializing_if = "Option::is_none")] + pub departure_at: Option, + /// The name of the passenger. + #[serde(skip_serializing_if = "Option::is_none")] + pub passenger_name: Option<&'a str>, + /// Whether the ticket is refundable. + #[serde(skip_serializing_if = "Option::is_none")] + pub refundable: Option, + /// The legs of the trip. + #[serde(skip_serializing_if = "Option::is_none")] + pub segments: Option<&'a [CaptureIssuingAuthorizationPurchaseDetailsFlightSegments<'a>]>, + /// The travel agency that issued the ticket. + #[serde(skip_serializing_if = "Option::is_none")] + pub travel_agency: Option<&'a str>, +} +impl<'a> CaptureIssuingAuthorizationPurchaseDetailsFlight<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The legs of the trip. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureIssuingAuthorizationPurchaseDetailsFlightSegments<'a> { + /// The three-letter IATA airport code of the flight's destination. + #[serde(skip_serializing_if = "Option::is_none")] + pub arrival_airport_code: Option<&'a str>, + /// The airline carrier code. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// The three-letter IATA airport code that the flight departed from. + #[serde(skip_serializing_if = "Option::is_none")] + pub departure_airport_code: Option<&'a str>, + /// The flight number. + #[serde(skip_serializing_if = "Option::is_none")] + pub flight_number: Option<&'a str>, + /// The flight's service class. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_class: Option<&'a str>, + /// Whether a stopover is allowed on this flight. + #[serde(skip_serializing_if = "Option::is_none")] + pub stopover_allowed: Option, +} +impl<'a> CaptureIssuingAuthorizationPurchaseDetailsFlightSegments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about fuel that was purchased with this transaction. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureIssuingAuthorizationPurchaseDetailsFuel<'a> { + /// The type of fuel that was purchased. + /// + /// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// The units for `volume_decimal`. + /// + /// One of `us_gallon` or `liter`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit: Option, + /// The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_cost_decimal: Option<&'a str>, + /// The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. + #[serde(skip_serializing_if = "Option::is_none")] + pub volume_decimal: Option<&'a str>, +} +impl<'a> CaptureIssuingAuthorizationPurchaseDetailsFuel<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of fuel that was purchased. +/// +/// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CaptureIssuingAuthorizationPurchaseDetailsFuelType { + Diesel, + Other, + UnleadedPlus, + UnleadedRegular, + UnleadedSuper, +} +impl CaptureIssuingAuthorizationPurchaseDetailsFuelType { + pub fn as_str(self) -> &'static str { + use CaptureIssuingAuthorizationPurchaseDetailsFuelType::*; + match self { + Diesel => "diesel", + Other => "other", + UnleadedPlus => "unleaded_plus", + UnleadedRegular => "unleaded_regular", + UnleadedSuper => "unleaded_super", + } + } +} + +impl std::str::FromStr for CaptureIssuingAuthorizationPurchaseDetailsFuelType { + type Err = (); + fn from_str(s: &str) -> Result { + use CaptureIssuingAuthorizationPurchaseDetailsFuelType::*; + match s { + "diesel" => Ok(Diesel), + "other" => Ok(Other), + "unleaded_plus" => Ok(UnleadedPlus), + "unleaded_regular" => Ok(UnleadedRegular), + "unleaded_super" => Ok(UnleadedSuper), + _ => Err(()), + } + } +} +impl AsRef for CaptureIssuingAuthorizationPurchaseDetailsFuelType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CaptureIssuingAuthorizationPurchaseDetailsFuelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsFuelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CaptureIssuingAuthorizationPurchaseDetailsFuelType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The units for `volume_decimal`. +/// +/// One of `us_gallon` or `liter`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CaptureIssuingAuthorizationPurchaseDetailsFuelUnit { + Liter, + UsGallon, +} +impl CaptureIssuingAuthorizationPurchaseDetailsFuelUnit { + pub fn as_str(self) -> &'static str { + use CaptureIssuingAuthorizationPurchaseDetailsFuelUnit::*; + match self { + Liter => "liter", + UsGallon => "us_gallon", + } + } +} + +impl std::str::FromStr for CaptureIssuingAuthorizationPurchaseDetailsFuelUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use CaptureIssuingAuthorizationPurchaseDetailsFuelUnit::*; + match s { + "liter" => Ok(Liter), + "us_gallon" => Ok(UsGallon), + _ => Err(()), + } + } +} +impl AsRef for CaptureIssuingAuthorizationPurchaseDetailsFuelUnit { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CaptureIssuingAuthorizationPurchaseDetailsFuelUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsFuelUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CaptureIssuingAuthorizationPurchaseDetailsFuelUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about lodging that was purchased with this transaction. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureIssuingAuthorizationPurchaseDetailsLodging { + /// The time of checking into the lodging. + #[serde(skip_serializing_if = "Option::is_none")] + pub check_in_at: Option, + /// The number of nights stayed at the lodging. + #[serde(skip_serializing_if = "Option::is_none")] + pub nights: Option, +} +impl CaptureIssuingAuthorizationPurchaseDetailsLodging { + pub fn new() -> Self { + Self::default() + } +} +/// The line items in the purchase. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureIssuingAuthorizationPurchaseDetailsReceipt<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub total: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_cost: Option, +} +impl<'a> CaptureIssuingAuthorizationPurchaseDetailsReceipt<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CaptureIssuingAuthorization<'a> { + /// Capture a test-mode authorization. + pub fn send( + &self, + client: &stripe::Client, + authorization: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/authorizations/{authorization}/capture"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_issuing/src/issuing_authorization_amount_details/mod.rs b/generated/stripe_issuing/src/issuing_authorization_amount_details/mod.rs new file mode 100644 index 000000000..8494c626c --- /dev/null +++ b/generated/stripe_issuing/src/issuing_authorization_amount_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_authorization_amount_details::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_authorization_authentication_exemption/mod.rs b/generated/stripe_issuing/src/issuing_authorization_authentication_exemption/mod.rs new file mode 100644 index 000000000..6b8ca86ae --- /dev/null +++ b/generated/stripe_issuing/src/issuing_authorization_authentication_exemption/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_authorization_authentication_exemption::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_authorization_merchant_data/mod.rs b/generated/stripe_issuing/src/issuing_authorization_merchant_data/mod.rs new file mode 100644 index 000000000..3c49a8f30 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_authorization_merchant_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_authorization_merchant_data::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_authorization_network_data/mod.rs b/generated/stripe_issuing/src/issuing_authorization_network_data/mod.rs new file mode 100644 index 000000000..d1e94de81 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_authorization_network_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_authorization_network_data::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_authorization_pending_request/mod.rs b/generated/stripe_issuing/src/issuing_authorization_pending_request/mod.rs new file mode 100644 index 000000000..4abb5a9a5 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_authorization_pending_request/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_authorization_pending_request::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_authorization_request/mod.rs b/generated/stripe_issuing/src/issuing_authorization_request/mod.rs new file mode 100644 index 000000000..c284500cd --- /dev/null +++ b/generated/stripe_issuing/src/issuing_authorization_request/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_authorization_request::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_authorization_three_d_secure/mod.rs b/generated/stripe_issuing/src/issuing_authorization_three_d_secure/mod.rs new file mode 100644 index 000000000..dad0de04c --- /dev/null +++ b/generated/stripe_issuing/src/issuing_authorization_three_d_secure/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_authorization_three_d_secure::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_authorization_treasury/mod.rs b/generated/stripe_issuing/src/issuing_authorization_treasury/mod.rs new file mode 100644 index 000000000..de2c43bb7 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_authorization_treasury/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_authorization_treasury::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_authorization_verification_data/mod.rs b/generated/stripe_issuing/src/issuing_authorization_verification_data/mod.rs new file mode 100644 index 000000000..9e82df1a0 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_authorization_verification_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_authorization_verification_data::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_card/mod.rs b/generated/stripe_issuing/src/issuing_card/mod.rs new file mode 100644 index 000000000..5334d4346 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_card/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::issuing_card::*; +#[cfg(feature = "issuing_card")] +mod requests; +#[cfg(feature = "issuing_card")] +pub use requests::*; diff --git a/generated/stripe_issuing/src/issuing_card/requests.rs b/generated/stripe_issuing/src/issuing_card/requests.rs new file mode 100644 index 000000000..d8e786190 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_card/requests.rs @@ -0,0 +1,7278 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListIssuingCard<'a> { + /// Only return cards belonging to the Cardholder with the provided ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub cardholder: Option<&'a str>, + /// Only return cards that were issued during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Only return cards that have the given expiration month. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option, + /// Only return cards that have the given expiration year. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Only return cards that have the given last four digits. + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option<&'a str>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return cards that have the given status. + /// + /// One of `active`, `inactive`, or `canceled`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Only return cards that have the given type. + /// + /// One of `virtual` or `physical`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> ListIssuingCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Only return cards that have the given status. +/// +/// One of `active`, `inactive`, or `canceled`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListIssuingCardStatus { + Active, + Canceled, + Inactive, +} +impl ListIssuingCardStatus { + pub fn as_str(self) -> &'static str { + use ListIssuingCardStatus::*; + match self { + Active => "active", + Canceled => "canceled", + Inactive => "inactive", + } + } +} + +impl std::str::FromStr for ListIssuingCardStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListIssuingCardStatus::*; + match s { + "active" => Ok(Active), + "canceled" => Ok(Canceled), + "inactive" => Ok(Inactive), + _ => Err(()), + } + } +} +impl AsRef for ListIssuingCardStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListIssuingCardStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListIssuingCardStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListIssuingCardStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only return cards that have the given type. +/// +/// One of `virtual` or `physical`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListIssuingCardType { + Physical, + Virtual, +} +impl ListIssuingCardType { + pub fn as_str(self) -> &'static str { + use ListIssuingCardType::*; + match self { + Physical => "physical", + Virtual => "virtual", + } + } +} + +impl std::str::FromStr for ListIssuingCardType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListIssuingCardType::*; + match s { + "physical" => Ok(Physical), + "virtual" => Ok(Virtual), + _ => Err(()), + } + } +} +impl AsRef for ListIssuingCardType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListIssuingCardType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListIssuingCardType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListIssuingCardType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListIssuingCard<'a> { + /// Returns a list of Issuing `Card` objects. + /// + /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/issuing/cards", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/issuing/cards", self) + } +} +impl<'a> stripe::PaginationParams for ListIssuingCard<'a> {} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingCard<'a> { + /// The [Cardholder](https://stripe.com/docs/api#issuing_cardholder_object) object with which the card will be associated. + #[serde(skip_serializing_if = "Option::is_none")] + pub cardholder: Option<&'a str>, + /// The currency for the card. + pub currency: stripe_types::Currency, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_account: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The card this is meant to be a replacement for (if any). + #[serde(skip_serializing_if = "Option::is_none")] + pub replacement_for: Option<&'a str>, + /// If `replacement_for` is specified, this should indicate why that card is being replaced. + #[serde(skip_serializing_if = "Option::is_none")] + pub replacement_reason: Option, + /// The address where the card will be shipped. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// Rules that control spending for this card. + /// + /// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_controls: Option>, + /// Whether authorizations can be approved on this card. + /// + /// May be blocked from activating cards depending on past-due Cardholder requirements. + /// Defaults to `inactive`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// The type of card to issue. + /// + /// Possible values are `physical` or `virtual`. + #[serde(rename = "type")] + pub type_: CreateIssuingCardType, +} +impl<'a> CreateIssuingCard<'a> { + pub fn new(currency: stripe_types::Currency, type_: CreateIssuingCardType) -> Self { + Self { + cardholder: Default::default(), + currency, + expand: Default::default(), + financial_account: Default::default(), + metadata: Default::default(), + replacement_for: Default::default(), + replacement_reason: Default::default(), + shipping: Default::default(), + spending_controls: Default::default(), + status: Default::default(), + type_, + } + } +} +/// If `replacement_for` is specified, this should indicate why that card is being replaced. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingCardReplacementReason { + Damaged, + Expired, + Lost, + Stolen, +} +impl CreateIssuingCardReplacementReason { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardReplacementReason::*; + match self { + Damaged => "damaged", + Expired => "expired", + Lost => "lost", + Stolen => "stolen", + } + } +} + +impl std::str::FromStr for CreateIssuingCardReplacementReason { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardReplacementReason::*; + match s { + "damaged" => Ok(Damaged), + "expired" => Ok(Expired), + "lost" => Ok(Lost), + "stolen" => Ok(Stolen), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingCardReplacementReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingCardReplacementReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardReplacementReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardReplacementReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The address where the card will be shipped. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingCardShipping<'a> { + /// The address that the card is shipped to. + pub address: CreateIssuingCardShippingAddress<'a>, + /// Customs information for the shipment. + #[serde(skip_serializing_if = "Option::is_none")] + pub customs: Option>, + /// The name printed on the shipping label when shipping the card. + pub name: &'a str, + /// Phone number of the recipient of the shipment. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_number: Option<&'a str>, + /// Whether a signature is required for card delivery. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_signature: Option, + /// Shipment service. + #[serde(skip_serializing_if = "Option::is_none")] + pub service: Option, + /// Packaging options. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> CreateIssuingCardShipping<'a> { + pub fn new(address: CreateIssuingCardShippingAddress<'a>, name: &'a str) -> Self { + Self { + address, + customs: Default::default(), + name, + phone_number: Default::default(), + require_signature: Default::default(), + service: Default::default(), + type_: Default::default(), + } + } +} +/// The address that the card is shipped to. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingCardShippingAddress<'a> { + /// City, district, suburb, town, or village. + pub city: &'a str, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: &'a str, + /// Address line 1 (e.g., street, PO Box, or company name). + pub line1: &'a str, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + pub postal_code: &'a str, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateIssuingCardShippingAddress<'a> { + pub fn new(city: &'a str, country: &'a str, line1: &'a str, postal_code: &'a str) -> Self { + Self { + city, + country, + line1, + line2: Default::default(), + postal_code, + state: Default::default(), + } + } +} +/// Customs information for the shipment. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingCardShippingCustoms<'a> { + /// The Economic Operators Registration and Identification (EORI) number to use for Customs. + /// + /// Required for bulk shipments to Europe. + #[serde(skip_serializing_if = "Option::is_none")] + pub eori_number: Option<&'a str>, +} +impl<'a> CreateIssuingCardShippingCustoms<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Shipment service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingCardShippingService { + Express, + Priority, + Standard, +} +impl CreateIssuingCardShippingService { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardShippingService::*; + match self { + Express => "express", + Priority => "priority", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateIssuingCardShippingService { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardShippingService::*; + match s { + "express" => Ok(Express), + "priority" => Ok(Priority), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingCardShippingService { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingCardShippingService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardShippingService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardShippingService { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Packaging options. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingCardShippingType { + Bulk, + Individual, +} +impl CreateIssuingCardShippingType { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardShippingType::*; + match self { + Bulk => "bulk", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreateIssuingCardShippingType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardShippingType::*; + match s { + "bulk" => Ok(Bulk), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingCardShippingType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingCardShippingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardShippingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardShippingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Rules that control spending for this card. +/// +/// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingCardSpendingControls<'a> { + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. + /// + /// All other categories will be blocked. + /// Cannot be set with `blocked_categories`. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_categories: Option<&'a [CreateIssuingCardSpendingControlsAllowedCategories]>, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. + /// + /// All other categories will be allowed. + /// Cannot be set with `allowed_categories`. + #[serde(skip_serializing_if = "Option::is_none")] + pub blocked_categories: Option<&'a [CreateIssuingCardSpendingControlsBlockedCategories]>, + /// Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_limits: Option<&'a [CreateIssuingCardSpendingControlsSpendingLimits<'a>]>, +} +impl<'a> CreateIssuingCardSpendingControls<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. +/// +/// All other categories will be blocked. +/// Cannot be set with `blocked_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateIssuingCardSpendingControlsAllowedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateIssuingCardSpendingControlsAllowedCategories { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardSpendingControlsAllowedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateIssuingCardSpendingControlsAllowedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardSpendingControlsAllowedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingCardSpendingControlsAllowedCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingCardSpendingControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardSpendingControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardSpendingControlsAllowedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. +/// +/// All other categories will be allowed. +/// Cannot be set with `allowed_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateIssuingCardSpendingControlsBlockedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateIssuingCardSpendingControlsBlockedCategories { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardSpendingControlsBlockedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateIssuingCardSpendingControlsBlockedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardSpendingControlsBlockedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingCardSpendingControlsBlockedCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingCardSpendingControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardSpendingControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardSpendingControlsBlockedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingCardSpendingControlsSpendingLimits<'a> { + /// Maximum amount allowed to spend per interval. + pub amount: i64, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. + /// + /// Omitting this field will apply the limit to all categories. + #[serde(skip_serializing_if = "Option::is_none")] + pub categories: Option<&'a [CreateIssuingCardSpendingControlsSpendingLimitsCategories]>, + /// Interval (or event) to which the amount applies. + pub interval: CreateIssuingCardSpendingControlsSpendingLimitsInterval, +} +impl<'a> CreateIssuingCardSpendingControlsSpendingLimits<'a> { + pub fn new( + amount: i64, + interval: CreateIssuingCardSpendingControlsSpendingLimitsInterval, + ) -> Self { + Self { amount, categories: Default::default(), interval } + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. +/// +/// Omitting this field will apply the limit to all categories. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateIssuingCardSpendingControlsSpendingLimitsCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateIssuingCardSpendingControlsSpendingLimitsCategories { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardSpendingControlsSpendingLimitsCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateIssuingCardSpendingControlsSpendingLimitsCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardSpendingControlsSpendingLimitsCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingCardSpendingControlsSpendingLimitsCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingCardSpendingControlsSpendingLimitsCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardSpendingControlsSpendingLimitsCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardSpendingControlsSpendingLimitsCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Interval (or event) to which the amount applies. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingCardSpendingControlsSpendingLimitsInterval { + AllTime, + Daily, + Monthly, + PerAuthorization, + Weekly, + Yearly, +} +impl CreateIssuingCardSpendingControlsSpendingLimitsInterval { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardSpendingControlsSpendingLimitsInterval::*; + match self { + AllTime => "all_time", + Daily => "daily", + Monthly => "monthly", + PerAuthorization => "per_authorization", + Weekly => "weekly", + Yearly => "yearly", + } + } +} + +impl std::str::FromStr for CreateIssuingCardSpendingControlsSpendingLimitsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardSpendingControlsSpendingLimitsInterval::*; + match s { + "all_time" => Ok(AllTime), + "daily" => Ok(Daily), + "monthly" => Ok(Monthly), + "per_authorization" => Ok(PerAuthorization), + "weekly" => Ok(Weekly), + "yearly" => Ok(Yearly), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingCardSpendingControlsSpendingLimitsInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingCardSpendingControlsSpendingLimitsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardSpendingControlsSpendingLimitsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardSpendingControlsSpendingLimitsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether authorizations can be approved on this card. +/// +/// May be blocked from activating cards depending on past-due Cardholder requirements. +/// Defaults to `inactive`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingCardStatus { + Active, + Inactive, +} +impl CreateIssuingCardStatus { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardStatus::*; + match self { + Active => "active", + Inactive => "inactive", + } + } +} + +impl std::str::FromStr for CreateIssuingCardStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardStatus::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingCardStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingCardStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of card to issue. +/// +/// Possible values are `physical` or `virtual`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingCardType { + Physical, + Virtual, +} +impl CreateIssuingCardType { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardType::*; + match self { + Physical => "physical", + Virtual => "virtual", + } + } +} + +impl std::str::FromStr for CreateIssuingCardType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardType::*; + match s { + "physical" => Ok(Physical), + "virtual" => Ok(Virtual), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingCardType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingCardType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateIssuingCard<'a> { + /// Creates an Issuing `Card` object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/issuing/cards", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveIssuingCard<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveIssuingCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveIssuingCard<'a> { + /// Retrieves an Issuing `Card` object. + pub fn send( + &self, + client: &stripe::Client, + card: &stripe_types::card::CardId, + ) -> stripe::Response { + client.get_query(&format!("/issuing/cards/{card}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingCard<'a> { + /// Reason why the `status` of this card is `canceled`. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The desired new PIN for this card. + #[serde(skip_serializing_if = "Option::is_none")] + pub pin: Option>, + /// Rules that control spending for this card. + /// + /// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_controls: Option>, + /// Dictates whether authorizations can be approved on this card. + /// + /// May be blocked from activating cards depending on past-due Cardholder requirements. + /// Defaults to `inactive`. + /// If this card is being canceled because it was lost or stolen, this information should be provided as `cancellation_reason`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> UpdateIssuingCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Reason why the `status` of this card is `canceled`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingCardCancellationReason { + Lost, + Stolen, +} +impl UpdateIssuingCardCancellationReason { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardCancellationReason::*; + match self { + Lost => "lost", + Stolen => "stolen", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardCancellationReason { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardCancellationReason::*; + match s { + "lost" => Ok(Lost), + "stolen" => Ok(Stolen), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingCardCancellationReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingCardCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardCancellationReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The desired new PIN for this card. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingCardPin<'a> { + /// The card's desired new PIN, encrypted under Stripe's public key. + #[serde(skip_serializing_if = "Option::is_none")] + pub encrypted_number: Option<&'a str>, +} +impl<'a> UpdateIssuingCardPin<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Rules that control spending for this card. +/// +/// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingCardSpendingControls<'a> { + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. + /// + /// All other categories will be blocked. + /// Cannot be set with `blocked_categories`. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_categories: Option<&'a [UpdateIssuingCardSpendingControlsAllowedCategories]>, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. + /// + /// All other categories will be allowed. + /// Cannot be set with `allowed_categories`. + #[serde(skip_serializing_if = "Option::is_none")] + pub blocked_categories: Option<&'a [UpdateIssuingCardSpendingControlsBlockedCategories]>, + /// Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_limits: Option<&'a [UpdateIssuingCardSpendingControlsSpendingLimits<'a>]>, +} +impl<'a> UpdateIssuingCardSpendingControls<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. +/// +/// All other categories will be blocked. +/// Cannot be set with `blocked_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateIssuingCardSpendingControlsAllowedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateIssuingCardSpendingControlsAllowedCategories { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardSpendingControlsAllowedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardSpendingControlsAllowedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardSpendingControlsAllowedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingCardSpendingControlsAllowedCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingCardSpendingControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardSpendingControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardSpendingControlsAllowedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. +/// +/// All other categories will be allowed. +/// Cannot be set with `allowed_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateIssuingCardSpendingControlsBlockedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateIssuingCardSpendingControlsBlockedCategories { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardSpendingControlsBlockedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardSpendingControlsBlockedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardSpendingControlsBlockedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingCardSpendingControlsBlockedCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingCardSpendingControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardSpendingControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardSpendingControlsBlockedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateIssuingCardSpendingControlsSpendingLimits<'a> { + /// Maximum amount allowed to spend per interval. + pub amount: i64, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. + /// + /// Omitting this field will apply the limit to all categories. + #[serde(skip_serializing_if = "Option::is_none")] + pub categories: Option<&'a [UpdateIssuingCardSpendingControlsSpendingLimitsCategories]>, + /// Interval (or event) to which the amount applies. + pub interval: UpdateIssuingCardSpendingControlsSpendingLimitsInterval, +} +impl<'a> UpdateIssuingCardSpendingControlsSpendingLimits<'a> { + pub fn new( + amount: i64, + interval: UpdateIssuingCardSpendingControlsSpendingLimitsInterval, + ) -> Self { + Self { amount, categories: Default::default(), interval } + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. +/// +/// Omitting this field will apply the limit to all categories. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateIssuingCardSpendingControlsSpendingLimitsCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateIssuingCardSpendingControlsSpendingLimitsCategories { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardSpendingControlsSpendingLimitsCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardSpendingControlsSpendingLimitsCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardSpendingControlsSpendingLimitsCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingCardSpendingControlsSpendingLimitsCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingCardSpendingControlsSpendingLimitsCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardSpendingControlsSpendingLimitsCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardSpendingControlsSpendingLimitsCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Interval (or event) to which the amount applies. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingCardSpendingControlsSpendingLimitsInterval { + AllTime, + Daily, + Monthly, + PerAuthorization, + Weekly, + Yearly, +} +impl UpdateIssuingCardSpendingControlsSpendingLimitsInterval { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardSpendingControlsSpendingLimitsInterval::*; + match self { + AllTime => "all_time", + Daily => "daily", + Monthly => "monthly", + PerAuthorization => "per_authorization", + Weekly => "weekly", + Yearly => "yearly", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardSpendingControlsSpendingLimitsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardSpendingControlsSpendingLimitsInterval::*; + match s { + "all_time" => Ok(AllTime), + "daily" => Ok(Daily), + "monthly" => Ok(Monthly), + "per_authorization" => Ok(PerAuthorization), + "weekly" => Ok(Weekly), + "yearly" => Ok(Yearly), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingCardSpendingControlsSpendingLimitsInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingCardSpendingControlsSpendingLimitsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardSpendingControlsSpendingLimitsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardSpendingControlsSpendingLimitsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Dictates whether authorizations can be approved on this card. +/// +/// May be blocked from activating cards depending on past-due Cardholder requirements. +/// Defaults to `inactive`. +/// If this card is being canceled because it was lost or stolen, this information should be provided as `cancellation_reason`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingCardStatus { + Active, + Canceled, + Inactive, +} +impl UpdateIssuingCardStatus { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardStatus::*; + match self { + Active => "active", + Canceled => "canceled", + Inactive => "inactive", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardStatus::*; + match s { + "active" => Ok(Active), + "canceled" => Ok(Canceled), + "inactive" => Ok(Inactive), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingCardStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingCardStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateIssuingCard<'a> { + /// Updates the specified Issuing `Card` object by setting the values of the parameters passed. + /// + /// Any parameters not provided will be left unchanged. + pub fn send( + &self, + client: &stripe::Client, + card: &stripe_types::card::CardId, + ) -> stripe::Response { + client.send_form(&format!("/issuing/cards/{card}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeliverCardIssuingCard<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> DeliverCardIssuingCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> DeliverCardIssuingCard<'a> { + /// Updates the shipping status of the specified Issuing `Card` object to `delivered`. + pub fn send( + &self, + client: &stripe::Client, + card: &stripe_types::card::CardId, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/cards/{card}/shipping/deliver"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ShipCardIssuingCard<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ShipCardIssuingCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ShipCardIssuingCard<'a> { + /// Updates the shipping status of the specified Issuing `Card` object to `shipped`. + pub fn send( + &self, + client: &stripe::Client, + card: &stripe_types::card::CardId, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/cards/{card}/shipping/ship"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReturnCardIssuingCard<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ReturnCardIssuingCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ReturnCardIssuingCard<'a> { + /// Updates the shipping status of the specified Issuing `Card` object to `returned`. + pub fn send( + &self, + client: &stripe::Client, + card: &stripe_types::card::CardId, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/cards/{card}/shipping/return"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct FailCardIssuingCard<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> FailCardIssuingCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> FailCardIssuingCard<'a> { + /// Updates the shipping status of the specified Issuing `Card` object to `failure`. + pub fn send( + &self, + client: &stripe::Client, + card: &stripe_types::card::CardId, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/cards/{card}/shipping/fail"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_issuing/src/issuing_card_apple_pay/mod.rs b/generated/stripe_issuing/src/issuing_card_apple_pay/mod.rs new file mode 100644 index 000000000..c2097ede4 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_card_apple_pay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_card_apple_pay::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_card_authorization_controls/mod.rs b/generated/stripe_issuing/src/issuing_card_authorization_controls/mod.rs new file mode 100644 index 000000000..93454fe01 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_card_authorization_controls/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_card_authorization_controls::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_card_google_pay/mod.rs b/generated/stripe_issuing/src/issuing_card_google_pay/mod.rs new file mode 100644 index 000000000..5e233c222 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_card_google_pay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_card_google_pay::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_card_shipping/mod.rs b/generated/stripe_issuing/src/issuing_card_shipping/mod.rs new file mode 100644 index 000000000..0591c613e --- /dev/null +++ b/generated/stripe_issuing/src/issuing_card_shipping/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_card_shipping::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_card_shipping_customs/mod.rs b/generated/stripe_issuing/src/issuing_card_shipping_customs/mod.rs new file mode 100644 index 000000000..d6daf176c --- /dev/null +++ b/generated/stripe_issuing/src/issuing_card_shipping_customs/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_card_shipping_customs::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_card_spending_limit/mod.rs b/generated/stripe_issuing/src/issuing_card_spending_limit/mod.rs new file mode 100644 index 000000000..4523b6f85 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_card_spending_limit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_card_spending_limit::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_card_wallets/mod.rs b/generated/stripe_issuing/src/issuing_card_wallets/mod.rs new file mode 100644 index 000000000..9656cacb9 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_card_wallets/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_card_wallets::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_cardholder/mod.rs b/generated/stripe_issuing/src/issuing_cardholder/mod.rs new file mode 100644 index 000000000..960b8de68 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_cardholder/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::issuing_cardholder::*; +#[cfg(feature = "issuing_cardholder")] +mod requests; +#[cfg(feature = "issuing_cardholder")] +pub use requests::*; diff --git a/generated/stripe_issuing/src/issuing_cardholder/requests.rs b/generated/stripe_issuing/src/issuing_cardholder/requests.rs new file mode 100644 index 000000000..0ad75a659 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_cardholder/requests.rs @@ -0,0 +1,7354 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListIssuingCardholder<'a> { + /// Only return cardholders that were created during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return cardholders that have the given email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return cardholders that have the given phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_number: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return cardholders that have the given status. + /// + /// One of `active`, `inactive`, or `blocked`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Only return cardholders that have the given type. + /// + /// One of `individual` or `company`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> ListIssuingCardholder<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Only return cardholders that have the given status. +/// +/// One of `active`, `inactive`, or `blocked`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListIssuingCardholderStatus { + Active, + Blocked, + Inactive, +} +impl ListIssuingCardholderStatus { + pub fn as_str(self) -> &'static str { + use ListIssuingCardholderStatus::*; + match self { + Active => "active", + Blocked => "blocked", + Inactive => "inactive", + } + } +} + +impl std::str::FromStr for ListIssuingCardholderStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListIssuingCardholderStatus::*; + match s { + "active" => Ok(Active), + "blocked" => Ok(Blocked), + "inactive" => Ok(Inactive), + _ => Err(()), + } + } +} +impl AsRef for ListIssuingCardholderStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListIssuingCardholderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListIssuingCardholderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListIssuingCardholderStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only return cardholders that have the given type. +/// +/// One of `individual` or `company`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListIssuingCardholderType { + Company, + Individual, +} +impl ListIssuingCardholderType { + pub fn as_str(self) -> &'static str { + use ListIssuingCardholderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for ListIssuingCardholderType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListIssuingCardholderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for ListIssuingCardholderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListIssuingCardholderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListIssuingCardholderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListIssuingCardholderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListIssuingCardholder<'a> { + /// Returns a list of Issuing `Cardholder` objects. + /// + /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/issuing/cardholders", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/issuing/cardholders", self) + } +} +impl<'a> stripe::PaginationParams for ListIssuingCardholder<'a> {} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingCardholder<'a> { + /// The cardholder's billing address. + pub billing: CreateIssuingCardholderBilling<'a>, + /// Additional information about a `company` cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub company: Option>, + /// The cardholder's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Additional information about an `individual` cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub individual: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The cardholder's name. + /// + /// This will be printed on cards issued to them. + /// The maximum length of this field is 24 characters. + /// This field cannot contain any special characters or numbers. + pub name: &'a str, + /// The cardholder's phone number. + /// + /// This will be transformed to [E.164](https://en.wikipedia.org/wiki/E.164) if it is not provided in that format already. + /// This is required for all cardholders who will be creating EU cards. + /// See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_number: Option<&'a str>, + /// The cardholder’s preferred locales (languages), ordered by preference. + /// + /// Locales can be `de`, `en`, `es`, `fr`, or `it`. This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locales: Option<&'a [CreateIssuingCardholderPreferredLocales]>, + /// Rules that control spending across this cardholder's cards. + /// + /// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_controls: Option>, + /// Specifies whether to permit authorizations on this cardholder's cards. + /// + /// Defaults to `active`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// One of `individual` or `company`. + /// + /// See [Choose a cardholder type](https://stripe.com/docs/issuing/other/choose-cardholder) for more details. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> CreateIssuingCardholder<'a> { + pub fn new(billing: CreateIssuingCardholderBilling<'a>, name: &'a str) -> Self { + Self { + billing, + company: Default::default(), + email: Default::default(), + expand: Default::default(), + individual: Default::default(), + metadata: Default::default(), + name, + phone_number: Default::default(), + preferred_locales: Default::default(), + spending_controls: Default::default(), + status: Default::default(), + type_: Default::default(), + } + } +} +/// The cardholder's billing address. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingCardholderBilling<'a> { + /// The cardholder’s billing address. + pub address: CreateIssuingCardholderBillingAddress<'a>, +} +impl<'a> CreateIssuingCardholderBilling<'a> { + pub fn new(address: CreateIssuingCardholderBillingAddress<'a>) -> Self { + Self { address } + } +} +/// The cardholder’s billing address. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingCardholderBillingAddress<'a> { + /// City, district, suburb, town, or village. + pub city: &'a str, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: &'a str, + /// Address line 1 (e.g., street, PO Box, or company name). + pub line1: &'a str, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + pub postal_code: &'a str, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateIssuingCardholderBillingAddress<'a> { + pub fn new(city: &'a str, country: &'a str, line1: &'a str, postal_code: &'a str) -> Self { + Self { + city, + country, + line1, + line2: Default::default(), + postal_code, + state: Default::default(), + } + } +} +/// Additional information about a `company` cardholder. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingCardholderCompany<'a> { + /// The entity's business ID number. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id: Option<&'a str>, +} +impl<'a> CreateIssuingCardholderCompany<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional information about an `individual` cardholder. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingCardholderIndividual<'a> { + /// Information related to the card_issuing program for this cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option>, + /// The date of birth of this cardholder. + /// + /// Cardholders must be older than 13 years old. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, + /// The first name of this cardholder. + /// + /// Required before activating Cards. + /// This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option<&'a str>, + /// The last name of this cardholder. + /// + /// Required before activating Cards. + /// This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option<&'a str>, + /// Government-issued ID document for this cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> CreateIssuingCardholderIndividual<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information related to the card_issuing program for this cardholder. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingCardholderIndividualCardIssuing<'a> { + /// Information about cardholder acceptance of [Authorized User Terms](https://stripe.com/docs/issuing/cards). + #[serde(skip_serializing_if = "Option::is_none")] + pub user_terms_acceptance: + Option>, +} +impl<'a> CreateIssuingCardholderIndividualCardIssuing<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about cardholder acceptance of [Authorized User Terms](https://stripe.com/docs/issuing/cards). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingCardholderIndividualCardIssuingUserTermsAcceptance<'a> { + /// The Unix timestamp marking when the cardholder accepted the Authorized User Terms. + /// + /// Required for Celtic Spend Card users. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the cardholder accepted the Authorized User Terms. + /// + /// Required for Celtic Spend Card users. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the cardholder accepted the Authorized User Terms. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> CreateIssuingCardholderIndividualCardIssuingUserTermsAcceptance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The date of birth of this cardholder. +/// +/// Cardholders must be older than 13 years old. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingCardholderIndividualDob { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl CreateIssuingCardholderIndividualDob { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +/// Government-issued ID document for this cardholder. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingCardholderIndividualVerification<'a> { + /// An identifying document, either a passport or local ID card. + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> CreateIssuingCardholderIndividualVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An identifying document, either a passport or local ID card. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingCardholderIndividualVerificationDocument<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> CreateIssuingCardholderIndividualVerificationDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The cardholder’s preferred locales (languages), ordered by preference. +/// +/// Locales can be `de`, `en`, `es`, `fr`, or `it`. This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingCardholderPreferredLocales { + De, + En, + Es, + Fr, + It, +} +impl CreateIssuingCardholderPreferredLocales { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardholderPreferredLocales::*; + match self { + De => "de", + En => "en", + Es => "es", + Fr => "fr", + It => "it", + } + } +} + +impl std::str::FromStr for CreateIssuingCardholderPreferredLocales { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardholderPreferredLocales::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "es" => Ok(Es), + "fr" => Ok(Fr), + "it" => Ok(It), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingCardholderPreferredLocales { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingCardholderPreferredLocales { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardholderPreferredLocales { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardholderPreferredLocales { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Rules that control spending across this cardholder's cards. +/// +/// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingCardholderSpendingControls<'a> { + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. + /// + /// All other categories will be blocked. + /// Cannot be set with `blocked_categories`. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_categories: Option<&'a [CreateIssuingCardholderSpendingControlsAllowedCategories]>, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. + /// + /// All other categories will be allowed. + /// Cannot be set with `allowed_categories`. + #[serde(skip_serializing_if = "Option::is_none")] + pub blocked_categories: Option<&'a [CreateIssuingCardholderSpendingControlsBlockedCategories]>, + /// Limit spending with amount-based rules that apply across this cardholder's cards. + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_limits: Option<&'a [CreateIssuingCardholderSpendingControlsSpendingLimits<'a>]>, + /// Currency of amounts within `spending_limits`. + /// + /// Defaults to your merchant country's currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_limits_currency: Option, +} +impl<'a> CreateIssuingCardholderSpendingControls<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. +/// +/// All other categories will be blocked. +/// Cannot be set with `blocked_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateIssuingCardholderSpendingControlsAllowedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateIssuingCardholderSpendingControlsAllowedCategories { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardholderSpendingControlsAllowedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateIssuingCardholderSpendingControlsAllowedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardholderSpendingControlsAllowedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingCardholderSpendingControlsAllowedCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingCardholderSpendingControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardholderSpendingControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardholderSpendingControlsAllowedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. +/// +/// All other categories will be allowed. +/// Cannot be set with `allowed_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateIssuingCardholderSpendingControlsBlockedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateIssuingCardholderSpendingControlsBlockedCategories { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardholderSpendingControlsBlockedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateIssuingCardholderSpendingControlsBlockedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardholderSpendingControlsBlockedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingCardholderSpendingControlsBlockedCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingCardholderSpendingControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardholderSpendingControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardholderSpendingControlsBlockedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Limit spending with amount-based rules that apply across this cardholder's cards. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingCardholderSpendingControlsSpendingLimits<'a> { + /// Maximum amount allowed to spend per interval. + pub amount: i64, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. + /// + /// Omitting this field will apply the limit to all categories. + #[serde(skip_serializing_if = "Option::is_none")] + pub categories: Option<&'a [CreateIssuingCardholderSpendingControlsSpendingLimitsCategories]>, + /// Interval (or event) to which the amount applies. + pub interval: CreateIssuingCardholderSpendingControlsSpendingLimitsInterval, +} +impl<'a> CreateIssuingCardholderSpendingControlsSpendingLimits<'a> { + pub fn new( + amount: i64, + interval: CreateIssuingCardholderSpendingControlsSpendingLimitsInterval, + ) -> Self { + Self { amount, categories: Default::default(), interval } + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. +/// +/// Omitting this field will apply the limit to all categories. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateIssuingCardholderSpendingControlsSpendingLimitsCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateIssuingCardholderSpendingControlsSpendingLimitsCategories { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardholderSpendingControlsSpendingLimitsCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateIssuingCardholderSpendingControlsSpendingLimitsCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardholderSpendingControlsSpendingLimitsCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingCardholderSpendingControlsSpendingLimitsCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingCardholderSpendingControlsSpendingLimitsCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardholderSpendingControlsSpendingLimitsCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardholderSpendingControlsSpendingLimitsCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Interval (or event) to which the amount applies. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingCardholderSpendingControlsSpendingLimitsInterval { + AllTime, + Daily, + Monthly, + PerAuthorization, + Weekly, + Yearly, +} +impl CreateIssuingCardholderSpendingControlsSpendingLimitsInterval { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardholderSpendingControlsSpendingLimitsInterval::*; + match self { + AllTime => "all_time", + Daily => "daily", + Monthly => "monthly", + PerAuthorization => "per_authorization", + Weekly => "weekly", + Yearly => "yearly", + } + } +} + +impl std::str::FromStr for CreateIssuingCardholderSpendingControlsSpendingLimitsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardholderSpendingControlsSpendingLimitsInterval::*; + match s { + "all_time" => Ok(AllTime), + "daily" => Ok(Daily), + "monthly" => Ok(Monthly), + "per_authorization" => Ok(PerAuthorization), + "weekly" => Ok(Weekly), + "yearly" => Ok(Yearly), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingCardholderSpendingControlsSpendingLimitsInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingCardholderSpendingControlsSpendingLimitsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardholderSpendingControlsSpendingLimitsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardholderSpendingControlsSpendingLimitsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies whether to permit authorizations on this cardholder's cards. +/// +/// Defaults to `active`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingCardholderStatus { + Active, + Inactive, +} +impl CreateIssuingCardholderStatus { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardholderStatus::*; + match self { + Active => "active", + Inactive => "inactive", + } + } +} + +impl std::str::FromStr for CreateIssuingCardholderStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardholderStatus::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingCardholderStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingCardholderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardholderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardholderStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// One of `individual` or `company`. +/// +/// See [Choose a cardholder type](https://stripe.com/docs/issuing/other/choose-cardholder) for more details. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingCardholderType { + Company, + Individual, +} +impl CreateIssuingCardholderType { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardholderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreateIssuingCardholderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardholderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingCardholderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingCardholderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardholderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardholderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateIssuingCardholder<'a> { + /// Creates a new Issuing `Cardholder` object that can be issued cards. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/issuing/cardholders", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveIssuingCardholder<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveIssuingCardholder<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveIssuingCardholder<'a> { + /// Retrieves an Issuing `Cardholder` object. + pub fn send( + &self, + client: &stripe::Client, + cardholder: &str, + ) -> stripe::Response { + client.get_query(&format!("/issuing/cardholders/{cardholder}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingCardholder<'a> { + /// The cardholder's billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing: Option>, + /// Additional information about a `company` cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub company: Option>, + /// The cardholder's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Additional information about an `individual` cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub individual: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The cardholder's phone number. + /// + /// This is required for all cardholders who will be creating EU cards. + /// See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_number: Option<&'a str>, + /// The cardholder’s preferred locales (languages), ordered by preference. + /// + /// Locales can be `de`, `en`, `es`, `fr`, or `it`. This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locales: Option<&'a [UpdateIssuingCardholderPreferredLocales]>, + /// Rules that control spending across this cardholder's cards. + /// + /// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_controls: Option>, + /// Specifies whether to permit authorizations on this cardholder's cards. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> UpdateIssuingCardholder<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The cardholder's billing address. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateIssuingCardholderBilling<'a> { + /// The cardholder’s billing address. + pub address: UpdateIssuingCardholderBillingAddress<'a>, +} +impl<'a> UpdateIssuingCardholderBilling<'a> { + pub fn new(address: UpdateIssuingCardholderBillingAddress<'a>) -> Self { + Self { address } + } +} +/// The cardholder’s billing address. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateIssuingCardholderBillingAddress<'a> { + /// City, district, suburb, town, or village. + pub city: &'a str, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: &'a str, + /// Address line 1 (e.g., street, PO Box, or company name). + pub line1: &'a str, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + pub postal_code: &'a str, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateIssuingCardholderBillingAddress<'a> { + pub fn new(city: &'a str, country: &'a str, line1: &'a str, postal_code: &'a str) -> Self { + Self { + city, + country, + line1, + line2: Default::default(), + postal_code, + state: Default::default(), + } + } +} +/// Additional information about a `company` cardholder. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingCardholderCompany<'a> { + /// The entity's business ID number. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id: Option<&'a str>, +} +impl<'a> UpdateIssuingCardholderCompany<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional information about an `individual` cardholder. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingCardholderIndividual<'a> { + /// Information related to the card_issuing program for this cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option>, + /// The date of birth of this cardholder. + /// + /// Cardholders must be older than 13 years old. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, + /// The first name of this cardholder. + /// + /// Required before activating Cards. + /// This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option<&'a str>, + /// The last name of this cardholder. + /// + /// Required before activating Cards. + /// This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option<&'a str>, + /// Government-issued ID document for this cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> UpdateIssuingCardholderIndividual<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information related to the card_issuing program for this cardholder. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingCardholderIndividualCardIssuing<'a> { + /// Information about cardholder acceptance of [Authorized User Terms](https://stripe.com/docs/issuing/cards). + #[serde(skip_serializing_if = "Option::is_none")] + pub user_terms_acceptance: + Option>, +} +impl<'a> UpdateIssuingCardholderIndividualCardIssuing<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about cardholder acceptance of [Authorized User Terms](https://stripe.com/docs/issuing/cards). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingCardholderIndividualCardIssuingUserTermsAcceptance<'a> { + /// The Unix timestamp marking when the cardholder accepted the Authorized User Terms. + /// + /// Required for Celtic Spend Card users. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the cardholder accepted the Authorized User Terms. + /// + /// Required for Celtic Spend Card users. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the cardholder accepted the Authorized User Terms. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> UpdateIssuingCardholderIndividualCardIssuingUserTermsAcceptance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The date of birth of this cardholder. +/// +/// Cardholders must be older than 13 years old. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateIssuingCardholderIndividualDob { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl UpdateIssuingCardholderIndividualDob { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +/// Government-issued ID document for this cardholder. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingCardholderIndividualVerification<'a> { + /// An identifying document, either a passport or local ID card. + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> UpdateIssuingCardholderIndividualVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An identifying document, either a passport or local ID card. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingCardholderIndividualVerificationDocument<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> UpdateIssuingCardholderIndividualVerificationDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The cardholder’s preferred locales (languages), ordered by preference. +/// +/// Locales can be `de`, `en`, `es`, `fr`, or `it`. This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingCardholderPreferredLocales { + De, + En, + Es, + Fr, + It, +} +impl UpdateIssuingCardholderPreferredLocales { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardholderPreferredLocales::*; + match self { + De => "de", + En => "en", + Es => "es", + Fr => "fr", + It => "it", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardholderPreferredLocales { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardholderPreferredLocales::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "es" => Ok(Es), + "fr" => Ok(Fr), + "it" => Ok(It), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingCardholderPreferredLocales { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingCardholderPreferredLocales { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardholderPreferredLocales { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardholderPreferredLocales { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Rules that control spending across this cardholder's cards. +/// +/// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingCardholderSpendingControls<'a> { + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. + /// + /// All other categories will be blocked. + /// Cannot be set with `blocked_categories`. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_categories: Option<&'a [UpdateIssuingCardholderSpendingControlsAllowedCategories]>, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. + /// + /// All other categories will be allowed. + /// Cannot be set with `allowed_categories`. + #[serde(skip_serializing_if = "Option::is_none")] + pub blocked_categories: Option<&'a [UpdateIssuingCardholderSpendingControlsBlockedCategories]>, + /// Limit spending with amount-based rules that apply across this cardholder's cards. + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_limits: Option<&'a [UpdateIssuingCardholderSpendingControlsSpendingLimits<'a>]>, + /// Currency of amounts within `spending_limits`. + /// + /// Defaults to your merchant country's currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_limits_currency: Option, +} +impl<'a> UpdateIssuingCardholderSpendingControls<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. +/// +/// All other categories will be blocked. +/// Cannot be set with `blocked_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateIssuingCardholderSpendingControlsAllowedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateIssuingCardholderSpendingControlsAllowedCategories { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardholderSpendingControlsAllowedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardholderSpendingControlsAllowedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardholderSpendingControlsAllowedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingCardholderSpendingControlsAllowedCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingCardholderSpendingControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardholderSpendingControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardholderSpendingControlsAllowedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. +/// +/// All other categories will be allowed. +/// Cannot be set with `allowed_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateIssuingCardholderSpendingControlsBlockedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateIssuingCardholderSpendingControlsBlockedCategories { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardholderSpendingControlsBlockedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardholderSpendingControlsBlockedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardholderSpendingControlsBlockedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingCardholderSpendingControlsBlockedCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingCardholderSpendingControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardholderSpendingControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardholderSpendingControlsBlockedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Limit spending with amount-based rules that apply across this cardholder's cards. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateIssuingCardholderSpendingControlsSpendingLimits<'a> { + /// Maximum amount allowed to spend per interval. + pub amount: i64, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. + /// + /// Omitting this field will apply the limit to all categories. + #[serde(skip_serializing_if = "Option::is_none")] + pub categories: Option<&'a [UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories]>, + /// Interval (or event) to which the amount applies. + pub interval: UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval, +} +impl<'a> UpdateIssuingCardholderSpendingControlsSpendingLimits<'a> { + pub fn new( + amount: i64, + interval: UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval, + ) -> Self { + Self { amount, categories: Default::default(), interval } + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. +/// +/// Omitting this field will apply the limit to all categories. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Interval (or event) to which the amount applies. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval { + AllTime, + Daily, + Monthly, + PerAuthorization, + Weekly, + Yearly, +} +impl UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval::*; + match self { + AllTime => "all_time", + Daily => "daily", + Monthly => "monthly", + PerAuthorization => "per_authorization", + Weekly => "weekly", + Yearly => "yearly", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval::*; + match s { + "all_time" => Ok(AllTime), + "daily" => Ok(Daily), + "monthly" => Ok(Monthly), + "per_authorization" => Ok(PerAuthorization), + "weekly" => Ok(Weekly), + "yearly" => Ok(Yearly), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies whether to permit authorizations on this cardholder's cards. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingCardholderStatus { + Active, + Inactive, +} +impl UpdateIssuingCardholderStatus { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardholderStatus::*; + match self { + Active => "active", + Inactive => "inactive", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardholderStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardholderStatus::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingCardholderStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingCardholderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardholderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardholderStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateIssuingCardholder<'a> { + /// Updates the specified Issuing `Cardholder` object by setting the values of the parameters passed. + /// + /// Any parameters not provided will be left unchanged. + pub fn send( + &self, + client: &stripe::Client, + cardholder: &str, + ) -> stripe::Response { + client.send_form( + &format!("/issuing/cardholders/{cardholder}"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_issuing/src/issuing_cardholder_address/mod.rs b/generated/stripe_issuing/src/issuing_cardholder_address/mod.rs new file mode 100644 index 000000000..530268eeb --- /dev/null +++ b/generated/stripe_issuing/src/issuing_cardholder_address/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_cardholder_address::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_cardholder_authorization_controls/mod.rs b/generated/stripe_issuing/src/issuing_cardholder_authorization_controls/mod.rs new file mode 100644 index 000000000..1bb856a14 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_cardholder_authorization_controls/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_cardholder_authorization_controls::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_cardholder_card_issuing/mod.rs b/generated/stripe_issuing/src/issuing_cardholder_card_issuing/mod.rs new file mode 100644 index 000000000..e0d861c57 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_cardholder_card_issuing/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_cardholder_card_issuing::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_cardholder_company/mod.rs b/generated/stripe_issuing/src/issuing_cardholder_company/mod.rs new file mode 100644 index 000000000..f1f8fd83f --- /dev/null +++ b/generated/stripe_issuing/src/issuing_cardholder_company/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_cardholder_company::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_cardholder_id_document/mod.rs b/generated/stripe_issuing/src/issuing_cardholder_id_document/mod.rs new file mode 100644 index 000000000..1d1d0e101 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_cardholder_id_document/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_cardholder_id_document::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_cardholder_individual/mod.rs b/generated/stripe_issuing/src/issuing_cardholder_individual/mod.rs new file mode 100644 index 000000000..721f29bad --- /dev/null +++ b/generated/stripe_issuing/src/issuing_cardholder_individual/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_cardholder_individual::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_cardholder_individual_dob/mod.rs b/generated/stripe_issuing/src/issuing_cardholder_individual_dob/mod.rs new file mode 100644 index 000000000..f59b025b2 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_cardholder_individual_dob/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_cardholder_individual_dob::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_cardholder_requirements/mod.rs b/generated/stripe_issuing/src/issuing_cardholder_requirements/mod.rs new file mode 100644 index 000000000..c855d86a8 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_cardholder_requirements/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_cardholder_requirements::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_cardholder_spending_limit/mod.rs b/generated/stripe_issuing/src/issuing_cardholder_spending_limit/mod.rs new file mode 100644 index 000000000..7ef7839ea --- /dev/null +++ b/generated/stripe_issuing/src/issuing_cardholder_spending_limit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_cardholder_spending_limit::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_cardholder_user_terms_acceptance/mod.rs b/generated/stripe_issuing/src/issuing_cardholder_user_terms_acceptance/mod.rs new file mode 100644 index 000000000..70dcff731 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_cardholder_user_terms_acceptance/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_cardholder_user_terms_acceptance::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_cardholder_verification/mod.rs b/generated/stripe_issuing/src/issuing_cardholder_verification/mod.rs new file mode 100644 index 000000000..df7f05b24 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_cardholder_verification/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_cardholder_verification::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_dispute/mod.rs b/generated/stripe_issuing/src/issuing_dispute/mod.rs new file mode 100644 index 000000000..3909561ae --- /dev/null +++ b/generated/stripe_issuing/src/issuing_dispute/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::issuing_dispute::*; +#[cfg(feature = "issuing_dispute")] +mod requests; +#[cfg(feature = "issuing_dispute")] +pub use requests::*; diff --git a/generated/stripe_issuing/src/issuing_dispute/requests.rs b/generated/stripe_issuing/src/issuing_dispute/requests.rs new file mode 100644 index 000000000..73bc3e1cd --- /dev/null +++ b/generated/stripe_issuing/src/issuing_dispute/requests.rs @@ -0,0 +1,1336 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListIssuingDispute<'a> { + /// Select Issuing disputes that were created during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Select Issuing disputes with the given status. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Select the Issuing dispute for the given transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction: Option<&'a str>, +} +impl<'a> ListIssuingDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Select Issuing disputes with the given status. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListIssuingDisputeStatus { + Expired, + Lost, + Submitted, + Unsubmitted, + Won, +} +impl ListIssuingDisputeStatus { + pub fn as_str(self) -> &'static str { + use ListIssuingDisputeStatus::*; + match self { + Expired => "expired", + Lost => "lost", + Submitted => "submitted", + Unsubmitted => "unsubmitted", + Won => "won", + } + } +} + +impl std::str::FromStr for ListIssuingDisputeStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListIssuingDisputeStatus::*; + match s { + "expired" => Ok(Expired), + "lost" => Ok(Lost), + "submitted" => Ok(Submitted), + "unsubmitted" => Ok(Unsubmitted), + "won" => Ok(Won), + _ => Err(()), + } + } +} +impl AsRef for ListIssuingDisputeStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListIssuingDisputeStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListIssuingDisputeStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListIssuingDisputeStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListIssuingDispute<'a> { + /// Returns a list of Issuing `Dispute` objects. + /// + /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/issuing/disputes", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/issuing/disputes", self) + } +} +impl<'a> stripe::PaginationParams for ListIssuingDispute<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingDispute<'a> { + /// The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// + /// If not set, defaults to the full transaction amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Evidence provided for the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub evidence: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The ID of the issuing transaction to create a dispute for. + /// + /// For transaction on Treasury FinancialAccounts, use `treasury.received_debit`. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction: Option<&'a str>, + /// Params for disputes related to Treasury FinancialAccounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option>, +} +impl<'a> CreateIssuingDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Evidence provided for the dispute. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingDisputeEvidence<'a> { + /// Evidence provided when `reason` is 'canceled'. + #[serde(skip_serializing_if = "Option::is_none")] + pub canceled: Option>, + /// Evidence provided when `reason` is 'duplicate'. + #[serde(skip_serializing_if = "Option::is_none")] + pub duplicate: Option>, + /// Evidence provided when `reason` is 'fraudulent'. + #[serde(skip_serializing_if = "Option::is_none")] + pub fraudulent: Option>, + /// Evidence provided when `reason` is 'merchandise_not_as_described'. + #[serde(skip_serializing_if = "Option::is_none")] + pub merchandise_not_as_described: + Option>, + /// Evidence provided when `reason` is 'not_received'. + #[serde(skip_serializing_if = "Option::is_none")] + pub not_received: Option>, + /// Evidence provided when `reason` is 'other'. + #[serde(skip_serializing_if = "Option::is_none")] + pub other: Option>, + /// The reason for filing the dispute. + /// + /// The evidence should be submitted in the field of the same name. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// Evidence provided when `reason` is 'service_not_as_described'. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_not_as_described: Option>, +} +impl<'a> CreateIssuingDisputeEvidence<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Evidence provided when `reason` is 'canceled'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingDisputeEvidenceCanceled<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Date when order was canceled. + #[serde(skip_serializing_if = "Option::is_none")] + pub canceled_at: Option, + /// Whether the cardholder was provided with a cancellation policy. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_policy_provided: Option, + /// Reason for canceling the order. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: Option<&'a str>, + /// Date when the cardholder expected to receive the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_at: Option, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Description of the merchandise or service that was purchased. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Whether the product was a merchandise or service. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_type: Option, + /// Result of cardholder's attempt to return the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_status: Option, + /// Date when the product was returned or attempted to be returned. + #[serde(skip_serializing_if = "Option::is_none")] + pub returned_at: Option, +} +impl<'a> CreateIssuingDisputeEvidenceCanceled<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingDisputeEvidenceCanceledProductType { + Merchandise, + Service, +} +impl CreateIssuingDisputeEvidenceCanceledProductType { + pub fn as_str(self) -> &'static str { + use CreateIssuingDisputeEvidenceCanceledProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for CreateIssuingDisputeEvidenceCanceledProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingDisputeEvidenceCanceledProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingDisputeEvidenceCanceledProductType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingDisputeEvidenceCanceledProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingDisputeEvidenceCanceledProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingDisputeEvidenceCanceledProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Result of cardholder's attempt to return the product. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingDisputeEvidenceCanceledReturnStatus { + MerchantRejected, + Successful, +} +impl CreateIssuingDisputeEvidenceCanceledReturnStatus { + pub fn as_str(self) -> &'static str { + use CreateIssuingDisputeEvidenceCanceledReturnStatus::*; + match self { + MerchantRejected => "merchant_rejected", + Successful => "successful", + } + } +} + +impl std::str::FromStr for CreateIssuingDisputeEvidenceCanceledReturnStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingDisputeEvidenceCanceledReturnStatus::*; + match s { + "merchant_rejected" => Ok(MerchantRejected), + "successful" => Ok(Successful), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingDisputeEvidenceCanceledReturnStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingDisputeEvidenceCanceledReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingDisputeEvidenceCanceledReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingDisputeEvidenceCanceledReturnStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Evidence provided when `reason` is 'duplicate'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingDisputeEvidenceDuplicate<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_statement: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. + #[serde(skip_serializing_if = "Option::is_none")] + pub cash_receipt: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub check_image: Option<&'a str>, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. + /// + /// Of the two or more transactions that are copies of each other, this is original undisputed one. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_transaction: Option<&'a str>, +} +impl<'a> CreateIssuingDisputeEvidenceDuplicate<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Evidence provided when `reason` is 'fraudulent'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingDisputeEvidenceFraudulent<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, +} +impl<'a> CreateIssuingDisputeEvidenceFraudulent<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Evidence provided when `reason` is 'merchandise_not_as_described'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingDisputeEvidenceMerchandiseNotAsDescribed<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Date when the product was received. + #[serde(skip_serializing_if = "Option::is_none")] + pub received_at: Option, + /// Description of the cardholder's attempt to return the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_description: Option<&'a str>, + /// Result of cardholder's attempt to return the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_status: Option, + /// Date when the product was returned or attempted to be returned. + #[serde(skip_serializing_if = "Option::is_none")] + pub returned_at: Option, +} +impl<'a> CreateIssuingDisputeEvidenceMerchandiseNotAsDescribed<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Result of cardholder's attempt to return the product. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + MerchantRejected, + Successful, +} +impl CreateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + pub fn as_str(self) -> &'static str { + use CreateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus::*; + match self { + MerchantRejected => "merchant_rejected", + Successful => "successful", + } + } +} + +impl std::str::FromStr for CreateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus::*; + match s { + "merchant_rejected" => Ok(MerchantRejected), + "successful" => Ok(Successful), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Evidence provided when `reason` is 'not_received'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingDisputeEvidenceNotReceived<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Date when the cardholder expected to receive the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_at: Option, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Description of the merchandise or service that was purchased. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Whether the product was a merchandise or service. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_type: Option, +} +impl<'a> CreateIssuingDisputeEvidenceNotReceived<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingDisputeEvidenceNotReceivedProductType { + Merchandise, + Service, +} +impl CreateIssuingDisputeEvidenceNotReceivedProductType { + pub fn as_str(self) -> &'static str { + use CreateIssuingDisputeEvidenceNotReceivedProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for CreateIssuingDisputeEvidenceNotReceivedProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingDisputeEvidenceNotReceivedProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingDisputeEvidenceNotReceivedProductType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingDisputeEvidenceNotReceivedProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingDisputeEvidenceNotReceivedProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingDisputeEvidenceNotReceivedProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Evidence provided when `reason` is 'other'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingDisputeEvidenceOther<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Description of the merchandise or service that was purchased. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Whether the product was a merchandise or service. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_type: Option, +} +impl<'a> CreateIssuingDisputeEvidenceOther<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingDisputeEvidenceOtherProductType { + Merchandise, + Service, +} +impl CreateIssuingDisputeEvidenceOtherProductType { + pub fn as_str(self) -> &'static str { + use CreateIssuingDisputeEvidenceOtherProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for CreateIssuingDisputeEvidenceOtherProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingDisputeEvidenceOtherProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingDisputeEvidenceOtherProductType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingDisputeEvidenceOtherProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingDisputeEvidenceOtherProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingDisputeEvidenceOtherProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The reason for filing the dispute. +/// +/// The evidence should be submitted in the field of the same name. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingDisputeEvidenceReason { + Canceled, + Duplicate, + Fraudulent, + MerchandiseNotAsDescribed, + NotReceived, + Other, + ServiceNotAsDescribed, +} +impl CreateIssuingDisputeEvidenceReason { + pub fn as_str(self) -> &'static str { + use CreateIssuingDisputeEvidenceReason::*; + match self { + Canceled => "canceled", + Duplicate => "duplicate", + Fraudulent => "fraudulent", + MerchandiseNotAsDescribed => "merchandise_not_as_described", + NotReceived => "not_received", + Other => "other", + ServiceNotAsDescribed => "service_not_as_described", + } + } +} + +impl std::str::FromStr for CreateIssuingDisputeEvidenceReason { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingDisputeEvidenceReason::*; + match s { + "canceled" => Ok(Canceled), + "duplicate" => Ok(Duplicate), + "fraudulent" => Ok(Fraudulent), + "merchandise_not_as_described" => Ok(MerchandiseNotAsDescribed), + "not_received" => Ok(NotReceived), + "other" => Ok(Other), + "service_not_as_described" => Ok(ServiceNotAsDescribed), + _ => Err(()), + } + } +} +impl AsRef for CreateIssuingDisputeEvidenceReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateIssuingDisputeEvidenceReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingDisputeEvidenceReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingDisputeEvidenceReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Evidence provided when `reason` is 'service_not_as_described'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingDisputeEvidenceServiceNotAsDescribed<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Date when order was canceled. + #[serde(skip_serializing_if = "Option::is_none")] + pub canceled_at: Option, + /// Reason for canceling the order. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: Option<&'a str>, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Date when the product was received. + #[serde(skip_serializing_if = "Option::is_none")] + pub received_at: Option, +} +impl<'a> CreateIssuingDisputeEvidenceServiceNotAsDescribed<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Params for disputes related to Treasury FinancialAccounts. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingDisputeTreasury<'a> { + /// The ID of the ReceivedDebit to initiate an Issuings dispute for. + pub received_debit: &'a str, +} +impl<'a> CreateIssuingDisputeTreasury<'a> { + pub fn new(received_debit: &'a str) -> Self { + Self { received_debit } + } +} +impl<'a> CreateIssuingDispute<'a> { + /// Creates an Issuing `Dispute` object. + /// + /// Individual pieces of evidence within the `evidence` object are optional at this point. + /// Stripe only validates that required evidence is present during submission. + /// Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/issuing/disputes", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingDispute<'a> { + /// The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Evidence provided for the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub evidence: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateIssuingDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Evidence provided for the dispute. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingDisputeEvidence<'a> { + /// Evidence provided when `reason` is 'canceled'. + #[serde(skip_serializing_if = "Option::is_none")] + pub canceled: Option>, + /// Evidence provided when `reason` is 'duplicate'. + #[serde(skip_serializing_if = "Option::is_none")] + pub duplicate: Option>, + /// Evidence provided when `reason` is 'fraudulent'. + #[serde(skip_serializing_if = "Option::is_none")] + pub fraudulent: Option>, + /// Evidence provided when `reason` is 'merchandise_not_as_described'. + #[serde(skip_serializing_if = "Option::is_none")] + pub merchandise_not_as_described: + Option>, + /// Evidence provided when `reason` is 'not_received'. + #[serde(skip_serializing_if = "Option::is_none")] + pub not_received: Option>, + /// Evidence provided when `reason` is 'other'. + #[serde(skip_serializing_if = "Option::is_none")] + pub other: Option>, + /// The reason for filing the dispute. + /// + /// The evidence should be submitted in the field of the same name. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// Evidence provided when `reason` is 'service_not_as_described'. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_not_as_described: Option>, +} +impl<'a> UpdateIssuingDisputeEvidence<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Evidence provided when `reason` is 'canceled'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingDisputeEvidenceCanceled<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Date when order was canceled. + #[serde(skip_serializing_if = "Option::is_none")] + pub canceled_at: Option, + /// Whether the cardholder was provided with a cancellation policy. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_policy_provided: Option, + /// Reason for canceling the order. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: Option<&'a str>, + /// Date when the cardholder expected to receive the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_at: Option, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Description of the merchandise or service that was purchased. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Whether the product was a merchandise or service. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_type: Option, + /// Result of cardholder's attempt to return the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_status: Option, + /// Date when the product was returned or attempted to be returned. + #[serde(skip_serializing_if = "Option::is_none")] + pub returned_at: Option, +} +impl<'a> UpdateIssuingDisputeEvidenceCanceled<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingDisputeEvidenceCanceledProductType { + Merchandise, + Service, +} +impl UpdateIssuingDisputeEvidenceCanceledProductType { + pub fn as_str(self) -> &'static str { + use UpdateIssuingDisputeEvidenceCanceledProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for UpdateIssuingDisputeEvidenceCanceledProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingDisputeEvidenceCanceledProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingDisputeEvidenceCanceledProductType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingDisputeEvidenceCanceledProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingDisputeEvidenceCanceledProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingDisputeEvidenceCanceledProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Result of cardholder's attempt to return the product. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingDisputeEvidenceCanceledReturnStatus { + MerchantRejected, + Successful, +} +impl UpdateIssuingDisputeEvidenceCanceledReturnStatus { + pub fn as_str(self) -> &'static str { + use UpdateIssuingDisputeEvidenceCanceledReturnStatus::*; + match self { + MerchantRejected => "merchant_rejected", + Successful => "successful", + } + } +} + +impl std::str::FromStr for UpdateIssuingDisputeEvidenceCanceledReturnStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingDisputeEvidenceCanceledReturnStatus::*; + match s { + "merchant_rejected" => Ok(MerchantRejected), + "successful" => Ok(Successful), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingDisputeEvidenceCanceledReturnStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingDisputeEvidenceCanceledReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingDisputeEvidenceCanceledReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingDisputeEvidenceCanceledReturnStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Evidence provided when `reason` is 'duplicate'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingDisputeEvidenceDuplicate<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_statement: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. + #[serde(skip_serializing_if = "Option::is_none")] + pub cash_receipt: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub check_image: Option<&'a str>, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. + /// + /// Of the two or more transactions that are copies of each other, this is original undisputed one. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_transaction: Option<&'a str>, +} +impl<'a> UpdateIssuingDisputeEvidenceDuplicate<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Evidence provided when `reason` is 'fraudulent'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingDisputeEvidenceFraudulent<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, +} +impl<'a> UpdateIssuingDisputeEvidenceFraudulent<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Evidence provided when `reason` is 'merchandise_not_as_described'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribed<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Date when the product was received. + #[serde(skip_serializing_if = "Option::is_none")] + pub received_at: Option, + /// Description of the cardholder's attempt to return the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_description: Option<&'a str>, + /// Result of cardholder's attempt to return the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_status: Option, + /// Date when the product was returned or attempted to be returned. + #[serde(skip_serializing_if = "Option::is_none")] + pub returned_at: Option, +} +impl<'a> UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribed<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Result of cardholder's attempt to return the product. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + MerchantRejected, + Successful, +} +impl UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + pub fn as_str(self) -> &'static str { + use UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus::*; + match self { + MerchantRejected => "merchant_rejected", + Successful => "successful", + } + } +} + +impl std::str::FromStr for UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus::*; + match s { + "merchant_rejected" => Ok(MerchantRejected), + "successful" => Ok(Successful), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Evidence provided when `reason` is 'not_received'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingDisputeEvidenceNotReceived<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Date when the cardholder expected to receive the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_at: Option, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Description of the merchandise or service that was purchased. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Whether the product was a merchandise or service. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_type: Option, +} +impl<'a> UpdateIssuingDisputeEvidenceNotReceived<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingDisputeEvidenceNotReceivedProductType { + Merchandise, + Service, +} +impl UpdateIssuingDisputeEvidenceNotReceivedProductType { + pub fn as_str(self) -> &'static str { + use UpdateIssuingDisputeEvidenceNotReceivedProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for UpdateIssuingDisputeEvidenceNotReceivedProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingDisputeEvidenceNotReceivedProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingDisputeEvidenceNotReceivedProductType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingDisputeEvidenceNotReceivedProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingDisputeEvidenceNotReceivedProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingDisputeEvidenceNotReceivedProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Evidence provided when `reason` is 'other'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingDisputeEvidenceOther<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Description of the merchandise or service that was purchased. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Whether the product was a merchandise or service. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_type: Option, +} +impl<'a> UpdateIssuingDisputeEvidenceOther<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingDisputeEvidenceOtherProductType { + Merchandise, + Service, +} +impl UpdateIssuingDisputeEvidenceOtherProductType { + pub fn as_str(self) -> &'static str { + use UpdateIssuingDisputeEvidenceOtherProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for UpdateIssuingDisputeEvidenceOtherProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingDisputeEvidenceOtherProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingDisputeEvidenceOtherProductType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingDisputeEvidenceOtherProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingDisputeEvidenceOtherProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingDisputeEvidenceOtherProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The reason for filing the dispute. +/// +/// The evidence should be submitted in the field of the same name. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingDisputeEvidenceReason { + Canceled, + Duplicate, + Fraudulent, + MerchandiseNotAsDescribed, + NotReceived, + Other, + ServiceNotAsDescribed, +} +impl UpdateIssuingDisputeEvidenceReason { + pub fn as_str(self) -> &'static str { + use UpdateIssuingDisputeEvidenceReason::*; + match self { + Canceled => "canceled", + Duplicate => "duplicate", + Fraudulent => "fraudulent", + MerchandiseNotAsDescribed => "merchandise_not_as_described", + NotReceived => "not_received", + Other => "other", + ServiceNotAsDescribed => "service_not_as_described", + } + } +} + +impl std::str::FromStr for UpdateIssuingDisputeEvidenceReason { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingDisputeEvidenceReason::*; + match s { + "canceled" => Ok(Canceled), + "duplicate" => Ok(Duplicate), + "fraudulent" => Ok(Fraudulent), + "merchandise_not_as_described" => Ok(MerchandiseNotAsDescribed), + "not_received" => Ok(NotReceived), + "other" => Ok(Other), + "service_not_as_described" => Ok(ServiceNotAsDescribed), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingDisputeEvidenceReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingDisputeEvidenceReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingDisputeEvidenceReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingDisputeEvidenceReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Evidence provided when `reason` is 'service_not_as_described'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingDisputeEvidenceServiceNotAsDescribed<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Date when order was canceled. + #[serde(skip_serializing_if = "Option::is_none")] + pub canceled_at: Option, + /// Reason for canceling the order. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: Option<&'a str>, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Date when the product was received. + #[serde(skip_serializing_if = "Option::is_none")] + pub received_at: Option, +} +impl<'a> UpdateIssuingDisputeEvidenceServiceNotAsDescribed<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateIssuingDispute<'a> { + /// Updates the specified Issuing `Dispute` object by setting the values of the parameters passed. + /// + /// Any parameters not provided will be left unchanged. + /// Properties on the `evidence` object can be unset by passing in an empty string. + pub fn send( + &self, + client: &stripe::Client, + dispute: &stripe_types::dispute::DisputeId, + ) -> stripe::Response { + client.send_form(&format!("/issuing/disputes/{dispute}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveIssuingDispute<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveIssuingDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveIssuingDispute<'a> { + /// Retrieves an Issuing `Dispute` object. + pub fn send( + &self, + client: &stripe::Client, + dispute: &stripe_types::dispute::DisputeId, + ) -> stripe::Response { + client.get_query(&format!("/issuing/disputes/{dispute}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct SubmitIssuingDispute<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> SubmitIssuingDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> SubmitIssuingDispute<'a> { + /// Submits an Issuing `Dispute` to the card network. + /// + /// Stripe validates that all evidence fields required for the dispute’s reason are present. + /// For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). + pub fn send( + &self, + client: &stripe::Client, + dispute: &stripe_types::dispute::DisputeId, + ) -> stripe::Response { + client.send_form( + &format!("/issuing/disputes/{dispute}/submit"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_issuing/src/issuing_dispute_canceled_evidence/mod.rs b/generated/stripe_issuing/src/issuing_dispute_canceled_evidence/mod.rs new file mode 100644 index 000000000..e21808efc --- /dev/null +++ b/generated/stripe_issuing/src/issuing_dispute_canceled_evidence/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_dispute_canceled_evidence::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_dispute_duplicate_evidence/mod.rs b/generated/stripe_issuing/src/issuing_dispute_duplicate_evidence/mod.rs new file mode 100644 index 000000000..020f855b1 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_dispute_duplicate_evidence/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_dispute_duplicate_evidence::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_dispute_evidence/mod.rs b/generated/stripe_issuing/src/issuing_dispute_evidence/mod.rs new file mode 100644 index 000000000..52a15bc21 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_dispute_evidence/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_dispute_evidence::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_dispute_fraudulent_evidence/mod.rs b/generated/stripe_issuing/src/issuing_dispute_fraudulent_evidence/mod.rs new file mode 100644 index 000000000..1a155fff1 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_dispute_fraudulent_evidence/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_dispute_fraudulent_evidence::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_dispute_merchandise_not_as_described_evidence/mod.rs b/generated/stripe_issuing/src/issuing_dispute_merchandise_not_as_described_evidence/mod.rs new file mode 100644 index 000000000..f1e95461e --- /dev/null +++ b/generated/stripe_issuing/src/issuing_dispute_merchandise_not_as_described_evidence/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_dispute_merchandise_not_as_described_evidence::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_dispute_not_received_evidence/mod.rs b/generated/stripe_issuing/src/issuing_dispute_not_received_evidence/mod.rs new file mode 100644 index 000000000..a8075770b --- /dev/null +++ b/generated/stripe_issuing/src/issuing_dispute_not_received_evidence/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_dispute_not_received_evidence::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_dispute_other_evidence/mod.rs b/generated/stripe_issuing/src/issuing_dispute_other_evidence/mod.rs new file mode 100644 index 000000000..aee7490d9 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_dispute_other_evidence/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_dispute_other_evidence::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_dispute_service_not_as_described_evidence/mod.rs b/generated/stripe_issuing/src/issuing_dispute_service_not_as_described_evidence/mod.rs new file mode 100644 index 000000000..328dcde7f --- /dev/null +++ b/generated/stripe_issuing/src/issuing_dispute_service_not_as_described_evidence/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_dispute_service_not_as_described_evidence::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_dispute_treasury/mod.rs b/generated/stripe_issuing/src/issuing_dispute_treasury/mod.rs new file mode 100644 index 000000000..0d75150bf --- /dev/null +++ b/generated/stripe_issuing/src/issuing_dispute_treasury/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_dispute_treasury::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_network_token/mod.rs b/generated/stripe_issuing/src/issuing_network_token/mod.rs new file mode 100644 index 000000000..325002497 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_network_token/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::issuing_network_token::*; +#[cfg(feature = "issuing_network_token")] +mod requests; +#[cfg(feature = "issuing_network_token")] +pub use requests::*; diff --git a/generated/stripe_issuing/src/issuing_network_token/requests.rs b/generated/stripe_issuing/src/issuing_network_token/requests.rs new file mode 100644 index 000000000..600262c13 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_network_token/requests.rs @@ -0,0 +1,212 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListIssuingNetworkToken<'a> { + /// The Issuing card identifier to list tokens for. + pub card: &'a str, + /// Select Issuing tokens that were created during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Select Issuing tokens with the given status. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListIssuingNetworkToken<'a> { + pub fn new(card: &'a str) -> Self { + Self { + card, + created: Default::default(), + ending_before: Default::default(), + expand: Default::default(), + limit: Default::default(), + starting_after: Default::default(), + status: Default::default(), + } + } +} +/// Select Issuing tokens with the given status. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListIssuingNetworkTokenStatus { + Active, + Deleted, + Requested, + Suspended, +} +impl ListIssuingNetworkTokenStatus { + pub fn as_str(self) -> &'static str { + use ListIssuingNetworkTokenStatus::*; + match self { + Active => "active", + Deleted => "deleted", + Requested => "requested", + Suspended => "suspended", + } + } +} + +impl std::str::FromStr for ListIssuingNetworkTokenStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListIssuingNetworkTokenStatus::*; + match s { + "active" => Ok(Active), + "deleted" => Ok(Deleted), + "requested" => Ok(Requested), + "suspended" => Ok(Suspended), + _ => Err(()), + } + } +} +impl AsRef for ListIssuingNetworkTokenStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListIssuingNetworkTokenStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListIssuingNetworkTokenStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListIssuingNetworkTokenStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListIssuingNetworkToken<'a> { + /// Lists all Issuing `Token` objects for a given card. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/issuing/tokens", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/issuing/tokens", self) + } +} +impl<'a> stripe::PaginationParams for ListIssuingNetworkToken<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveIssuingNetworkToken<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveIssuingNetworkToken<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveIssuingNetworkToken<'a> { + /// Retrieves an Issuing `Token` object. + pub fn send( + &self, + client: &stripe::Client, + token: &stripe_types::issuing_network_token::IssuingTokenId, + ) -> stripe::Response { + client.get_query(&format!("/issuing/tokens/{token}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateIssuingNetworkToken<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Specifies which status the token should be updated to. + pub status: UpdateIssuingNetworkTokenStatus, +} +impl<'a> UpdateIssuingNetworkToken<'a> { + pub fn new(status: UpdateIssuingNetworkTokenStatus) -> Self { + Self { expand: Default::default(), status } + } +} +/// Specifies which status the token should be updated to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingNetworkTokenStatus { + Active, + Deleted, + Suspended, +} +impl UpdateIssuingNetworkTokenStatus { + pub fn as_str(self) -> &'static str { + use UpdateIssuingNetworkTokenStatus::*; + match self { + Active => "active", + Deleted => "deleted", + Suspended => "suspended", + } + } +} + +impl std::str::FromStr for UpdateIssuingNetworkTokenStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingNetworkTokenStatus::*; + match s { + "active" => Ok(Active), + "deleted" => Ok(Deleted), + "suspended" => Ok(Suspended), + _ => Err(()), + } + } +} +impl AsRef for UpdateIssuingNetworkTokenStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateIssuingNetworkTokenStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingNetworkTokenStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingNetworkTokenStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateIssuingNetworkToken<'a> { + /// Attempts to update the specified Issuing `Token` object to the status specified. + pub fn send( + &self, + client: &stripe::Client, + token: &stripe_types::issuing_network_token::IssuingTokenId, + ) -> stripe::Response { + client.send_form(&format!("/issuing/tokens/{token}"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_issuing/src/issuing_network_token_address/mod.rs b/generated/stripe_issuing/src/issuing_network_token_address/mod.rs new file mode 100644 index 000000000..1f0505b29 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_network_token_address/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_network_token_address::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_network_token_device/mod.rs b/generated/stripe_issuing/src/issuing_network_token_device/mod.rs new file mode 100644 index 000000000..3ffa0f5a0 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_network_token_device/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_network_token_device::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_network_token_mastercard/mod.rs b/generated/stripe_issuing/src/issuing_network_token_mastercard/mod.rs new file mode 100644 index 000000000..9af53a23f --- /dev/null +++ b/generated/stripe_issuing/src/issuing_network_token_mastercard/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_network_token_mastercard::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_network_token_network_data/mod.rs b/generated/stripe_issuing/src/issuing_network_token_network_data/mod.rs new file mode 100644 index 000000000..3b781ac8e --- /dev/null +++ b/generated/stripe_issuing/src/issuing_network_token_network_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_network_token_network_data::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_network_token_visa/mod.rs b/generated/stripe_issuing/src/issuing_network_token_visa/mod.rs new file mode 100644 index 000000000..1aa632a18 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_network_token_visa/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_network_token_visa::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_network_token_wallet_provider/mod.rs b/generated/stripe_issuing/src/issuing_network_token_wallet_provider/mod.rs new file mode 100644 index 000000000..79fcf8682 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_network_token_wallet_provider/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_network_token_wallet_provider::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_transaction/mod.rs b/generated/stripe_issuing/src/issuing_transaction/mod.rs new file mode 100644 index 000000000..770fa0eba --- /dev/null +++ b/generated/stripe_issuing/src/issuing_transaction/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::issuing_transaction::*; +#[cfg(feature = "issuing_transaction")] +mod requests; +#[cfg(feature = "issuing_transaction")] +pub use requests::*; diff --git a/generated/stripe_issuing/src/issuing_transaction/requests.rs b/generated/stripe_issuing/src/issuing_transaction/requests.rs new file mode 100644 index 000000000..9db355f07 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_transaction/requests.rs @@ -0,0 +1,2924 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListIssuingTransaction<'a> { + /// Only return transactions that belong to the given card. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option<&'a str>, + /// Only return transactions that belong to the given cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub cardholder: Option<&'a str>, + /// Only return transactions that were created during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return transactions that have the given type. + /// + /// One of `capture` or `refund`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> ListIssuingTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Only return transactions that have the given type. +/// +/// One of `capture` or `refund`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListIssuingTransactionType { + Capture, + Refund, +} +impl ListIssuingTransactionType { + pub fn as_str(self) -> &'static str { + use ListIssuingTransactionType::*; + match self { + Capture => "capture", + Refund => "refund", + } + } +} + +impl std::str::FromStr for ListIssuingTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListIssuingTransactionType::*; + match s { + "capture" => Ok(Capture), + "refund" => Ok(Refund), + _ => Err(()), + } + } +} +impl AsRef for ListIssuingTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListIssuingTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListIssuingTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListIssuingTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListIssuingTransaction<'a> { + /// Returns a list of Issuing `Transaction` objects. + /// + /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/issuing/transactions", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/issuing/transactions", self) + } +} +impl<'a> stripe::PaginationParams for ListIssuingTransaction<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveIssuingTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveIssuingTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveIssuingTransaction<'a> { + /// Retrieves an Issuing `Transaction` object. + pub fn send( + &self, + client: &stripe::Client, + transaction: &str, + ) -> stripe::Response { + client.get_query(&format!("/issuing/transactions/{transaction}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateIssuingTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateIssuingTransaction<'a> { + /// Updates the specified Issuing `Transaction` object by setting the values of the parameters passed. + /// + /// Any parameters not provided will be left unchanged. + pub fn send( + &self, + client: &stripe::Client, + transaction: &str, + ) -> stripe::Response { + client.send_form( + &format!("/issuing/transactions/{transaction}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateForceCaptureIssuingTransaction<'a> { + /// The total amount to attempt to capture. + /// + /// This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Card associated with this transaction. + pub card: &'a str, + /// The currency of the capture. + /// + /// If not provided, defaults to the currency of the card. + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. + #[serde(skip_serializing_if = "Option::is_none")] + pub merchant_data: Option>, + /// Additional purchase information that is optionally provided by the merchant. + #[serde(skip_serializing_if = "Option::is_none")] + pub purchase_details: Option>, +} +impl<'a> CreateForceCaptureIssuingTransaction<'a> { + pub fn new(amount: i64, card: &'a str) -> Self { + Self { + amount, + card, + currency: Default::default(), + expand: Default::default(), + merchant_data: Default::default(), + purchase_details: Default::default(), + } + } +} +/// Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateForceCaptureIssuingTransactionMerchantData<'a> { + /// A categorization of the seller's type of business. + /// + /// See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. + #[serde(skip_serializing_if = "Option::is_none")] + pub category: Option, + /// City where the seller is located. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Country where the seller is located. + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Name of the seller. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Identifier assigned to the seller by the card network. + /// + /// Different card networks may assign different network_id fields to the same merchant. + #[serde(skip_serializing_if = "Option::is_none")] + pub network_id: Option<&'a str>, + /// Postal code where the seller is located. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State where the seller is located. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// An ID assigned by the seller to the location of the sale. + #[serde(skip_serializing_if = "Option::is_none")] + pub terminal_id: Option<&'a str>, + /// URL provided by the merchant on a 3DS request. + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option<&'a str>, +} +impl<'a> CreateForceCaptureIssuingTransactionMerchantData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A categorization of the seller's type of business. +/// +/// See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateForceCaptureIssuingTransactionMerchantDataCategory { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateForceCaptureIssuingTransactionMerchantDataCategory { + pub fn as_str(self) -> &'static str { + use CreateForceCaptureIssuingTransactionMerchantDataCategory::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateForceCaptureIssuingTransactionMerchantDataCategory { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateForceCaptureIssuingTransactionMerchantDataCategory::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for CreateForceCaptureIssuingTransactionMerchantDataCategory { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateForceCaptureIssuingTransactionMerchantDataCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateForceCaptureIssuingTransactionMerchantDataCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateForceCaptureIssuingTransactionMerchantDataCategory { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional purchase information that is optionally provided by the merchant. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateForceCaptureIssuingTransactionPurchaseDetails<'a> { + /// Information about the flight that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub flight: Option>, + /// Information about fuel that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub fuel: Option>, + /// Information about lodging that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub lodging: Option, + /// The line items in the purchase. + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt: Option<&'a [CreateForceCaptureIssuingTransactionPurchaseDetailsReceipt<'a>]>, + /// A merchant-specific order number. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, +} +impl<'a> CreateForceCaptureIssuingTransactionPurchaseDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about the flight that was purchased with this transaction. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateForceCaptureIssuingTransactionPurchaseDetailsFlight<'a> { + /// The time that the flight departed. + #[serde(skip_serializing_if = "Option::is_none")] + pub departure_at: Option, + /// The name of the passenger. + #[serde(skip_serializing_if = "Option::is_none")] + pub passenger_name: Option<&'a str>, + /// Whether the ticket is refundable. + #[serde(skip_serializing_if = "Option::is_none")] + pub refundable: Option, + /// The legs of the trip. + #[serde(skip_serializing_if = "Option::is_none")] + pub segments: + Option<&'a [CreateForceCaptureIssuingTransactionPurchaseDetailsFlightSegments<'a>]>, + /// The travel agency that issued the ticket. + #[serde(skip_serializing_if = "Option::is_none")] + pub travel_agency: Option<&'a str>, +} +impl<'a> CreateForceCaptureIssuingTransactionPurchaseDetailsFlight<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The legs of the trip. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateForceCaptureIssuingTransactionPurchaseDetailsFlightSegments<'a> { + /// The three-letter IATA airport code of the flight's destination. + #[serde(skip_serializing_if = "Option::is_none")] + pub arrival_airport_code: Option<&'a str>, + /// The airline carrier code. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// The three-letter IATA airport code that the flight departed from. + #[serde(skip_serializing_if = "Option::is_none")] + pub departure_airport_code: Option<&'a str>, + /// The flight number. + #[serde(skip_serializing_if = "Option::is_none")] + pub flight_number: Option<&'a str>, + /// The flight's service class. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_class: Option<&'a str>, + /// Whether a stopover is allowed on this flight. + #[serde(skip_serializing_if = "Option::is_none")] + pub stopover_allowed: Option, +} +impl<'a> CreateForceCaptureIssuingTransactionPurchaseDetailsFlightSegments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about fuel that was purchased with this transaction. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateForceCaptureIssuingTransactionPurchaseDetailsFuel<'a> { + /// The type of fuel that was purchased. + /// + /// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// The units for `volume_decimal`. + /// + /// One of `us_gallon` or `liter`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit: Option, + /// The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_cost_decimal: Option<&'a str>, + /// The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. + #[serde(skip_serializing_if = "Option::is_none")] + pub volume_decimal: Option<&'a str>, +} +impl<'a> CreateForceCaptureIssuingTransactionPurchaseDetailsFuel<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of fuel that was purchased. +/// +/// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateForceCaptureIssuingTransactionPurchaseDetailsFuelType { + Diesel, + Other, + UnleadedPlus, + UnleadedRegular, + UnleadedSuper, +} +impl CreateForceCaptureIssuingTransactionPurchaseDetailsFuelType { + pub fn as_str(self) -> &'static str { + use CreateForceCaptureIssuingTransactionPurchaseDetailsFuelType::*; + match self { + Diesel => "diesel", + Other => "other", + UnleadedPlus => "unleaded_plus", + UnleadedRegular => "unleaded_regular", + UnleadedSuper => "unleaded_super", + } + } +} + +impl std::str::FromStr for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateForceCaptureIssuingTransactionPurchaseDetailsFuelType::*; + match s { + "diesel" => Ok(Diesel), + "other" => Ok(Other), + "unleaded_plus" => Ok(UnleadedPlus), + "unleaded_regular" => Ok(UnleadedRegular), + "unleaded_super" => Ok(UnleadedSuper), + _ => Err(()), + } + } +} +impl AsRef for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The units for `volume_decimal`. +/// +/// One of `us_gallon` or `liter`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateForceCaptureIssuingTransactionPurchaseDetailsFuelUnit { + Liter, + UsGallon, +} +impl CreateForceCaptureIssuingTransactionPurchaseDetailsFuelUnit { + pub fn as_str(self) -> &'static str { + use CreateForceCaptureIssuingTransactionPurchaseDetailsFuelUnit::*; + match self { + Liter => "liter", + UsGallon => "us_gallon", + } + } +} + +impl std::str::FromStr for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateForceCaptureIssuingTransactionPurchaseDetailsFuelUnit::*; + match s { + "liter" => Ok(Liter), + "us_gallon" => Ok(UsGallon), + _ => Err(()), + } + } +} +impl AsRef for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelUnit { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about lodging that was purchased with this transaction. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateForceCaptureIssuingTransactionPurchaseDetailsLodging { + /// The time of checking into the lodging. + #[serde(skip_serializing_if = "Option::is_none")] + pub check_in_at: Option, + /// The number of nights stayed at the lodging. + #[serde(skip_serializing_if = "Option::is_none")] + pub nights: Option, +} +impl CreateForceCaptureIssuingTransactionPurchaseDetailsLodging { + pub fn new() -> Self { + Self::default() + } +} +/// The line items in the purchase. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateForceCaptureIssuingTransactionPurchaseDetailsReceipt<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub total: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_cost: Option, +} +impl<'a> CreateForceCaptureIssuingTransactionPurchaseDetailsReceipt<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateForceCaptureIssuingTransaction<'a> { + /// Allows the user to capture an arbitrary amount, also known as a forced capture. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form( + "/test_helpers/issuing/transactions/create_force_capture", + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateUnlinkedRefundIssuingTransaction<'a> { + /// The total amount to attempt to refund. + /// + /// This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Card associated with this unlinked refund transaction. + pub card: &'a str, + /// The currency of the unlinked refund. + /// + /// If not provided, defaults to the currency of the card. + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. + #[serde(skip_serializing_if = "Option::is_none")] + pub merchant_data: Option>, + /// Additional purchase information that is optionally provided by the merchant. + #[serde(skip_serializing_if = "Option::is_none")] + pub purchase_details: Option>, +} +impl<'a> CreateUnlinkedRefundIssuingTransaction<'a> { + pub fn new(amount: i64, card: &'a str) -> Self { + Self { + amount, + card, + currency: Default::default(), + expand: Default::default(), + merchant_data: Default::default(), + purchase_details: Default::default(), + } + } +} +/// Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateUnlinkedRefundIssuingTransactionMerchantData<'a> { + /// A categorization of the seller's type of business. + /// + /// See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. + #[serde(skip_serializing_if = "Option::is_none")] + pub category: Option, + /// City where the seller is located. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Country where the seller is located. + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Name of the seller. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Identifier assigned to the seller by the card network. + /// + /// Different card networks may assign different network_id fields to the same merchant. + #[serde(skip_serializing_if = "Option::is_none")] + pub network_id: Option<&'a str>, + /// Postal code where the seller is located. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State where the seller is located. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// An ID assigned by the seller to the location of the sale. + #[serde(skip_serializing_if = "Option::is_none")] + pub terminal_id: Option<&'a str>, + /// URL provided by the merchant on a 3DS request. + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option<&'a str>, +} +impl<'a> CreateUnlinkedRefundIssuingTransactionMerchantData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A categorization of the seller's type of business. +/// +/// See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateUnlinkedRefundIssuingTransactionMerchantDataCategory { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateUnlinkedRefundIssuingTransactionMerchantDataCategory { + pub fn as_str(self) -> &'static str { + use CreateUnlinkedRefundIssuingTransactionMerchantDataCategory::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateUnlinkedRefundIssuingTransactionMerchantDataCategory { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateUnlinkedRefundIssuingTransactionMerchantDataCategory::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for CreateUnlinkedRefundIssuingTransactionMerchantDataCategory { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateUnlinkedRefundIssuingTransactionMerchantDataCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateUnlinkedRefundIssuingTransactionMerchantDataCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateUnlinkedRefundIssuingTransactionMerchantDataCategory { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional purchase information that is optionally provided by the merchant. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateUnlinkedRefundIssuingTransactionPurchaseDetails<'a> { + /// Information about the flight that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub flight: Option>, + /// Information about fuel that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub fuel: Option>, + /// Information about lodging that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub lodging: Option, + /// The line items in the purchase. + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt: Option<&'a [CreateUnlinkedRefundIssuingTransactionPurchaseDetailsReceipt<'a>]>, + /// A merchant-specific order number. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, +} +impl<'a> CreateUnlinkedRefundIssuingTransactionPurchaseDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about the flight that was purchased with this transaction. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFlight<'a> { + /// The time that the flight departed. + #[serde(skip_serializing_if = "Option::is_none")] + pub departure_at: Option, + /// The name of the passenger. + #[serde(skip_serializing_if = "Option::is_none")] + pub passenger_name: Option<&'a str>, + /// Whether the ticket is refundable. + #[serde(skip_serializing_if = "Option::is_none")] + pub refundable: Option, + /// The legs of the trip. + #[serde(skip_serializing_if = "Option::is_none")] + pub segments: + Option<&'a [CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFlightSegments<'a>]>, + /// The travel agency that issued the ticket. + #[serde(skip_serializing_if = "Option::is_none")] + pub travel_agency: Option<&'a str>, +} +impl<'a> CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFlight<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The legs of the trip. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFlightSegments<'a> { + /// The three-letter IATA airport code of the flight's destination. + #[serde(skip_serializing_if = "Option::is_none")] + pub arrival_airport_code: Option<&'a str>, + /// The airline carrier code. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// The three-letter IATA airport code that the flight departed from. + #[serde(skip_serializing_if = "Option::is_none")] + pub departure_airport_code: Option<&'a str>, + /// The flight number. + #[serde(skip_serializing_if = "Option::is_none")] + pub flight_number: Option<&'a str>, + /// The flight's service class. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_class: Option<&'a str>, + /// Whether a stopover is allowed on this flight. + #[serde(skip_serializing_if = "Option::is_none")] + pub stopover_allowed: Option, +} +impl<'a> CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFlightSegments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about fuel that was purchased with this transaction. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuel<'a> { + /// The type of fuel that was purchased. + /// + /// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// The units for `volume_decimal`. + /// + /// One of `us_gallon` or `liter`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit: Option, + /// The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_cost_decimal: Option<&'a str>, + /// The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. + #[serde(skip_serializing_if = "Option::is_none")] + pub volume_decimal: Option<&'a str>, +} +impl<'a> CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuel<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of fuel that was purchased. +/// +/// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelType { + Diesel, + Other, + UnleadedPlus, + UnleadedRegular, + UnleadedSuper, +} +impl CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelType { + pub fn as_str(self) -> &'static str { + use CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelType::*; + match self { + Diesel => "diesel", + Other => "other", + UnleadedPlus => "unleaded_plus", + UnleadedRegular => "unleaded_regular", + UnleadedSuper => "unleaded_super", + } + } +} + +impl std::str::FromStr for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelType::*; + match s { + "diesel" => Ok(Diesel), + "other" => Ok(Other), + "unleaded_plus" => Ok(UnleadedPlus), + "unleaded_regular" => Ok(UnleadedRegular), + "unleaded_super" => Ok(UnleadedSuper), + _ => Err(()), + } + } +} +impl AsRef for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The units for `volume_decimal`. +/// +/// One of `us_gallon` or `liter`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelUnit { + Liter, + UsGallon, +} +impl CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelUnit { + pub fn as_str(self) -> &'static str { + use CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelUnit::*; + match self { + Liter => "liter", + UsGallon => "us_gallon", + } + } +} + +impl std::str::FromStr for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelUnit::*; + match s { + "liter" => Ok(Liter), + "us_gallon" => Ok(UsGallon), + _ => Err(()), + } + } +} +impl AsRef for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelUnit { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about lodging that was purchased with this transaction. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateUnlinkedRefundIssuingTransactionPurchaseDetailsLodging { + /// The time of checking into the lodging. + #[serde(skip_serializing_if = "Option::is_none")] + pub check_in_at: Option, + /// The number of nights stayed at the lodging. + #[serde(skip_serializing_if = "Option::is_none")] + pub nights: Option, +} +impl CreateUnlinkedRefundIssuingTransactionPurchaseDetailsLodging { + pub fn new() -> Self { + Self::default() + } +} +/// The line items in the purchase. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateUnlinkedRefundIssuingTransactionPurchaseDetailsReceipt<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub total: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_cost: Option, +} +impl<'a> CreateUnlinkedRefundIssuingTransactionPurchaseDetailsReceipt<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateUnlinkedRefundIssuingTransaction<'a> { + /// Allows the user to refund an arbitrary amount, also known as a unlinked refund. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form( + "/test_helpers/issuing/transactions/create_unlinked_refund", + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RefundIssuingTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The total amount to attempt to refund. + /// + /// This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_amount: Option, +} +impl<'a> RefundIssuingTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RefundIssuingTransaction<'a> { + /// Refund a test-mode Transaction. + pub fn send( + &self, + client: &stripe::Client, + transaction: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/transactions/{transaction}/refund"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_issuing/src/issuing_transaction_amount_details/mod.rs b/generated/stripe_issuing/src/issuing_transaction_amount_details/mod.rs new file mode 100644 index 000000000..74d7a44d3 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_transaction_amount_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_transaction_amount_details::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_transaction_flight_data/mod.rs b/generated/stripe_issuing/src/issuing_transaction_flight_data/mod.rs new file mode 100644 index 000000000..2a66e6ed2 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_transaction_flight_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_transaction_flight_data::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_transaction_flight_data_leg/mod.rs b/generated/stripe_issuing/src/issuing_transaction_flight_data_leg/mod.rs new file mode 100644 index 000000000..924234327 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_transaction_flight_data_leg/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_transaction_flight_data_leg::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_transaction_fuel_data/mod.rs b/generated/stripe_issuing/src/issuing_transaction_fuel_data/mod.rs new file mode 100644 index 000000000..f5318d666 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_transaction_fuel_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_transaction_fuel_data::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_transaction_lodging_data/mod.rs b/generated/stripe_issuing/src/issuing_transaction_lodging_data/mod.rs new file mode 100644 index 000000000..9a553e049 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_transaction_lodging_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_transaction_lodging_data::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_transaction_network_data/mod.rs b/generated/stripe_issuing/src/issuing_transaction_network_data/mod.rs new file mode 100644 index 000000000..92e415cce --- /dev/null +++ b/generated/stripe_issuing/src/issuing_transaction_network_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_transaction_network_data::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_transaction_purchase_details/mod.rs b/generated/stripe_issuing/src/issuing_transaction_purchase_details/mod.rs new file mode 100644 index 000000000..d8fa403ac --- /dev/null +++ b/generated/stripe_issuing/src/issuing_transaction_purchase_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_transaction_purchase_details::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_transaction_receipt_data/mod.rs b/generated/stripe_issuing/src/issuing_transaction_receipt_data/mod.rs new file mode 100644 index 000000000..cab8b5572 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_transaction_receipt_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_transaction_receipt_data::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/issuing_transaction_treasury/mod.rs b/generated/stripe_issuing/src/issuing_transaction_treasury/mod.rs new file mode 100644 index 000000000..23dc16288 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_transaction_treasury/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::issuing_transaction_treasury::*; \ No newline at end of file diff --git a/generated/stripe_issuing/src/mod.rs b/generated/stripe_issuing/src/mod.rs new file mode 100644 index 000000000..6565d0aa1 --- /dev/null +++ b/generated/stripe_issuing/src/mod.rs @@ -0,0 +1,76 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::invalid_html_tags)] +extern crate self as stripe_issuing; +pub use stripe_types::CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructions; +pub use stripe_types::FundingInstructionsBankTransfer; +pub use stripe_types::FundingInstructionsBankTransferAbaRecord; +pub use stripe_types::FundingInstructionsBankTransferFinancialAddress; +pub use stripe_types::FundingInstructionsBankTransferIbanRecord; +pub use stripe_types::FundingInstructionsBankTransferSortCodeRecord; +pub use stripe_types::FundingInstructionsBankTransferSpeiRecord; +pub use stripe_types::FundingInstructionsBankTransferSwiftRecord; +pub use stripe_types::FundingInstructionsBankTransferZenginRecord; +pub use stripe_types::IssuingAuthorization; +pub mod issuing_authorization; +pub use stripe_types::IssuingCard; +pub mod issuing_card; +pub use stripe_types::IssuingCardholder; +pub mod issuing_cardholder; +pub use stripe_types::IssuingDispute; +pub mod issuing_dispute; +pub use stripe_types::IssuingNetworkToken; +pub mod issuing_network_token; +pub use stripe_types::IssuingTransaction; +pub mod issuing_transaction; +pub use stripe_types::IssuingAuthorizationAmountDetails; +pub use stripe_types::IssuingAuthorizationAuthenticationExemption; +pub use stripe_types::IssuingAuthorizationMerchantData; +pub use stripe_types::IssuingAuthorizationNetworkData; +pub use stripe_types::IssuingAuthorizationPendingRequest; +pub use stripe_types::IssuingAuthorizationRequest; +pub use stripe_types::IssuingAuthorizationThreeDSecure; +pub use stripe_types::IssuingAuthorizationTreasury; +pub use stripe_types::IssuingAuthorizationVerificationData; +pub use stripe_types::IssuingCardApplePay; +pub use stripe_types::IssuingCardAuthorizationControls; +pub use stripe_types::IssuingCardGooglePay; +pub use stripe_types::IssuingCardShipping; +pub use stripe_types::IssuingCardShippingCustoms; +pub use stripe_types::IssuingCardSpendingLimit; +pub use stripe_types::IssuingCardWallets; +pub use stripe_types::IssuingCardholderAddress; +pub use stripe_types::IssuingCardholderAuthorizationControls; +pub use stripe_types::IssuingCardholderCardIssuing; +pub use stripe_types::IssuingCardholderCompany; +pub use stripe_types::IssuingCardholderIdDocument; +pub use stripe_types::IssuingCardholderIndividual; +pub use stripe_types::IssuingCardholderIndividualDob; +pub use stripe_types::IssuingCardholderRequirements; +pub use stripe_types::IssuingCardholderSpendingLimit; +pub use stripe_types::IssuingCardholderUserTermsAcceptance; +pub use stripe_types::IssuingCardholderVerification; +pub use stripe_types::IssuingDisputeCanceledEvidence; +pub use stripe_types::IssuingDisputeDuplicateEvidence; +pub use stripe_types::IssuingDisputeEvidence; +pub use stripe_types::IssuingDisputeFraudulentEvidence; +pub use stripe_types::IssuingDisputeMerchandiseNotAsDescribedEvidence; +pub use stripe_types::IssuingDisputeNotReceivedEvidence; +pub use stripe_types::IssuingDisputeOtherEvidence; +pub use stripe_types::IssuingDisputeServiceNotAsDescribedEvidence; +pub use stripe_types::IssuingDisputeTreasury; +pub use stripe_types::IssuingNetworkTokenAddress; +pub use stripe_types::IssuingNetworkTokenDevice; +pub use stripe_types::IssuingNetworkTokenMastercard; +pub use stripe_types::IssuingNetworkTokenNetworkData; +pub use stripe_types::IssuingNetworkTokenVisa; +pub use stripe_types::IssuingNetworkTokenWalletProvider; +pub use stripe_types::IssuingTransactionAmountDetails; +pub use stripe_types::IssuingTransactionFlightData; +pub use stripe_types::IssuingTransactionFlightDataLeg; +pub use stripe_types::IssuingTransactionFuelData; +pub use stripe_types::IssuingTransactionLodgingData; +pub use stripe_types::IssuingTransactionNetworkData; +pub use stripe_types::IssuingTransactionPurchaseDetails; +pub use stripe_types::IssuingTransactionReceiptData; +pub use stripe_types::IssuingTransactionTreasury; diff --git a/generated/stripe_misc/Cargo.toml b/generated/stripe_misc/Cargo.toml new file mode 100644 index 000000000..f7ec937ce --- /dev/null +++ b/generated/stripe_misc/Cargo.toml @@ -0,0 +1,69 @@ +[package] +name = "stripe_misc" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + +[dependencies] +serde.workspace = true +http-types.workspace = true +smol_str.workspace = true +serde_json.workspace = true +async-stripe = {path = "../../async-stripe"} + +stripe_types = {path = "../../stripe_types"} + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +apple_pay_domain = [] +bank_connections_resource_link_account_session = [] +bank_connections_resource_linked_account = [] +ephemeral_key = [] +exchange_rate = [] +gelato_verification_report = [] +gelato_verification_session = [] +notification_webhook_endpoint = [] +reporting_report_run = [] +reporting_report_type = [] +scheduled_query_run = [] +tax_product_registrations_resource_tax_registration = [] +tax_product_resource_tax_calculation = [] +tax_product_resource_tax_settings = [] +tax_product_resource_tax_transaction = [] + +full = ["apple_pay_domain", +"bank_connections_resource_link_account_session", +"bank_connections_resource_linked_account", +"ephemeral_key", +"exchange_rate", +"gelato_verification_report", +"gelato_verification_session", +"notification_webhook_endpoint", +"reporting_report_run", +"reporting_report_type", +"scheduled_query_run", +"tax_product_registrations_resource_tax_registration", +"tax_product_resource_tax_calculation", +"tax_product_resource_tax_settings", +"tax_product_resource_tax_transaction"] + diff --git a/generated/stripe_misc/src/apple_pay_domain/mod.rs b/generated/stripe_misc/src/apple_pay_domain/mod.rs new file mode 100644 index 000000000..dba1853b3 --- /dev/null +++ b/generated/stripe_misc/src/apple_pay_domain/mod.rs @@ -0,0 +1,23 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ApplePayDomain { + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + pub domain_name: String, + /// Unique identifier for the object. + pub id: stripe_misc::apple_pay_domain::ApplePayDomainId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, +} +impl stripe_types::Object for ApplePayDomain { + type Id = stripe_misc::apple_pay_domain::ApplePayDomainId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(ApplePayDomainId); +#[cfg(feature = "apple_pay_domain")] +mod requests; +#[cfg(feature = "apple_pay_domain")] +pub use requests::*; diff --git a/generated/stripe_misc/src/apple_pay_domain/requests.rs b/generated/stripe_misc/src/apple_pay_domain/requests.rs new file mode 100644 index 000000000..25df6f84e --- /dev/null +++ b/generated/stripe_misc/src/apple_pay_domain/requests.rs @@ -0,0 +1,99 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListApplePayDomain<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub domain_name: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListApplePayDomain<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListApplePayDomain<'a> { + /// List apple pay domains. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/apple_pay/domains", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/apple_pay/domains", self) + } +} +impl<'a> stripe::PaginationParams for ListApplePayDomain<'a> {} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateApplePayDomain<'a> { + pub domain_name: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CreateApplePayDomain<'a> { + pub fn new(domain_name: &'a str) -> Self { + Self { domain_name, expand: Default::default() } + } +} +impl<'a> CreateApplePayDomain<'a> { + /// Create an apple pay domain. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/apple_pay/domains", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveApplePayDomain<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveApplePayDomain<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveApplePayDomain<'a> { + /// Retrieve an apple pay domain. + pub fn send( + &self, + client: &stripe::Client, + domain: &str, + ) -> stripe::Response { + client.get_query(&format!("/apple_pay/domains/{domain}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteApplePayDomain {} +impl DeleteApplePayDomain { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteApplePayDomain { + /// Delete an apple pay domain. + pub fn send( + &self, + client: &stripe::Client, + domain: &str, + ) -> stripe::Response { + client.send_form(&format!("/apple_pay/domains/{domain}"), self, http_types::Method::Delete) + } +} diff --git a/generated/stripe_misc/src/bank_connections_resource_accountholder/mod.rs b/generated/stripe_misc/src/bank_connections_resource_accountholder/mod.rs new file mode 100644 index 000000000..63553617c --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_accountholder/mod.rs @@ -0,0 +1,76 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceAccountholder { + /// The ID of the Stripe account this account belongs to. + /// + /// Should only be present if `account_holder.type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option>, + /// ID of the Stripe customer this account belongs to. + /// + /// Present if and only if `account_holder.type` is `customer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option>, + /// Type of account holder that this account belongs to. + #[serde(rename = "type")] + pub type_: BankConnectionsResourceAccountholderType, +} +/// Type of account holder that this account belongs to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankConnectionsResourceAccountholderType { + Account, + Customer, +} +impl BankConnectionsResourceAccountholderType { + pub fn as_str(self) -> &'static str { + use BankConnectionsResourceAccountholderType::*; + match self { + Account => "account", + Customer => "customer", + } + } +} + +impl std::str::FromStr for BankConnectionsResourceAccountholderType { + type Err = (); + fn from_str(s: &str) -> Result { + use BankConnectionsResourceAccountholderType::*; + match s { + "account" => Ok(Account), + "customer" => Ok(Customer), + _ => Err(()), + } + } +} +impl AsRef for BankConnectionsResourceAccountholderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for BankConnectionsResourceAccountholderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankConnectionsResourceAccountholderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankConnectionsResourceAccountholderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BankConnectionsResourceAccountholderType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for BankConnectionsResourceAccountholderType") + }) + } +} diff --git a/generated/stripe_misc/src/bank_connections_resource_balance/mod.rs b/generated/stripe_misc/src/bank_connections_resource_balance/mod.rs new file mode 100644 index 000000000..0a785420f --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_balance/mod.rs @@ -0,0 +1,87 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceBalance { + /// The time that the external institution calculated this balance. + /// + /// Measured in seconds since the Unix epoch. + pub as_of: stripe_types::Timestamp, + #[serde(skip_serializing_if = "Option::is_none")] + pub cash: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub credit: Option, + /// The balances owed to (or by) the account holder. + /// + /// Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Each value is a integer amount. + /// + /// A positive amount indicates money owed to the account holder. + /// A negative amount indicates money owed by the account holder. + pub current: std::collections::HashMap, + /// The `type` of the balance. + /// + /// An additional hash is included on the balance with a name matching this value. + #[serde(rename = "type")] + pub type_: BankConnectionsResourceBalanceType, +} +/// The `type` of the balance. +/// +/// An additional hash is included on the balance with a name matching this value. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankConnectionsResourceBalanceType { + Cash, + Credit, +} +impl BankConnectionsResourceBalanceType { + pub fn as_str(self) -> &'static str { + use BankConnectionsResourceBalanceType::*; + match self { + Cash => "cash", + Credit => "credit", + } + } +} + +impl std::str::FromStr for BankConnectionsResourceBalanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use BankConnectionsResourceBalanceType::*; + match s { + "cash" => Ok(Cash), + "credit" => Ok(Credit), + _ => Err(()), + } + } +} +impl AsRef for BankConnectionsResourceBalanceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for BankConnectionsResourceBalanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankConnectionsResourceBalanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankConnectionsResourceBalanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BankConnectionsResourceBalanceType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for BankConnectionsResourceBalanceType") + }) + } +} diff --git a/generated/stripe_misc/src/bank_connections_resource_balance_api_resource_cash_balance/mod.rs b/generated/stripe_misc/src/bank_connections_resource_balance_api_resource_cash_balance/mod.rs new file mode 100644 index 000000000..eefa57a40 --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_balance_api_resource_cash_balance/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceBalanceApiResourceCashBalance { + /// The funds available to the account holder. + /// + /// Typically this is the current balance less any holds. Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Each value is a integer amount. + /// A positive amount indicates money owed to the account holder. + /// A negative amount indicates money owed by the account holder. + pub available: Option>, +} diff --git a/generated/stripe_misc/src/bank_connections_resource_balance_api_resource_credit_balance/mod.rs b/generated/stripe_misc/src/bank_connections_resource_balance_api_resource_credit_balance/mod.rs new file mode 100644 index 000000000..41575cf5c --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_balance_api_resource_credit_balance/mod.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceBalanceApiResourceCreditBalance { + /// The credit that has been used by the account holder. + /// + /// Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Each value is a integer amount. + /// + /// A positive amount indicates money owed to the account holder. + /// A negative amount indicates money owed by the account holder. + pub used: Option>, +} diff --git a/generated/stripe_misc/src/bank_connections_resource_balance_refresh/mod.rs b/generated/stripe_misc/src/bank_connections_resource_balance_refresh/mod.rs new file mode 100644 index 000000000..6d480a55e --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_balance_refresh/mod.rs @@ -0,0 +1,74 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceBalanceRefresh { + /// The time at which the last refresh attempt was initiated. + /// + /// Measured in seconds since the Unix epoch. + pub last_attempted_at: stripe_types::Timestamp, + /// The status of the last refresh attempt. + pub status: BankConnectionsResourceBalanceRefreshStatus, +} +/// The status of the last refresh attempt. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankConnectionsResourceBalanceRefreshStatus { + Failed, + Pending, + Succeeded, +} +impl BankConnectionsResourceBalanceRefreshStatus { + pub fn as_str(self) -> &'static str { + use BankConnectionsResourceBalanceRefreshStatus::*; + match self { + Failed => "failed", + Pending => "pending", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for BankConnectionsResourceBalanceRefreshStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use BankConnectionsResourceBalanceRefreshStatus::*; + match s { + "failed" => Ok(Failed), + "pending" => Ok(Pending), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl AsRef for BankConnectionsResourceBalanceRefreshStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for BankConnectionsResourceBalanceRefreshStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankConnectionsResourceBalanceRefreshStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankConnectionsResourceBalanceRefreshStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BankConnectionsResourceBalanceRefreshStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for BankConnectionsResourceBalanceRefreshStatus", + ) + }) + } +} diff --git a/generated/stripe_misc/src/bank_connections_resource_link_account_session/mod.rs b/generated/stripe_misc/src/bank_connections_resource_link_account_session/mod.rs new file mode 100644 index 000000000..84ec59a21 --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_link_account_session/mod.rs @@ -0,0 +1,170 @@ +/// A Financial Connections Session is the secure way to programmatically launch the client-side Stripe.js modal that lets your users link their accounts. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceLinkAccountSession { + /// The account holder for whom accounts are collected in this session. + pub account_holder: Option, + /// The accounts that were collected as part of this Session. + pub accounts: stripe_types::List, + /// A value that will be passed to the client to launch the authentication flow. + pub client_secret: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option, + /// Unique identifier for the object. + pub id: + stripe_misc::bank_connections_resource_link_account_session::FinancialConnectionsSessionId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Permissions requested for accounts collected during this session. + pub permissions: Vec, + /// Data features requested to be retrieved upon account creation. + pub prefetch: Option>, + /// For webview integrations only. + /// + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option, +} +/// Permissions requested for accounts collected during this session. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankConnectionsResourceLinkAccountSessionPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl BankConnectionsResourceLinkAccountSessionPermissions { + pub fn as_str(self) -> &'static str { + use BankConnectionsResourceLinkAccountSessionPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for BankConnectionsResourceLinkAccountSessionPermissions { + type Err = (); + fn from_str(s: &str) -> Result { + use BankConnectionsResourceLinkAccountSessionPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl AsRef for BankConnectionsResourceLinkAccountSessionPermissions { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for BankConnectionsResourceLinkAccountSessionPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankConnectionsResourceLinkAccountSessionPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankConnectionsResourceLinkAccountSessionPermissions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BankConnectionsResourceLinkAccountSessionPermissions { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for BankConnectionsResourceLinkAccountSessionPermissions", + ) + }) + } +} +/// Data features requested to be retrieved upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankConnectionsResourceLinkAccountSessionPrefetch { + Balances, + Ownership, +} +impl BankConnectionsResourceLinkAccountSessionPrefetch { + pub fn as_str(self) -> &'static str { + use BankConnectionsResourceLinkAccountSessionPrefetch::*; + match self { + Balances => "balances", + Ownership => "ownership", + } + } +} + +impl std::str::FromStr for BankConnectionsResourceLinkAccountSessionPrefetch { + type Err = (); + fn from_str(s: &str) -> Result { + use BankConnectionsResourceLinkAccountSessionPrefetch::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + _ => Err(()), + } + } +} +impl AsRef for BankConnectionsResourceLinkAccountSessionPrefetch { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for BankConnectionsResourceLinkAccountSessionPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankConnectionsResourceLinkAccountSessionPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankConnectionsResourceLinkAccountSessionPrefetch { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BankConnectionsResourceLinkAccountSessionPrefetch { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for BankConnectionsResourceLinkAccountSessionPrefetch", + ) + }) + } +} +impl stripe_types::Object for BankConnectionsResourceLinkAccountSession { + type Id = + stripe_misc::bank_connections_resource_link_account_session::FinancialConnectionsSessionId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(FinancialConnectionsSessionId); +#[cfg(feature = "bank_connections_resource_link_account_session")] +mod requests; +#[cfg(feature = "bank_connections_resource_link_account_session")] +pub use requests::*; diff --git a/generated/stripe_misc/src/bank_connections_resource_link_account_session/requests.rs b/generated/stripe_misc/src/bank_connections_resource_link_account_session/requests.rs new file mode 100644 index 000000000..495f2b3e3 --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_link_account_session/requests.rs @@ -0,0 +1,264 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBankConnectionsResourceLinkAccountSession<'a> { + /// The account holder to link accounts for. + pub account_holder: CreateBankConnectionsResourceLinkAccountSessionAccountHolder<'a>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Filters to restrict the kinds of accounts to collect. + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option>, + /// List of data features that you would like to request access to. + /// + /// Possible values are `balances`, `transactions`, `ownership`, and `payment_method`. + pub permissions: &'a [CreateBankConnectionsResourceLinkAccountSessionPermissions], + /// List of data features that you would like to retrieve upon account creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prefetch: Option<&'a [CreateBankConnectionsResourceLinkAccountSessionPrefetch]>, + /// For webview integrations only. + /// + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, +} +impl<'a> CreateBankConnectionsResourceLinkAccountSession<'a> { + pub fn new( + account_holder: CreateBankConnectionsResourceLinkAccountSessionAccountHolder<'a>, + permissions: &'a [CreateBankConnectionsResourceLinkAccountSessionPermissions], + ) -> Self { + Self { + account_holder, + expand: Default::default(), + filters: Default::default(), + permissions, + prefetch: Default::default(), + return_url: Default::default(), + } + } +} +/// The account holder to link accounts for. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBankConnectionsResourceLinkAccountSessionAccountHolder<'a> { + /// The ID of the Stripe account whose accounts will be retrieved. + /// + /// Should only be present if `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// The ID of the Stripe customer whose accounts will be retrieved. + /// + /// Should only be present if `type` is `customer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Type of account holder to collect accounts for. + #[serde(rename = "type")] + pub type_: CreateBankConnectionsResourceLinkAccountSessionAccountHolderType, +} +impl<'a> CreateBankConnectionsResourceLinkAccountSessionAccountHolder<'a> { + pub fn new(type_: CreateBankConnectionsResourceLinkAccountSessionAccountHolderType) -> Self { + Self { account: Default::default(), customer: Default::default(), type_ } + } +} +/// Type of account holder to collect accounts for. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateBankConnectionsResourceLinkAccountSessionAccountHolderType { + Account, + Customer, +} +impl CreateBankConnectionsResourceLinkAccountSessionAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreateBankConnectionsResourceLinkAccountSessionAccountHolderType::*; + match self { + Account => "account", + Customer => "customer", + } + } +} + +impl std::str::FromStr for CreateBankConnectionsResourceLinkAccountSessionAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateBankConnectionsResourceLinkAccountSessionAccountHolderType::*; + match s { + "account" => Ok(Account), + "customer" => Ok(Customer), + _ => Err(()), + } + } +} +impl AsRef for CreateBankConnectionsResourceLinkAccountSessionAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateBankConnectionsResourceLinkAccountSessionAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateBankConnectionsResourceLinkAccountSessionAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateBankConnectionsResourceLinkAccountSessionAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Filters to restrict the kinds of accounts to collect. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBankConnectionsResourceLinkAccountSessionFilters<'a> { + /// List of countries from which to collect accounts. + pub countries: &'a [&'a str], +} +impl<'a> CreateBankConnectionsResourceLinkAccountSessionFilters<'a> { + pub fn new(countries: &'a [&'a str]) -> Self { + Self { countries } + } +} +/// List of data features that you would like to request access to. +/// +/// Possible values are `balances`, `transactions`, `ownership`, and `payment_method`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateBankConnectionsResourceLinkAccountSessionPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl CreateBankConnectionsResourceLinkAccountSessionPermissions { + pub fn as_str(self) -> &'static str { + use CreateBankConnectionsResourceLinkAccountSessionPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for CreateBankConnectionsResourceLinkAccountSessionPermissions { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateBankConnectionsResourceLinkAccountSessionPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl AsRef for CreateBankConnectionsResourceLinkAccountSessionPermissions { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateBankConnectionsResourceLinkAccountSessionPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateBankConnectionsResourceLinkAccountSessionPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateBankConnectionsResourceLinkAccountSessionPermissions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateBankConnectionsResourceLinkAccountSessionPrefetch { + Balances, + Ownership, +} +impl CreateBankConnectionsResourceLinkAccountSessionPrefetch { + pub fn as_str(self) -> &'static str { + use CreateBankConnectionsResourceLinkAccountSessionPrefetch::*; + match self { + Balances => "balances", + Ownership => "ownership", + } + } +} + +impl std::str::FromStr for CreateBankConnectionsResourceLinkAccountSessionPrefetch { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateBankConnectionsResourceLinkAccountSessionPrefetch::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + _ => Err(()), + } + } +} +impl AsRef for CreateBankConnectionsResourceLinkAccountSessionPrefetch { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateBankConnectionsResourceLinkAccountSessionPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateBankConnectionsResourceLinkAccountSessionPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateBankConnectionsResourceLinkAccountSessionPrefetch { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateBankConnectionsResourceLinkAccountSession<'a> { + /// To launch the Financial Connections authorization flow, create a `Session`. + /// + /// The session’s `client_secret` can be used to launch the flow using Stripe.js. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/financial_connections/sessions", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveBankConnectionsResourceLinkAccountSession<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveBankConnectionsResourceLinkAccountSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveBankConnectionsResourceLinkAccountSession<'a> { + /// Retrieves the details of a Financial Connections `Session`. + pub fn send( + &self, + client: &stripe::Client, + session: &str, + ) -> stripe::Response { + client.get_query(&format!("/financial_connections/sessions/{session}"), self) + } +} diff --git a/generated/stripe_misc/src/bank_connections_resource_link_account_session_filters/mod.rs b/generated/stripe_misc/src/bank_connections_resource_link_account_session_filters/mod.rs new file mode 100644 index 000000000..6e0c82fac --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_link_account_session_filters/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceLinkAccountSessionFilters { + /// List of countries from which to filter accounts. + pub countries: Option>, +} diff --git a/generated/stripe_misc/src/bank_connections_resource_linked_account/mod.rs b/generated/stripe_misc/src/bank_connections_resource_linked_account/mod.rs new file mode 100644 index 000000000..3b84c0c0d --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_linked_account/mod.rs @@ -0,0 +1,421 @@ +/// A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceLinkedAccount { + /// The account holder that this account belongs to. + pub account_holder: Option, + /// The most recent information about the account's balance. + pub balance: Option, + /// The state of the most recent attempt to refresh the account balance. + pub balance_refresh: Option, + /// The type of the account. + /// + /// Account category is further divided in `subcategory`. + pub category: BankConnectionsResourceLinkedAccountCategory, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// A human-readable name that has been assigned to this account, either by the account holder or by the institution. + pub display_name: Option, + /// Unique identifier for the object. + pub id: stripe_misc::bank_connections_resource_linked_account::FinancialConnectionsAccountId, + /// The name of the institution that holds this account. + pub institution_name: String, + /// The last 4 digits of the account number. + /// + /// If present, this will be 4 numeric characters. + pub last4: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The most recent information about the account's owners. + pub ownership: Option>, + /// The state of the most recent attempt to refresh the account owners. + pub ownership_refresh: Option, + /// The list of permissions granted by this account. + pub permissions: Option>, + /// The status of the link to the account. + pub status: BankConnectionsResourceLinkedAccountStatus, + /// If `category` is `cash`, one of: + /// + /// - `checking` + /// - `savings` + /// - `other` + /// + /// If `category` is `credit`, one of: + /// + /// - `mortgage` + /// - `line_of_credit` + /// - `credit_card` + /// - `other` + /// + /// If `category` is `investment` or `other`, this will be `other`. + pub subcategory: BankConnectionsResourceLinkedAccountSubcategory, + /// The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) that can be created from this account. + pub supported_payment_method_types: + Vec, +} +/// The type of the account. +/// +/// Account category is further divided in `subcategory`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankConnectionsResourceLinkedAccountCategory { + Cash, + Credit, + Investment, + Other, +} +impl BankConnectionsResourceLinkedAccountCategory { + pub fn as_str(self) -> &'static str { + use BankConnectionsResourceLinkedAccountCategory::*; + match self { + Cash => "cash", + Credit => "credit", + Investment => "investment", + Other => "other", + } + } +} + +impl std::str::FromStr for BankConnectionsResourceLinkedAccountCategory { + type Err = (); + fn from_str(s: &str) -> Result { + use BankConnectionsResourceLinkedAccountCategory::*; + match s { + "cash" => Ok(Cash), + "credit" => Ok(Credit), + "investment" => Ok(Investment), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl AsRef for BankConnectionsResourceLinkedAccountCategory { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for BankConnectionsResourceLinkedAccountCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankConnectionsResourceLinkedAccountCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankConnectionsResourceLinkedAccountCategory { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BankConnectionsResourceLinkedAccountCategory { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for BankConnectionsResourceLinkedAccountCategory", + ) + }) + } +} +/// The list of permissions granted by this account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankConnectionsResourceLinkedAccountPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl BankConnectionsResourceLinkedAccountPermissions { + pub fn as_str(self) -> &'static str { + use BankConnectionsResourceLinkedAccountPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for BankConnectionsResourceLinkedAccountPermissions { + type Err = (); + fn from_str(s: &str) -> Result { + use BankConnectionsResourceLinkedAccountPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl AsRef for BankConnectionsResourceLinkedAccountPermissions { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for BankConnectionsResourceLinkedAccountPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankConnectionsResourceLinkedAccountPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankConnectionsResourceLinkedAccountPermissions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BankConnectionsResourceLinkedAccountPermissions { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for BankConnectionsResourceLinkedAccountPermissions", + ) + }) + } +} +/// The status of the link to the account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankConnectionsResourceLinkedAccountStatus { + Active, + Disconnected, + Inactive, +} +impl BankConnectionsResourceLinkedAccountStatus { + pub fn as_str(self) -> &'static str { + use BankConnectionsResourceLinkedAccountStatus::*; + match self { + Active => "active", + Disconnected => "disconnected", + Inactive => "inactive", + } + } +} + +impl std::str::FromStr for BankConnectionsResourceLinkedAccountStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use BankConnectionsResourceLinkedAccountStatus::*; + match s { + "active" => Ok(Active), + "disconnected" => Ok(Disconnected), + "inactive" => Ok(Inactive), + _ => Err(()), + } + } +} +impl AsRef for BankConnectionsResourceLinkedAccountStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for BankConnectionsResourceLinkedAccountStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankConnectionsResourceLinkedAccountStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankConnectionsResourceLinkedAccountStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BankConnectionsResourceLinkedAccountStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for BankConnectionsResourceLinkedAccountStatus") + }) + } +} +/// If `category` is `cash`, one of: +/// +/// - `checking` +/// - `savings` +/// - `other` +/// +/// If `category` is `credit`, one of: +/// +/// - `mortgage` +/// - `line_of_credit` +/// - `credit_card` +/// - `other` +/// +/// If `category` is `investment` or `other`, this will be `other`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankConnectionsResourceLinkedAccountSubcategory { + Checking, + CreditCard, + LineOfCredit, + Mortgage, + Other, + Savings, +} +impl BankConnectionsResourceLinkedAccountSubcategory { + pub fn as_str(self) -> &'static str { + use BankConnectionsResourceLinkedAccountSubcategory::*; + match self { + Checking => "checking", + CreditCard => "credit_card", + LineOfCredit => "line_of_credit", + Mortgage => "mortgage", + Other => "other", + Savings => "savings", + } + } +} + +impl std::str::FromStr for BankConnectionsResourceLinkedAccountSubcategory { + type Err = (); + fn from_str(s: &str) -> Result { + use BankConnectionsResourceLinkedAccountSubcategory::*; + match s { + "checking" => Ok(Checking), + "credit_card" => Ok(CreditCard), + "line_of_credit" => Ok(LineOfCredit), + "mortgage" => Ok(Mortgage), + "other" => Ok(Other), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl AsRef for BankConnectionsResourceLinkedAccountSubcategory { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for BankConnectionsResourceLinkedAccountSubcategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankConnectionsResourceLinkedAccountSubcategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankConnectionsResourceLinkedAccountSubcategory { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BankConnectionsResourceLinkedAccountSubcategory { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for BankConnectionsResourceLinkedAccountSubcategory", + ) + }) + } +} +/// The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) that can be created from this account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankConnectionsResourceLinkedAccountSupportedPaymentMethodTypes { + Link, + UsBankAccount, +} +impl BankConnectionsResourceLinkedAccountSupportedPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use BankConnectionsResourceLinkedAccountSupportedPaymentMethodTypes::*; + match self { + Link => "link", + UsBankAccount => "us_bank_account", + } + } +} + +impl std::str::FromStr for BankConnectionsResourceLinkedAccountSupportedPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use BankConnectionsResourceLinkedAccountSupportedPaymentMethodTypes::*; + match s { + "link" => Ok(Link), + "us_bank_account" => Ok(UsBankAccount), + _ => Err(()), + } + } +} +impl AsRef for BankConnectionsResourceLinkedAccountSupportedPaymentMethodTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for BankConnectionsResourceLinkedAccountSupportedPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankConnectionsResourceLinkedAccountSupportedPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankConnectionsResourceLinkedAccountSupportedPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for BankConnectionsResourceLinkedAccountSupportedPaymentMethodTypes +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for BankConnectionsResourceLinkedAccountSupportedPaymentMethodTypes", + ) + }) + } +} +impl stripe_types::Object for BankConnectionsResourceLinkedAccount { + type Id = stripe_misc::bank_connections_resource_linked_account::FinancialConnectionsAccountId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(FinancialConnectionsAccountId); +#[cfg(feature = "bank_connections_resource_linked_account")] +mod requests; +#[cfg(feature = "bank_connections_resource_linked_account")] +pub use requests::*; diff --git a/generated/stripe_misc/src/bank_connections_resource_linked_account/requests.rs b/generated/stripe_misc/src/bank_connections_resource_linked_account/requests.rs new file mode 100644 index 000000000..0105b42c8 --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_linked_account/requests.rs @@ -0,0 +1,252 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListBankConnectionsResourceLinkedAccount<'a> { + /// If present, only return accounts that belong to the specified account holder. + /// + /// `account_holder[customer]` and `account_holder[account]` are mutually exclusive. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder: Option>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// If present, only return accounts that were collected as part of the given session. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListBankConnectionsResourceLinkedAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If present, only return accounts that belong to the specified account holder. +/// +/// `account_holder[customer]` and `account_holder[account]` are mutually exclusive. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListBankConnectionsResourceLinkedAccountAccountHolder<'a> { + /// The ID of the Stripe account whose accounts will be retrieved. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// The ID of the Stripe customer whose accounts will be retrieved. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, +} +impl<'a> ListBankConnectionsResourceLinkedAccountAccountHolder<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListBankConnectionsResourceLinkedAccount<'a> { + /// Returns a list of Financial Connections `Account` objects. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> + { + client.get_query("/financial_connections/accounts", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/financial_connections/accounts", self) + } +} +impl<'a> stripe::PaginationParams for ListBankConnectionsResourceLinkedAccount<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveBankConnectionsResourceLinkedAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveBankConnectionsResourceLinkedAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveBankConnectionsResourceLinkedAccount<'a> { + /// Retrieves the details of an Financial Connections `Account`. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + ) -> stripe::Response { + client.get_query(&format!("/financial_connections/accounts/{account}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListOwnersBankConnectionsResourceLinkedAccount<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// The ID of the ownership object to fetch owners from. + pub ownership: &'a str, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListOwnersBankConnectionsResourceLinkedAccount<'a> { + pub fn new(ownership: &'a str) -> Self { + Self { + ending_before: Default::default(), + expand: Default::default(), + limit: Default::default(), + ownership, + starting_after: Default::default(), + } + } +} +impl<'a> ListOwnersBankConnectionsResourceLinkedAccount<'a> { + /// Lists all owners for a given `Account`. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + ) -> stripe::Response> { + client.get_query(&format!("/financial_connections/accounts/{account}/owners"), self) + } + pub fn paginate( + self, + account: &stripe_types::account::AccountId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params( + &format!("/financial_connections/accounts/{account}/owners"), + self, + ) + } +} +impl<'a> stripe::PaginationParams for ListOwnersBankConnectionsResourceLinkedAccount<'a> {} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct RefreshBankConnectionsResourceLinkedAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The list of account features that you would like to refresh. + pub features: &'a [RefreshBankConnectionsResourceLinkedAccountFeatures], +} +impl<'a> RefreshBankConnectionsResourceLinkedAccount<'a> { + pub fn new(features: &'a [RefreshBankConnectionsResourceLinkedAccountFeatures]) -> Self { + Self { expand: Default::default(), features } + } +} +/// The list of account features that you would like to refresh. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum RefreshBankConnectionsResourceLinkedAccountFeatures { + Balance, + Ownership, +} +impl RefreshBankConnectionsResourceLinkedAccountFeatures { + pub fn as_str(self) -> &'static str { + use RefreshBankConnectionsResourceLinkedAccountFeatures::*; + match self { + Balance => "balance", + Ownership => "ownership", + } + } +} + +impl std::str::FromStr for RefreshBankConnectionsResourceLinkedAccountFeatures { + type Err = (); + fn from_str(s: &str) -> Result { + use RefreshBankConnectionsResourceLinkedAccountFeatures::*; + match s { + "balance" => Ok(Balance), + "ownership" => Ok(Ownership), + _ => Err(()), + } + } +} +impl AsRef for RefreshBankConnectionsResourceLinkedAccountFeatures { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for RefreshBankConnectionsResourceLinkedAccountFeatures { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for RefreshBankConnectionsResourceLinkedAccountFeatures { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for RefreshBankConnectionsResourceLinkedAccountFeatures { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> RefreshBankConnectionsResourceLinkedAccount<'a> { + /// Refreshes the data associated with a Financial Connections `Account`. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + ) -> stripe::Response { + client.send_form( + &format!("/financial_connections/accounts/{account}/refresh"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DisconnectBankConnectionsResourceLinkedAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> DisconnectBankConnectionsResourceLinkedAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> DisconnectBankConnectionsResourceLinkedAccount<'a> { + /// Disables your access to a Financial Connections `Account`. + /// + /// You will no longer be able to access data associated with the account (e.g. + /// balances, transactions). + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + ) -> stripe::Response { + client.send_form( + &format!("/financial_connections/accounts/{account}/disconnect"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_misc/src/bank_connections_resource_owner/mod.rs b/generated/stripe_misc/src/bank_connections_resource_owner/mod.rs new file mode 100644 index 000000000..b5b6f1061 --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_owner/mod.rs @@ -0,0 +1,25 @@ +/// Describes an owner of an account. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceOwner { + /// The email address of the owner. + pub email: Option, + /// Unique identifier for the object. + pub id: stripe_misc::bank_connections_resource_owner::FinancialConnectionsAccountOwnerId, + /// The full name of the owner. + pub name: String, + /// The ownership object that this owner belongs to. + pub ownership: String, + /// The raw phone number of the owner. + pub phone: Option, + /// The raw physical address of the owner. + pub raw_address: Option, + /// The timestamp of the refresh that updated this owner. + pub refreshed_at: Option, +} +impl stripe_types::Object for BankConnectionsResourceOwner { + type Id = stripe_misc::bank_connections_resource_owner::FinancialConnectionsAccountOwnerId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(FinancialConnectionsAccountOwnerId); diff --git a/generated/stripe_misc/src/bank_connections_resource_ownership/mod.rs b/generated/stripe_misc/src/bank_connections_resource_ownership/mod.rs new file mode 100644 index 000000000..cd6aae18f --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_ownership/mod.rs @@ -0,0 +1,21 @@ +/// Describes a snapshot of the owners of an account at a particular point in time. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceOwnership { + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Unique identifier for the object. + pub id: + stripe_misc::bank_connections_resource_ownership::FinancialConnectionsAccountOwnershipId, + /// A paginated list of owners for this account. + pub owners: stripe_types::List, +} +impl stripe_types::Object for BankConnectionsResourceOwnership { + type Id = + stripe_misc::bank_connections_resource_ownership::FinancialConnectionsAccountOwnershipId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(FinancialConnectionsAccountOwnershipId); diff --git a/generated/stripe_misc/src/bank_connections_resource_ownership_refresh/mod.rs b/generated/stripe_misc/src/bank_connections_resource_ownership_refresh/mod.rs new file mode 100644 index 000000000..667b5d4e6 --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_ownership_refresh/mod.rs @@ -0,0 +1,74 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceOwnershipRefresh { + /// The time at which the last refresh attempt was initiated. + /// + /// Measured in seconds since the Unix epoch. + pub last_attempted_at: stripe_types::Timestamp, + /// The status of the last refresh attempt. + pub status: BankConnectionsResourceOwnershipRefreshStatus, +} +/// The status of the last refresh attempt. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankConnectionsResourceOwnershipRefreshStatus { + Failed, + Pending, + Succeeded, +} +impl BankConnectionsResourceOwnershipRefreshStatus { + pub fn as_str(self) -> &'static str { + use BankConnectionsResourceOwnershipRefreshStatus::*; + match self { + Failed => "failed", + Pending => "pending", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for BankConnectionsResourceOwnershipRefreshStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use BankConnectionsResourceOwnershipRefreshStatus::*; + match s { + "failed" => Ok(Failed), + "pending" => Ok(Pending), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl AsRef for BankConnectionsResourceOwnershipRefreshStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for BankConnectionsResourceOwnershipRefreshStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankConnectionsResourceOwnershipRefreshStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankConnectionsResourceOwnershipRefreshStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BankConnectionsResourceOwnershipRefreshStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for BankConnectionsResourceOwnershipRefreshStatus", + ) + }) + } +} diff --git a/generated/stripe_misc/src/deleted_apple_pay_domain/mod.rs b/generated/stripe_misc/src/deleted_apple_pay_domain/mod.rs new file mode 100644 index 000000000..93c21ea0c --- /dev/null +++ b/generated/stripe_misc/src/deleted_apple_pay_domain/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedApplePayDomain { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_misc::apple_pay_domain::ApplePayDomainId, +} +impl stripe_types::Object for DeletedApplePayDomain { + type Id = stripe_misc::apple_pay_domain::ApplePayDomainId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/generated/stripe_misc/src/ephemeral_key/mod.rs b/generated/stripe_misc/src/ephemeral_key/mod.rs new file mode 100644 index 000000000..2eab9b120 --- /dev/null +++ b/generated/stripe_misc/src/ephemeral_key/mod.rs @@ -0,0 +1,31 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct EphemeralKey { + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Time at which the key will expire. + /// + /// Measured in seconds since the Unix epoch. + pub expires: stripe_types::Timestamp, + /// Unique identifier for the object. + pub id: stripe_misc::ephemeral_key::EphemeralKeyId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The key's secret. + /// + /// You can use this value to make authorized requests to the Stripe API. + #[serde(skip_serializing_if = "Option::is_none")] + pub secret: Option, +} +impl stripe_types::Object for EphemeralKey { + type Id = stripe_misc::ephemeral_key::EphemeralKeyId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(EphemeralKeyId, "ephkey_"); +#[cfg(feature = "ephemeral_key")] +mod requests; +#[cfg(feature = "ephemeral_key")] +pub use requests::*; diff --git a/generated/stripe_misc/src/ephemeral_key/requests.rs b/generated/stripe_misc/src/ephemeral_key/requests.rs new file mode 100644 index 000000000..285aff889 --- /dev/null +++ b/generated/stripe_misc/src/ephemeral_key/requests.rs @@ -0,0 +1,50 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateEphemeralKey<'a> { + /// The ID of the Customer you'd like to modify using the resulting ephemeral key. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The ID of the Issuing Card you'd like to access using the resulting ephemeral key. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuing_card: Option<&'a str>, + /// A single-use token, created by Stripe.js, used for creating ephemeral keys for Issuing Cards without exchanging sensitive information. + #[serde(skip_serializing_if = "Option::is_none")] + pub nonce: Option<&'a str>, + /// The ID of the Identity VerificationSession you'd like to access using the resulting ephemeral key. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_session: Option<&'a str>, +} +impl<'a> CreateEphemeralKey<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateEphemeralKey<'a> { + /// Creates a short-lived API key for a given resource. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/ephemeral_keys", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteEphemeralKey<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> DeleteEphemeralKey<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> DeleteEphemeralKey<'a> { + /// Invalidates a short-lived API key for a given resource. + pub fn send( + &self, + client: &stripe::Client, + key: &str, + ) -> stripe::Response { + client.send_form(&format!("/ephemeral_keys/{key}"), self, http_types::Method::Delete) + } +} diff --git a/generated/stripe_misc/src/exchange_rate/mod.rs b/generated/stripe_misc/src/exchange_rate/mod.rs new file mode 100644 index 000000000..f7ddcfa65 --- /dev/null +++ b/generated/stripe_misc/src/exchange_rate/mod.rs @@ -0,0 +1,29 @@ +/// `ExchangeRate` objects allow you to determine the rates that Stripe is currently +/// using to convert from one currency to another. +/// +/// Since this number is variable throughout the day, there are various reasons why you might want to know the current rate (for example, to dynamically price an item for a user with a default payment in a foreign currency). Please refer to our [Exchange Rates API](https://stripe.com/docs/fx-rates) guide for more details. *[Note: this integration path is supported but no longer recommended]* Additionally, you can guarantee that a charge is made with an exchange rate that you expect is current. +/// To do so, you must pass in the exchange_rate to charges endpoints. +/// If the value is no longer up to date, the charge won't go through. +/// Please refer to our [Using with charges](https://stripe.com/docs/exchange-rates) guide for more details. -----   *This Exchange Rates API is a Beta Service and is subject to Stripe's terms of service. +/// You may use the API solely for the purpose of transacting on Stripe. +/// For example, the API may be queried in order to:* - *localize prices for processing payments on Stripe* - *reconcile Stripe transactions* - *determine how much money to send to a connected account* - *determine app fees to charge a connected account* *Using this Exchange Rates API beta for any purpose other than to transact on Stripe is strictly prohibited and constitutes a violation of Stripe's terms of service.*. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ExchangeRate { + /// Unique identifier for the object. + /// + /// Represented as the three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. + pub id: stripe_misc::exchange_rate::ExchangeRateId, + /// Hash where the keys are supported currencies and the values are the exchange rate at which the base id currency converts to the key currency. + pub rates: std::collections::HashMap, +} +impl stripe_types::Object for ExchangeRate { + type Id = stripe_misc::exchange_rate::ExchangeRateId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(ExchangeRateId); +#[cfg(feature = "exchange_rate")] +mod requests; +#[cfg(feature = "exchange_rate")] +pub use requests::*; diff --git a/generated/stripe_misc/src/exchange_rate/requests.rs b/generated/stripe_misc/src/exchange_rate/requests.rs new file mode 100644 index 000000000..01298f84e --- /dev/null +++ b/generated/stripe_misc/src/exchange_rate/requests.rs @@ -0,0 +1,64 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListExchangeRate<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is the currency that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with the exchange rate for currency X your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and total number of supported payout currencies, and the default is the max. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is the currency that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with the exchange rate for currency X, your subsequent call can include `starting_after=X` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListExchangeRate<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListExchangeRate<'a> { + /// Returns a list of objects that contain the rates at which foreign currencies are converted to one another. + /// + /// Only shows the currencies for which Stripe supports. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/exchange_rates", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/exchange_rates", self) + } +} +impl<'a> stripe::PaginationParams for ListExchangeRate<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveExchangeRate<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveExchangeRate<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveExchangeRate<'a> { + /// Retrieves the exchange rates from the given currency to every supported currency. + pub fn send( + &self, + client: &stripe::Client, + rate_id: &str, + ) -> stripe::Response { + client.get_query(&format!("/exchange_rates/{rate_id}"), self) + } +} diff --git a/generated/stripe_misc/src/financial_reporting_finance_report_run_run_parameters/mod.rs b/generated/stripe_misc/src/financial_reporting_finance_report_run_run_parameters/mod.rs new file mode 100644 index 000000000..ee77209fe --- /dev/null +++ b/generated/stripe_misc/src/financial_reporting_finance_report_run_run_parameters/mod.rs @@ -0,0 +1,35 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct FinancialReportingFinanceReportRunRunParameters { + /// The set of output columns requested for inclusion in the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub columns: Option>, + /// Connected account ID by which to filter the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub connected_account: Option, + /// Currency of objects to be included in the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Ending timestamp of data to be included in the report run. + /// + /// Can be any UTC timestamp between 1 second after the user specified `interval_start` and 1 second before this report's last `data_available_end` value. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_end: Option, + /// Starting timestamp of data to be included in the report run. + /// + /// Can be any UTC timestamp between 1 second after this report's `data_available_start` and 1 second before the user specified `interval_end` value. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_start: Option, + /// Payout ID by which to filter the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub payout: Option, + /// Category of balance transactions to be included in the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub reporting_category: Option, + /// Defaults to `Etc/UTC`. + /// + /// The output timezone for all timestamps in the report. + /// A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). + /// Has no effect on `interval_start` or `interval_end`. + #[serde(skip_serializing_if = "Option::is_none")] + pub timezone: Option, +} diff --git a/generated/stripe_misc/src/gelato_data_document_report_date_of_birth/mod.rs b/generated/stripe_misc/src/gelato_data_document_report_date_of_birth/mod.rs new file mode 100644 index 000000000..73df29b6a --- /dev/null +++ b/generated/stripe_misc/src/gelato_data_document_report_date_of_birth/mod.rs @@ -0,0 +1,10 @@ +/// Point in Time. +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoDataDocumentReportDateOfBirth { + /// Numerical day between 1 and 31. + pub day: Option, + /// Numerical month between 1 and 12. + pub month: Option, + /// The four-digit year. + pub year: Option, +} diff --git a/generated/stripe_misc/src/gelato_data_document_report_expiration_date/mod.rs b/generated/stripe_misc/src/gelato_data_document_report_expiration_date/mod.rs new file mode 100644 index 000000000..43b9451a3 --- /dev/null +++ b/generated/stripe_misc/src/gelato_data_document_report_expiration_date/mod.rs @@ -0,0 +1,10 @@ +/// Point in Time. +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoDataDocumentReportExpirationDate { + /// Numerical day between 1 and 31. + pub day: Option, + /// Numerical month between 1 and 12. + pub month: Option, + /// The four-digit year. + pub year: Option, +} diff --git a/generated/stripe_misc/src/gelato_data_document_report_issued_date/mod.rs b/generated/stripe_misc/src/gelato_data_document_report_issued_date/mod.rs new file mode 100644 index 000000000..9e82bd42f --- /dev/null +++ b/generated/stripe_misc/src/gelato_data_document_report_issued_date/mod.rs @@ -0,0 +1,10 @@ +/// Point in Time. +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoDataDocumentReportIssuedDate { + /// Numerical day between 1 and 31. + pub day: Option, + /// Numerical month between 1 and 12. + pub month: Option, + /// The four-digit year. + pub year: Option, +} diff --git a/generated/stripe_misc/src/gelato_data_id_number_report_date/mod.rs b/generated/stripe_misc/src/gelato_data_id_number_report_date/mod.rs new file mode 100644 index 000000000..6ea8cdd3a --- /dev/null +++ b/generated/stripe_misc/src/gelato_data_id_number_report_date/mod.rs @@ -0,0 +1,10 @@ +/// Point in Time. +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoDataIdNumberReportDate { + /// Numerical day between 1 and 31. + pub day: Option, + /// Numerical month between 1 and 12. + pub month: Option, + /// The four-digit year. + pub year: Option, +} diff --git a/generated/stripe_misc/src/gelato_data_verified_outputs_date/mod.rs b/generated/stripe_misc/src/gelato_data_verified_outputs_date/mod.rs new file mode 100644 index 000000000..a9dfd6195 --- /dev/null +++ b/generated/stripe_misc/src/gelato_data_verified_outputs_date/mod.rs @@ -0,0 +1,10 @@ +/// Point in Time. +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoDataVerifiedOutputsDate { + /// Numerical day between 1 and 31. + pub day: Option, + /// Numerical month between 1 and 12. + pub month: Option, + /// The four-digit year. + pub year: Option, +} diff --git a/generated/stripe_misc/src/gelato_document_report/mod.rs b/generated/stripe_misc/src/gelato_document_report/mod.rs new file mode 100644 index 000000000..cfc603385 --- /dev/null +++ b/generated/stripe_misc/src/gelato_document_report/mod.rs @@ -0,0 +1,152 @@ +/// Result from a document check. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct GelatoDocumentReport { + /// Address as it appears in the document. + pub address: Option, + /// Date of birth as it appears in the document. + pub dob: Option, + /// Details on the verification error. + /// + /// Present when status is `unverified`. + pub error: Option, + /// Expiration date of the document. + pub expiration_date: Option, + /// Array of [File](https://stripe.com/docs/api/files) ids containing images for this document. + pub files: Option>, + /// First name as it appears in the document. + pub first_name: Option, + /// Issued date of the document. + pub issued_date: Option, + /// Issuing country of the document. + pub issuing_country: Option, + /// Last name as it appears in the document. + pub last_name: Option, + /// Document ID number. + pub number: Option, + /// Status of this `document` check. + pub status: GelatoDocumentReportStatus, + /// Type of the document. + #[serde(rename = "type")] + pub type_: Option, +} +/// Status of this `document` check. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoDocumentReportStatus { + Unverified, + Verified, +} +impl GelatoDocumentReportStatus { + pub fn as_str(self) -> &'static str { + use GelatoDocumentReportStatus::*; + match self { + Unverified => "unverified", + Verified => "verified", + } + } +} + +impl std::str::FromStr for GelatoDocumentReportStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoDocumentReportStatus::*; + match s { + "unverified" => Ok(Unverified), + "verified" => Ok(Verified), + _ => Err(()), + } + } +} +impl AsRef for GelatoDocumentReportStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for GelatoDocumentReportStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoDocumentReportStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoDocumentReportStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoDocumentReportStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for GelatoDocumentReportStatus")) + } +} +/// Type of the document. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoDocumentReportType { + DrivingLicense, + IdCard, + Passport, +} +impl GelatoDocumentReportType { + pub fn as_str(self) -> &'static str { + use GelatoDocumentReportType::*; + match self { + DrivingLicense => "driving_license", + IdCard => "id_card", + Passport => "passport", + } + } +} + +impl std::str::FromStr for GelatoDocumentReportType { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoDocumentReportType::*; + match s { + "driving_license" => Ok(DrivingLicense), + "id_card" => Ok(IdCard), + "passport" => Ok(Passport), + _ => Err(()), + } + } +} +impl AsRef for GelatoDocumentReportType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for GelatoDocumentReportType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoDocumentReportType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoDocumentReportType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoDocumentReportType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for GelatoDocumentReportType")) + } +} diff --git a/generated/stripe_misc/src/gelato_document_report_error/mod.rs b/generated/stripe_misc/src/gelato_document_report_error/mod.rs new file mode 100644 index 000000000..74166ebac --- /dev/null +++ b/generated/stripe_misc/src/gelato_document_report_error/mod.rs @@ -0,0 +1,72 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoDocumentReportError { + /// A short machine-readable string giving the reason for the verification failure. + pub code: Option, + /// A human-readable message giving the reason for the failure. + /// + /// These messages can be shown to your users. + pub reason: Option, +} +/// A short machine-readable string giving the reason for the verification failure. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoDocumentReportErrorCode { + DocumentExpired, + DocumentTypeNotSupported, + DocumentUnverifiedOther, +} +impl GelatoDocumentReportErrorCode { + pub fn as_str(self) -> &'static str { + use GelatoDocumentReportErrorCode::*; + match self { + DocumentExpired => "document_expired", + DocumentTypeNotSupported => "document_type_not_supported", + DocumentUnverifiedOther => "document_unverified_other", + } + } +} + +impl std::str::FromStr for GelatoDocumentReportErrorCode { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoDocumentReportErrorCode::*; + match s { + "document_expired" => Ok(DocumentExpired), + "document_type_not_supported" => Ok(DocumentTypeNotSupported), + "document_unverified_other" => Ok(DocumentUnverifiedOther), + _ => Err(()), + } + } +} +impl AsRef for GelatoDocumentReportErrorCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for GelatoDocumentReportErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoDocumentReportErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoDocumentReportErrorCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoDocumentReportErrorCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for GelatoDocumentReportErrorCode") + }) + } +} diff --git a/generated/stripe_misc/src/gelato_id_number_report/mod.rs b/generated/stripe_misc/src/gelato_id_number_report/mod.rs new file mode 100644 index 000000000..44fec5fdf --- /dev/null +++ b/generated/stripe_misc/src/gelato_id_number_report/mod.rs @@ -0,0 +1,142 @@ +/// Result from an id_number check. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct GelatoIdNumberReport { + /// Date of birth. + pub dob: Option, + /// Details on the verification error. + /// + /// Present when status is `unverified`. + pub error: Option, + /// First name. + pub first_name: Option, + /// ID number. + pub id_number: Option, + /// Type of ID number. + pub id_number_type: Option, + /// Last name. + pub last_name: Option, + /// Status of this `id_number` check. + pub status: GelatoIdNumberReportStatus, +} +/// Type of ID number. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoIdNumberReportIdNumberType { + BrCpf, + SgNric, + UsSsn, +} +impl GelatoIdNumberReportIdNumberType { + pub fn as_str(self) -> &'static str { + use GelatoIdNumberReportIdNumberType::*; + match self { + BrCpf => "br_cpf", + SgNric => "sg_nric", + UsSsn => "us_ssn", + } + } +} + +impl std::str::FromStr for GelatoIdNumberReportIdNumberType { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoIdNumberReportIdNumberType::*; + match s { + "br_cpf" => Ok(BrCpf), + "sg_nric" => Ok(SgNric), + "us_ssn" => Ok(UsSsn), + _ => Err(()), + } + } +} +impl AsRef for GelatoIdNumberReportIdNumberType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for GelatoIdNumberReportIdNumberType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoIdNumberReportIdNumberType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoIdNumberReportIdNumberType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoIdNumberReportIdNumberType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for GelatoIdNumberReportIdNumberType") + }) + } +} +/// Status of this `id_number` check. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoIdNumberReportStatus { + Unverified, + Verified, +} +impl GelatoIdNumberReportStatus { + pub fn as_str(self) -> &'static str { + use GelatoIdNumberReportStatus::*; + match self { + Unverified => "unverified", + Verified => "verified", + } + } +} + +impl std::str::FromStr for GelatoIdNumberReportStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoIdNumberReportStatus::*; + match s { + "unverified" => Ok(Unverified), + "verified" => Ok(Verified), + _ => Err(()), + } + } +} +impl AsRef for GelatoIdNumberReportStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for GelatoIdNumberReportStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoIdNumberReportStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoIdNumberReportStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoIdNumberReportStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for GelatoIdNumberReportStatus")) + } +} diff --git a/generated/stripe_misc/src/gelato_id_number_report_error/mod.rs b/generated/stripe_misc/src/gelato_id_number_report_error/mod.rs new file mode 100644 index 000000000..95f854c19 --- /dev/null +++ b/generated/stripe_misc/src/gelato_id_number_report_error/mod.rs @@ -0,0 +1,72 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoIdNumberReportError { + /// A short machine-readable string giving the reason for the verification failure. + pub code: Option, + /// A human-readable message giving the reason for the failure. + /// + /// These messages can be shown to your users. + pub reason: Option, +} +/// A short machine-readable string giving the reason for the verification failure. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoIdNumberReportErrorCode { + IdNumberInsufficientDocumentData, + IdNumberMismatch, + IdNumberUnverifiedOther, +} +impl GelatoIdNumberReportErrorCode { + pub fn as_str(self) -> &'static str { + use GelatoIdNumberReportErrorCode::*; + match self { + IdNumberInsufficientDocumentData => "id_number_insufficient_document_data", + IdNumberMismatch => "id_number_mismatch", + IdNumberUnverifiedOther => "id_number_unverified_other", + } + } +} + +impl std::str::FromStr for GelatoIdNumberReportErrorCode { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoIdNumberReportErrorCode::*; + match s { + "id_number_insufficient_document_data" => Ok(IdNumberInsufficientDocumentData), + "id_number_mismatch" => Ok(IdNumberMismatch), + "id_number_unverified_other" => Ok(IdNumberUnverifiedOther), + _ => Err(()), + } + } +} +impl AsRef for GelatoIdNumberReportErrorCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for GelatoIdNumberReportErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoIdNumberReportErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoIdNumberReportErrorCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoIdNumberReportErrorCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for GelatoIdNumberReportErrorCode") + }) + } +} diff --git a/generated/stripe_misc/src/gelato_report_document_options/mod.rs b/generated/stripe_misc/src/gelato_report_document_options/mod.rs new file mode 100644 index 000000000..c9104f828 --- /dev/null +++ b/generated/stripe_misc/src/gelato_report_document_options/mod.rs @@ -0,0 +1,84 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoReportDocumentOptions { + /// Array of strings of allowed identity document types. + /// + /// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_types: Option>, + /// Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_id_number: Option, + /// Disable image uploads, identity document images have to be captured using the device’s camera. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_live_capture: Option, + /// Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. + /// + /// [Learn more](https://stripe.com/docs/identity/selfie). + #[serde(skip_serializing_if = "Option::is_none")] + pub require_matching_selfie: Option, +} +/// Array of strings of allowed identity document types. +/// +/// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoReportDocumentOptionsAllowedTypes { + DrivingLicense, + IdCard, + Passport, +} +impl GelatoReportDocumentOptionsAllowedTypes { + pub fn as_str(self) -> &'static str { + use GelatoReportDocumentOptionsAllowedTypes::*; + match self { + DrivingLicense => "driving_license", + IdCard => "id_card", + Passport => "passport", + } + } +} + +impl std::str::FromStr for GelatoReportDocumentOptionsAllowedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoReportDocumentOptionsAllowedTypes::*; + match s { + "driving_license" => Ok(DrivingLicense), + "id_card" => Ok(IdCard), + "passport" => Ok(Passport), + _ => Err(()), + } + } +} +impl AsRef for GelatoReportDocumentOptionsAllowedTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for GelatoReportDocumentOptionsAllowedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoReportDocumentOptionsAllowedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoReportDocumentOptionsAllowedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoReportDocumentOptionsAllowedTypes { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for GelatoReportDocumentOptionsAllowedTypes") + }) + } +} diff --git a/generated/stripe_misc/src/gelato_report_id_number_options/mod.rs b/generated/stripe_misc/src/gelato_report_id_number_options/mod.rs new file mode 100644 index 000000000..469d8e9a1 --- /dev/null +++ b/generated/stripe_misc/src/gelato_report_id_number_options/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoReportIdNumberOptions {} diff --git a/generated/stripe_misc/src/gelato_selfie_report/mod.rs b/generated/stripe_misc/src/gelato_selfie_report/mod.rs new file mode 100644 index 000000000..684903a68 --- /dev/null +++ b/generated/stripe_misc/src/gelato_selfie_report/mod.rs @@ -0,0 +1,73 @@ +/// Result from a selfie check. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct GelatoSelfieReport { + /// ID of the [File](https://stripe.com/docs/api/files) holding the image of the identity document used in this check. + pub document: Option, + /// Details on the verification error. + /// + /// Present when status is `unverified`. + pub error: Option, + /// ID of the [File](https://stripe.com/docs/api/files) holding the image of the selfie used in this check. + pub selfie: Option, + /// Status of this `selfie` check. + pub status: GelatoSelfieReportStatus, +} +/// Status of this `selfie` check. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoSelfieReportStatus { + Unverified, + Verified, +} +impl GelatoSelfieReportStatus { + pub fn as_str(self) -> &'static str { + use GelatoSelfieReportStatus::*; + match self { + Unverified => "unverified", + Verified => "verified", + } + } +} + +impl std::str::FromStr for GelatoSelfieReportStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoSelfieReportStatus::*; + match s { + "unverified" => Ok(Unverified), + "verified" => Ok(Verified), + _ => Err(()), + } + } +} +impl AsRef for GelatoSelfieReportStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for GelatoSelfieReportStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoSelfieReportStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoSelfieReportStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoSelfieReportStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for GelatoSelfieReportStatus")) + } +} diff --git a/generated/stripe_misc/src/gelato_selfie_report_error/mod.rs b/generated/stripe_misc/src/gelato_selfie_report_error/mod.rs new file mode 100644 index 000000000..528f1a6fa --- /dev/null +++ b/generated/stripe_misc/src/gelato_selfie_report_error/mod.rs @@ -0,0 +1,74 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoSelfieReportError { + /// A short machine-readable string giving the reason for the verification failure. + pub code: Option, + /// A human-readable message giving the reason for the failure. + /// + /// These messages can be shown to your users. + pub reason: Option, +} +/// A short machine-readable string giving the reason for the verification failure. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoSelfieReportErrorCode { + SelfieDocumentMissingPhoto, + SelfieFaceMismatch, + SelfieManipulated, + SelfieUnverifiedOther, +} +impl GelatoSelfieReportErrorCode { + pub fn as_str(self) -> &'static str { + use GelatoSelfieReportErrorCode::*; + match self { + SelfieDocumentMissingPhoto => "selfie_document_missing_photo", + SelfieFaceMismatch => "selfie_face_mismatch", + SelfieManipulated => "selfie_manipulated", + SelfieUnverifiedOther => "selfie_unverified_other", + } + } +} + +impl std::str::FromStr for GelatoSelfieReportErrorCode { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoSelfieReportErrorCode::*; + match s { + "selfie_document_missing_photo" => Ok(SelfieDocumentMissingPhoto), + "selfie_face_mismatch" => Ok(SelfieFaceMismatch), + "selfie_manipulated" => Ok(SelfieManipulated), + "selfie_unverified_other" => Ok(SelfieUnverifiedOther), + _ => Err(()), + } + } +} +impl AsRef for GelatoSelfieReportErrorCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for GelatoSelfieReportErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoSelfieReportErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoSelfieReportErrorCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoSelfieReportErrorCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for GelatoSelfieReportErrorCode")) + } +} diff --git a/generated/stripe_misc/src/gelato_session_document_options/mod.rs b/generated/stripe_misc/src/gelato_session_document_options/mod.rs new file mode 100644 index 000000000..a8255f8ed --- /dev/null +++ b/generated/stripe_misc/src/gelato_session_document_options/mod.rs @@ -0,0 +1,84 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoSessionDocumentOptions { + /// Array of strings of allowed identity document types. + /// + /// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_types: Option>, + /// Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_id_number: Option, + /// Disable image uploads, identity document images have to be captured using the device’s camera. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_live_capture: Option, + /// Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. + /// + /// [Learn more](https://stripe.com/docs/identity/selfie). + #[serde(skip_serializing_if = "Option::is_none")] + pub require_matching_selfie: Option, +} +/// Array of strings of allowed identity document types. +/// +/// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoSessionDocumentOptionsAllowedTypes { + DrivingLicense, + IdCard, + Passport, +} +impl GelatoSessionDocumentOptionsAllowedTypes { + pub fn as_str(self) -> &'static str { + use GelatoSessionDocumentOptionsAllowedTypes::*; + match self { + DrivingLicense => "driving_license", + IdCard => "id_card", + Passport => "passport", + } + } +} + +impl std::str::FromStr for GelatoSessionDocumentOptionsAllowedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoSessionDocumentOptionsAllowedTypes::*; + match s { + "driving_license" => Ok(DrivingLicense), + "id_card" => Ok(IdCard), + "passport" => Ok(Passport), + _ => Err(()), + } + } +} +impl AsRef for GelatoSessionDocumentOptionsAllowedTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for GelatoSessionDocumentOptionsAllowedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoSessionDocumentOptionsAllowedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoSessionDocumentOptionsAllowedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoSessionDocumentOptionsAllowedTypes { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for GelatoSessionDocumentOptionsAllowedTypes") + }) + } +} diff --git a/generated/stripe_misc/src/gelato_session_id_number_options/mod.rs b/generated/stripe_misc/src/gelato_session_id_number_options/mod.rs new file mode 100644 index 000000000..2e402a477 --- /dev/null +++ b/generated/stripe_misc/src/gelato_session_id_number_options/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoSessionIdNumberOptions {} diff --git a/generated/stripe_misc/src/gelato_session_last_error/mod.rs b/generated/stripe_misc/src/gelato_session_last_error/mod.rs new file mode 100644 index 000000000..7ab5e58fe --- /dev/null +++ b/generated/stripe_misc/src/gelato_session_last_error/mod.rs @@ -0,0 +1,109 @@ +/// Shows last VerificationSession error. +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoSessionLastError { + /// A short machine-readable string giving the reason for the verification or user-session failure. + pub code: Option, + /// A message that explains the reason for verification or user-session failure. + pub reason: Option, +} +/// A short machine-readable string giving the reason for the verification or user-session failure. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum GelatoSessionLastErrorCode { + Abandoned, + ConsentDeclined, + CountryNotSupported, + DeviceNotSupported, + DocumentExpired, + DocumentTypeNotSupported, + DocumentUnverifiedOther, + IdNumberInsufficientDocumentData, + IdNumberMismatch, + IdNumberUnverifiedOther, + SelfieDocumentMissingPhoto, + SelfieFaceMismatch, + SelfieManipulated, + SelfieUnverifiedOther, + UnderSupportedAge, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl GelatoSessionLastErrorCode { + pub fn as_str(self) -> &'static str { + use GelatoSessionLastErrorCode::*; + match self { + Abandoned => "abandoned", + ConsentDeclined => "consent_declined", + CountryNotSupported => "country_not_supported", + DeviceNotSupported => "device_not_supported", + DocumentExpired => "document_expired", + DocumentTypeNotSupported => "document_type_not_supported", + DocumentUnverifiedOther => "document_unverified_other", + IdNumberInsufficientDocumentData => "id_number_insufficient_document_data", + IdNumberMismatch => "id_number_mismatch", + IdNumberUnverifiedOther => "id_number_unverified_other", + SelfieDocumentMissingPhoto => "selfie_document_missing_photo", + SelfieFaceMismatch => "selfie_face_mismatch", + SelfieManipulated => "selfie_manipulated", + SelfieUnverifiedOther => "selfie_unverified_other", + UnderSupportedAge => "under_supported_age", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for GelatoSessionLastErrorCode { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoSessionLastErrorCode::*; + match s { + "abandoned" => Ok(Abandoned), + "consent_declined" => Ok(ConsentDeclined), + "country_not_supported" => Ok(CountryNotSupported), + "device_not_supported" => Ok(DeviceNotSupported), + "document_expired" => Ok(DocumentExpired), + "document_type_not_supported" => Ok(DocumentTypeNotSupported), + "document_unverified_other" => Ok(DocumentUnverifiedOther), + "id_number_insufficient_document_data" => Ok(IdNumberInsufficientDocumentData), + "id_number_mismatch" => Ok(IdNumberMismatch), + "id_number_unverified_other" => Ok(IdNumberUnverifiedOther), + "selfie_document_missing_photo" => Ok(SelfieDocumentMissingPhoto), + "selfie_face_mismatch" => Ok(SelfieFaceMismatch), + "selfie_manipulated" => Ok(SelfieManipulated), + "selfie_unverified_other" => Ok(SelfieUnverifiedOther), + "under_supported_age" => Ok(UnderSupportedAge), + _ => Err(()), + } + } +} +impl AsRef for GelatoSessionLastErrorCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for GelatoSessionLastErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoSessionLastErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoSessionLastErrorCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoSessionLastErrorCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(GelatoSessionLastErrorCode::Unknown)) + } +} diff --git a/generated/stripe_misc/src/gelato_verification_report/mod.rs b/generated/stripe_misc/src/gelato_verification_report/mod.rs new file mode 100644 index 000000000..c543c5784 --- /dev/null +++ b/generated/stripe_misc/src/gelato_verification_report/mod.rs @@ -0,0 +1,101 @@ +/// A VerificationReport is the result of an attempt to collect and verify data from a user. +/// The collection of verification checks performed is determined from the `type` and `options` +/// parameters used. +/// +/// You can find the result of each verification check performed in the appropriate sub-resource: `document`, `id_number`, `selfie`. Each VerificationReport contains a copy of any data collected by the user as well as reference IDs which can be used to access collected images through the [FileUpload](https://stripe.com/docs/api/files) API. +/// To configure and create VerificationReports, use the [VerificationSession](https://stripe.com/docs/api/identity/verification_sessions) API. Related guides: [Accessing verification results](https://stripe.com/docs/identity/verification-sessions#results). For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct GelatoVerificationReport { + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option, + /// Unique identifier for the object. + pub id: stripe_misc::gelato_verification_report::IdentityVerificationReportId, + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub options: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub selfie: Option, + /// Type of report. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// ID of the VerificationSession that created this report. + pub verification_session: Option, +} +/// Type of report. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoVerificationReportType { + Document, + IdNumber, +} +impl GelatoVerificationReportType { + pub fn as_str(self) -> &'static str { + use GelatoVerificationReportType::*; + match self { + Document => "document", + IdNumber => "id_number", + } + } +} + +impl std::str::FromStr for GelatoVerificationReportType { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoVerificationReportType::*; + match s { + "document" => Ok(Document), + "id_number" => Ok(IdNumber), + _ => Err(()), + } + } +} +impl AsRef for GelatoVerificationReportType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for GelatoVerificationReportType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoVerificationReportType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoVerificationReportType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoVerificationReportType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for GelatoVerificationReportType")) + } +} +impl stripe_types::Object for GelatoVerificationReport { + type Id = stripe_misc::gelato_verification_report::IdentityVerificationReportId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(IdentityVerificationReportId); +#[cfg(feature = "gelato_verification_report")] +mod requests; +#[cfg(feature = "gelato_verification_report")] +pub use requests::*; diff --git a/generated/stripe_misc/src/gelato_verification_report/requests.rs b/generated/stripe_misc/src/gelato_verification_report/requests.rs new file mode 100644 index 000000000..b96dc560c --- /dev/null +++ b/generated/stripe_misc/src/gelato_verification_report/requests.rs @@ -0,0 +1,124 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveGelatoVerificationReport<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveGelatoVerificationReport<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveGelatoVerificationReport<'a> { + /// Retrieves an existing VerificationReport. + pub fn send( + &self, + client: &stripe::Client, + report: &str, + ) -> stripe::Response { + client.get_query(&format!("/identity/verification_reports/{report}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListGelatoVerificationReport<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return VerificationReports of this type. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// Only return VerificationReports created by this VerificationSession ID. + /// + /// It is allowed to provide a VerificationIntent ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_session: Option<&'a str>, +} +impl<'a> ListGelatoVerificationReport<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Only return VerificationReports of this type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListGelatoVerificationReportType { + Document, + IdNumber, +} +impl ListGelatoVerificationReportType { + pub fn as_str(self) -> &'static str { + use ListGelatoVerificationReportType::*; + match self { + Document => "document", + IdNumber => "id_number", + } + } +} + +impl std::str::FromStr for ListGelatoVerificationReportType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListGelatoVerificationReportType::*; + match s { + "document" => Ok(Document), + "id_number" => Ok(IdNumber), + _ => Err(()), + } + } +} +impl AsRef for ListGelatoVerificationReportType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListGelatoVerificationReportType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListGelatoVerificationReportType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListGelatoVerificationReportType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListGelatoVerificationReport<'a> { + /// List all verification reports. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/identity/verification_reports", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/identity/verification_reports", self) + } +} +impl<'a> stripe::PaginationParams for ListGelatoVerificationReport<'a> {} diff --git a/generated/stripe_misc/src/gelato_verification_report_options/mod.rs b/generated/stripe_misc/src/gelato_verification_report_options/mod.rs new file mode 100644 index 000000000..84bb33614 --- /dev/null +++ b/generated/stripe_misc/src/gelato_verification_report_options/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoVerificationReportOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option, +} diff --git a/generated/stripe_misc/src/gelato_verification_session/mod.rs b/generated/stripe_misc/src/gelato_verification_session/mod.rs new file mode 100644 index 000000000..3c302c901 --- /dev/null +++ b/generated/stripe_misc/src/gelato_verification_session/mod.rs @@ -0,0 +1,195 @@ +/// A VerificationSession guides you through the process of collecting and verifying the identities +/// of your users. +/// +/// It contains details about the type of verification, such as what [verification check](/docs/identity/verification-checks) to perform. +/// Only create one VerificationSession for each verification in your system. A VerificationSession transitions through [multiple statuses](/docs/identity/how-sessions-work) throughout its lifetime as it progresses through the verification flow. +/// The VerificationSession contains the user's verified data after verification checks are complete. Related guide: [The Verification Sessions API](https://stripe.com/docs/identity/verification-sessions) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct GelatoVerificationSession { + /// The short-lived client secret used by Stripe.js to [show a verification modal](https://stripe.com/docs/js/identity/modal) inside your app. + /// + /// This client secret expires after 24 hours and can only be used once. + /// Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. + /// Make sure that you have TLS enabled on any page that includes the client secret. + /// Refer to our docs on [passing the client secret to the frontend](https://stripe.com/docs/identity/verification-sessions#client-secret) to learn more. + pub client_secret: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Unique identifier for the object. + pub id: stripe_misc::gelato_verification_session::IdentityVerificationSessionId, + /// If present, this property tells you the last error encountered when processing the verification. + pub last_error: Option, + /// ID of the most recent VerificationReport. + /// + /// [Learn more about accessing detailed verification results.](https://stripe.com/docs/identity/verification-sessions#results). + pub last_verification_report: + Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// A set of options for the session’s verification checks. + pub options: Option, + /// Redaction status of this VerificationSession. + /// + /// If the VerificationSession is not redacted, this field will be null. + pub redaction: Option, + /// Status of this VerificationSession. + /// + /// [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). + pub status: GelatoVerificationSessionStatus, + /// The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. + #[serde(rename = "type")] + pub type_: Option, + /// The short-lived URL that you use to redirect a user to Stripe to submit their identity information. + /// + /// This URL expires after 48 hours and can only be used once. + /// Don’t store it, log it, send it in emails or expose it to anyone other than the user. + /// Refer to our docs on [verifying identity documents](https://stripe.com/docs/identity/verify-identity-documents?platform=web&type=redirect) to learn how to redirect users to Stripe. + pub url: Option, + /// The user’s verified data. + pub verified_outputs: Option, +} +/// Status of this VerificationSession. +/// +/// [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoVerificationSessionStatus { + Canceled, + Processing, + RequiresInput, + Verified, +} +impl GelatoVerificationSessionStatus { + pub fn as_str(self) -> &'static str { + use GelatoVerificationSessionStatus::*; + match self { + Canceled => "canceled", + Processing => "processing", + RequiresInput => "requires_input", + Verified => "verified", + } + } +} + +impl std::str::FromStr for GelatoVerificationSessionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoVerificationSessionStatus::*; + match s { + "canceled" => Ok(Canceled), + "processing" => Ok(Processing), + "requires_input" => Ok(RequiresInput), + "verified" => Ok(Verified), + _ => Err(()), + } + } +} +impl AsRef for GelatoVerificationSessionStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for GelatoVerificationSessionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoVerificationSessionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoVerificationSessionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoVerificationSessionStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for GelatoVerificationSessionStatus") + }) + } +} +/// The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoVerificationSessionType { + Document, + IdNumber, +} +impl GelatoVerificationSessionType { + pub fn as_str(self) -> &'static str { + use GelatoVerificationSessionType::*; + match self { + Document => "document", + IdNumber => "id_number", + } + } +} + +impl std::str::FromStr for GelatoVerificationSessionType { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoVerificationSessionType::*; + match s { + "document" => Ok(Document), + "id_number" => Ok(IdNumber), + _ => Err(()), + } + } +} +impl AsRef for GelatoVerificationSessionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for GelatoVerificationSessionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoVerificationSessionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoVerificationSessionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoVerificationSessionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for GelatoVerificationSessionType") + }) + } +} +impl stripe_types::Object for GelatoVerificationSession { + type Id = stripe_misc::gelato_verification_session::IdentityVerificationSessionId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(IdentityVerificationSessionId); +#[cfg(feature = "gelato_verification_session")] +mod requests; +#[cfg(feature = "gelato_verification_session")] +pub use requests::*; diff --git a/generated/stripe_misc/src/gelato_verification_session/requests.rs b/generated/stripe_misc/src/gelato_verification_session/requests.rs new file mode 100644 index 000000000..e8305876a --- /dev/null +++ b/generated/stripe_misc/src/gelato_verification_session/requests.rs @@ -0,0 +1,571 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateGelatoVerificationSession<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A set of options for the session’s verification checks. + #[serde(skip_serializing_if = "Option::is_none")] + pub options: Option>, + /// The URL that the user will be redirected to upon completing the verification flow. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, + /// The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. + #[serde(rename = "type")] + pub type_: CreateGelatoVerificationSessionType, +} +impl<'a> CreateGelatoVerificationSession<'a> { + pub fn new(type_: CreateGelatoVerificationSessionType) -> Self { + Self { + expand: Default::default(), + metadata: Default::default(), + options: Default::default(), + return_url: Default::default(), + type_, + } + } +} +/// A set of options for the session’s verification checks. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateGelatoVerificationSessionOptions<'a> { + /// Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> CreateGelatoVerificationSessionOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateGelatoVerificationSessionOptionsDocument<'a> { + /// Array of strings of allowed identity document types. + /// + /// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_types: Option<&'a [CreateGelatoVerificationSessionOptionsDocumentAllowedTypes]>, + /// Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_id_number: Option, + /// Disable image uploads, identity document images have to be captured using the device’s camera. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_live_capture: Option, + /// Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. + /// + /// [Learn more](https://stripe.com/docs/identity/selfie). + #[serde(skip_serializing_if = "Option::is_none")] + pub require_matching_selfie: Option, +} +impl<'a> CreateGelatoVerificationSessionOptionsDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Array of strings of allowed identity document types. +/// +/// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateGelatoVerificationSessionOptionsDocumentAllowedTypes { + DrivingLicense, + IdCard, + Passport, +} +impl CreateGelatoVerificationSessionOptionsDocumentAllowedTypes { + pub fn as_str(self) -> &'static str { + use CreateGelatoVerificationSessionOptionsDocumentAllowedTypes::*; + match self { + DrivingLicense => "driving_license", + IdCard => "id_card", + Passport => "passport", + } + } +} + +impl std::str::FromStr for CreateGelatoVerificationSessionOptionsDocumentAllowedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateGelatoVerificationSessionOptionsDocumentAllowedTypes::*; + match s { + "driving_license" => Ok(DrivingLicense), + "id_card" => Ok(IdCard), + "passport" => Ok(Passport), + _ => Err(()), + } + } +} +impl AsRef for CreateGelatoVerificationSessionOptionsDocumentAllowedTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateGelatoVerificationSessionOptionsDocumentAllowedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateGelatoVerificationSessionOptionsDocumentAllowedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateGelatoVerificationSessionOptionsDocumentAllowedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateGelatoVerificationSessionType { + Document, + IdNumber, +} +impl CreateGelatoVerificationSessionType { + pub fn as_str(self) -> &'static str { + use CreateGelatoVerificationSessionType::*; + match self { + Document => "document", + IdNumber => "id_number", + } + } +} + +impl std::str::FromStr for CreateGelatoVerificationSessionType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateGelatoVerificationSessionType::*; + match s { + "document" => Ok(Document), + "id_number" => Ok(IdNumber), + _ => Err(()), + } + } +} +impl AsRef for CreateGelatoVerificationSessionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateGelatoVerificationSessionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateGelatoVerificationSessionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateGelatoVerificationSessionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateGelatoVerificationSession<'a> { + /// Creates a VerificationSession object. + /// + /// After the VerificationSession is created, display a verification modal using the session `client_secret` or send your users to the session’s `url`. + /// + /// If your API key is in test mode, verification checks won’t actually process, though everything else will occur as if in live mode. + /// + /// Related guide: [Verify your users’ identity documents](https://stripe.com/docs/identity/verify-identity-documents). + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/identity/verification_sessions", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveGelatoVerificationSession<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveGelatoVerificationSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveGelatoVerificationSession<'a> { + /// Retrieves the details of a VerificationSession that was previously created. + /// + /// When the session status is `requires_input`, you can use this method to retrieve a valid + /// `client_secret` or `url` to allow re-submission. + pub fn send( + &self, + client: &stripe::Client, + session: &str, + ) -> stripe::Response { + client.get_query(&format!("/identity/verification_sessions/{session}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListGelatoVerificationSession<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return VerificationSessions with this status. + /// + /// [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListGelatoVerificationSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Only return VerificationSessions with this status. +/// +/// [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListGelatoVerificationSessionStatus { + Canceled, + Processing, + RequiresInput, + Verified, +} +impl ListGelatoVerificationSessionStatus { + pub fn as_str(self) -> &'static str { + use ListGelatoVerificationSessionStatus::*; + match self { + Canceled => "canceled", + Processing => "processing", + RequiresInput => "requires_input", + Verified => "verified", + } + } +} + +impl std::str::FromStr for ListGelatoVerificationSessionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListGelatoVerificationSessionStatus::*; + match s { + "canceled" => Ok(Canceled), + "processing" => Ok(Processing), + "requires_input" => Ok(RequiresInput), + "verified" => Ok(Verified), + _ => Err(()), + } + } +} +impl AsRef for ListGelatoVerificationSessionStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListGelatoVerificationSessionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListGelatoVerificationSessionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListGelatoVerificationSessionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListGelatoVerificationSession<'a> { + /// Returns a list of VerificationSessions. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/identity/verification_sessions", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/identity/verification_sessions", self) + } +} +impl<'a> stripe::PaginationParams for ListGelatoVerificationSession<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelGelatoVerificationSession<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelGelatoVerificationSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelGelatoVerificationSession<'a> { + /// A VerificationSession object can be canceled when it is in `requires_input` [status](https://stripe.com/docs/identity/how-sessions-work). + /// + /// Once canceled, future submission attempts are disabled. + /// + /// This cannot be undone. + /// [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). + pub fn send( + &self, + client: &stripe::Client, + session: &str, + ) -> stripe::Response { + client.send_form( + &format!("/identity/verification_sessions/{session}/cancel"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RedactGelatoVerificationSession<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RedactGelatoVerificationSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RedactGelatoVerificationSession<'a> { + /// Redact a VerificationSession to remove all collected information from Stripe. + /// + /// This will redact the VerificationSession and all objects related to it, including VerificationReports, Events, request logs, etc. A VerificationSession object can be redacted when it is in `requires_input` or `verified` [status](https://stripe.com/docs/identity/how-sessions-work). + /// Redacting a VerificationSession in `requires_action` state will automatically cancel it. The redaction process may take up to four days. + /// When the redaction process is in progress, the VerificationSession’s `redaction.status` field will be set to `processing`; when the process is finished, it will change to `redacted` and an `identity.verification_session.redacted` event will be emitted. Redaction is irreversible. + /// Redacted objects are still accessible in the Stripe API, but all the fields that contain personal data will be replaced by the string `[redacted]` or a similar placeholder. + /// The `metadata` field will also be erased. + /// Redacted objects cannot be updated or used for any purpose. [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). + pub fn send( + &self, + client: &stripe::Client, + session: &str, + ) -> stripe::Response { + client.send_form( + &format!("/identity/verification_sessions/{session}/redact"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateGelatoVerificationSession<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A set of options for the session’s verification checks. + #[serde(skip_serializing_if = "Option::is_none")] + pub options: Option>, + /// The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> UpdateGelatoVerificationSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A set of options for the session’s verification checks. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateGelatoVerificationSessionOptions<'a> { + /// Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> UpdateGelatoVerificationSessionOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateGelatoVerificationSessionOptionsDocument<'a> { + /// Array of strings of allowed identity document types. + /// + /// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_types: Option<&'a [UpdateGelatoVerificationSessionOptionsDocumentAllowedTypes]>, + /// Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_id_number: Option, + /// Disable image uploads, identity document images have to be captured using the device’s camera. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_live_capture: Option, + /// Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. + /// + /// [Learn more](https://stripe.com/docs/identity/selfie). + #[serde(skip_serializing_if = "Option::is_none")] + pub require_matching_selfie: Option, +} +impl<'a> UpdateGelatoVerificationSessionOptionsDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Array of strings of allowed identity document types. +/// +/// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateGelatoVerificationSessionOptionsDocumentAllowedTypes { + DrivingLicense, + IdCard, + Passport, +} +impl UpdateGelatoVerificationSessionOptionsDocumentAllowedTypes { + pub fn as_str(self) -> &'static str { + use UpdateGelatoVerificationSessionOptionsDocumentAllowedTypes::*; + match self { + DrivingLicense => "driving_license", + IdCard => "id_card", + Passport => "passport", + } + } +} + +impl std::str::FromStr for UpdateGelatoVerificationSessionOptionsDocumentAllowedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateGelatoVerificationSessionOptionsDocumentAllowedTypes::*; + match s { + "driving_license" => Ok(DrivingLicense), + "id_card" => Ok(IdCard), + "passport" => Ok(Passport), + _ => Err(()), + } + } +} +impl AsRef for UpdateGelatoVerificationSessionOptionsDocumentAllowedTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateGelatoVerificationSessionOptionsDocumentAllowedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateGelatoVerificationSessionOptionsDocumentAllowedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateGelatoVerificationSessionOptionsDocumentAllowedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateGelatoVerificationSessionType { + Document, + IdNumber, +} +impl UpdateGelatoVerificationSessionType { + pub fn as_str(self) -> &'static str { + use UpdateGelatoVerificationSessionType::*; + match self { + Document => "document", + IdNumber => "id_number", + } + } +} + +impl std::str::FromStr for UpdateGelatoVerificationSessionType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateGelatoVerificationSessionType::*; + match s { + "document" => Ok(Document), + "id_number" => Ok(IdNumber), + _ => Err(()), + } + } +} +impl AsRef for UpdateGelatoVerificationSessionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateGelatoVerificationSessionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateGelatoVerificationSessionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateGelatoVerificationSessionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateGelatoVerificationSession<'a> { + /// Updates a VerificationSession object. + /// + /// When the session status is `requires_input`, you can use this method to update the + /// verification check and options. + pub fn send( + &self, + client: &stripe::Client, + session: &str, + ) -> stripe::Response { + client.send_form( + &format!("/identity/verification_sessions/{session}"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_misc/src/gelato_verification_session_options/mod.rs b/generated/stripe_misc/src/gelato_verification_session_options/mod.rs new file mode 100644 index 000000000..fdce179be --- /dev/null +++ b/generated/stripe_misc/src/gelato_verification_session_options/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoVerificationSessionOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option, +} diff --git a/generated/stripe_misc/src/gelato_verified_outputs/mod.rs b/generated/stripe_misc/src/gelato_verified_outputs/mod.rs new file mode 100644 index 000000000..915e53ea9 --- /dev/null +++ b/generated/stripe_misc/src/gelato_verified_outputs/mod.rs @@ -0,0 +1,78 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoVerifiedOutputs { + /// The user's verified address. + pub address: Option, + /// The user’s verified date of birth. + pub dob: Option, + /// The user's verified first name. + pub first_name: Option, + /// The user's verified id number. + pub id_number: Option, + /// The user's verified id number type. + pub id_number_type: Option, + /// The user's verified last name. + pub last_name: Option, +} +/// The user's verified id number type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoVerifiedOutputsIdNumberType { + BrCpf, + SgNric, + UsSsn, +} +impl GelatoVerifiedOutputsIdNumberType { + pub fn as_str(self) -> &'static str { + use GelatoVerifiedOutputsIdNumberType::*; + match self { + BrCpf => "br_cpf", + SgNric => "sg_nric", + UsSsn => "us_ssn", + } + } +} + +impl std::str::FromStr for GelatoVerifiedOutputsIdNumberType { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoVerifiedOutputsIdNumberType::*; + match s { + "br_cpf" => Ok(BrCpf), + "sg_nric" => Ok(SgNric), + "us_ssn" => Ok(UsSsn), + _ => Err(()), + } + } +} +impl AsRef for GelatoVerifiedOutputsIdNumberType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for GelatoVerifiedOutputsIdNumberType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoVerifiedOutputsIdNumberType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoVerifiedOutputsIdNumberType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoVerifiedOutputsIdNumberType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for GelatoVerifiedOutputsIdNumberType") + }) + } +} diff --git a/generated/stripe_misc/src/mod.rs b/generated/stripe_misc/src/mod.rs new file mode 100644 index 000000000..5907bc75e --- /dev/null +++ b/generated/stripe_misc/src/mod.rs @@ -0,0 +1,158 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::invalid_html_tags)] +extern crate self as stripe_misc; +pub mod apple_pay_domain; +pub use apple_pay_domain::ApplePayDomain; +pub mod bank_connections_resource_accountholder; +pub use bank_connections_resource_accountholder::BankConnectionsResourceAccountholder; +pub mod bank_connections_resource_balance; +pub use bank_connections_resource_balance::BankConnectionsResourceBalance; +pub mod bank_connections_resource_balance_api_resource_cash_balance; +pub use bank_connections_resource_balance_api_resource_cash_balance::BankConnectionsResourceBalanceApiResourceCashBalance; +pub mod bank_connections_resource_balance_api_resource_credit_balance; +pub use bank_connections_resource_balance_api_resource_credit_balance::BankConnectionsResourceBalanceApiResourceCreditBalance; +pub mod bank_connections_resource_balance_refresh; +pub use bank_connections_resource_balance_refresh::BankConnectionsResourceBalanceRefresh; +pub mod bank_connections_resource_link_account_session_filters; +pub use bank_connections_resource_link_account_session_filters::BankConnectionsResourceLinkAccountSessionFilters; +pub mod bank_connections_resource_ownership_refresh; +pub use bank_connections_resource_ownership_refresh::BankConnectionsResourceOwnershipRefresh; +pub mod deleted_apple_pay_domain; +pub use deleted_apple_pay_domain::DeletedApplePayDomain; +pub mod notification_webhook_endpoint; +pub use notification_webhook_endpoint::NotificationWebhookEndpoint; +pub mod verification_session_redaction; +pub use verification_session_redaction::VerificationSessionRedaction; +pub mod notification_webhook_endpoint_deleted; +pub use notification_webhook_endpoint_deleted::NotificationWebhookEndpointDeleted; +pub mod ephemeral_key; +pub use ephemeral_key::EphemeralKey; +pub mod exchange_rate; +pub use exchange_rate::ExchangeRate; +pub mod bank_connections_resource_linked_account; +pub use bank_connections_resource_linked_account::BankConnectionsResourceLinkedAccount; +pub mod bank_connections_resource_owner; +pub use bank_connections_resource_owner::BankConnectionsResourceOwner; +pub mod bank_connections_resource_ownership; +pub use bank_connections_resource_ownership::BankConnectionsResourceOwnership; +pub mod bank_connections_resource_link_account_session; +pub use bank_connections_resource_link_account_session::BankConnectionsResourceLinkAccountSession; +pub mod financial_reporting_finance_report_run_run_parameters; +pub use financial_reporting_finance_report_run_run_parameters::FinancialReportingFinanceReportRunRunParameters; +pub mod gelato_data_document_report_date_of_birth; +pub use gelato_data_document_report_date_of_birth::GelatoDataDocumentReportDateOfBirth; +pub mod gelato_data_document_report_expiration_date; +pub use gelato_data_document_report_expiration_date::GelatoDataDocumentReportExpirationDate; +pub mod gelato_data_document_report_issued_date; +pub use gelato_data_document_report_issued_date::GelatoDataDocumentReportIssuedDate; +pub mod gelato_data_id_number_report_date; +pub use gelato_data_id_number_report_date::GelatoDataIdNumberReportDate; +pub mod gelato_data_verified_outputs_date; +pub use gelato_data_verified_outputs_date::GelatoDataVerifiedOutputsDate; +pub mod gelato_document_report; +pub use gelato_document_report::GelatoDocumentReport; +pub mod gelato_document_report_error; +pub use gelato_document_report_error::GelatoDocumentReportError; +pub mod gelato_id_number_report; +pub use gelato_id_number_report::GelatoIdNumberReport; +pub mod gelato_id_number_report_error; +pub use gelato_id_number_report_error::GelatoIdNumberReportError; +pub mod gelato_report_document_options; +pub use gelato_report_document_options::GelatoReportDocumentOptions; +pub mod gelato_report_id_number_options; +pub use gelato_report_id_number_options::GelatoReportIdNumberOptions; +pub mod gelato_selfie_report; +pub use gelato_selfie_report::GelatoSelfieReport; +pub mod gelato_selfie_report_error; +pub use gelato_selfie_report_error::GelatoSelfieReportError; +pub mod gelato_session_document_options; +pub use gelato_session_document_options::GelatoSessionDocumentOptions; +pub mod gelato_session_id_number_options; +pub use gelato_session_id_number_options::GelatoSessionIdNumberOptions; +pub mod gelato_session_last_error; +pub use gelato_session_last_error::GelatoSessionLastError; +pub mod gelato_verification_report_options; +pub use gelato_verification_report_options::GelatoVerificationReportOptions; +pub mod gelato_verification_session_options; +pub use gelato_verification_session_options::GelatoVerificationSessionOptions; +pub mod gelato_verified_outputs; +pub use gelato_verified_outputs::GelatoVerifiedOutputs; +pub mod gelato_verification_report; +pub use gelato_verification_report::GelatoVerificationReport; +pub mod gelato_verification_session; +pub use gelato_verification_session::GelatoVerificationSession; +pub mod reporting_report_run; +pub use reporting_report_run::ReportingReportRun; +pub mod reporting_report_type; +pub use reporting_report_type::ReportingReportType; +pub mod scheduled_query_run; +pub use scheduled_query_run::ScheduledQueryRun; +pub mod sigma_scheduled_query_run_error; +pub use sigma_scheduled_query_run_error::SigmaScheduledQueryRunError; +pub mod tax_product_resource_tax_calculation; +pub use tax_product_resource_tax_calculation::TaxProductResourceTaxCalculation; +pub mod tax_product_resource_tax_calculation_line_item; +pub use tax_product_resource_tax_calculation_line_item::TaxProductResourceTaxCalculationLineItem; +pub mod tax_product_registrations_resource_tax_registration; +pub use tax_product_registrations_resource_tax_registration::TaxProductRegistrationsResourceTaxRegistration; +pub mod tax_product_resource_tax_settings; +pub use tax_product_resource_tax_settings::TaxProductResourceTaxSettings; +pub mod tax_product_resource_tax_transaction; +pub use tax_product_resource_tax_transaction::TaxProductResourceTaxTransaction; +pub mod tax_product_resource_tax_transaction_line_item; +pub use tax_product_resource_tax_transaction_line_item::TaxProductResourceTaxTransactionLineItem; +pub mod tax_product_registrations_resource_country_options; +pub use tax_product_registrations_resource_country_options::TaxProductRegistrationsResourceCountryOptions; +pub mod tax_product_registrations_resource_country_options_ca_province_standard; +pub use tax_product_registrations_resource_country_options_ca_province_standard::TaxProductRegistrationsResourceCountryOptionsCaProvinceStandard; +pub mod tax_product_registrations_resource_country_options_canada; +pub use tax_product_registrations_resource_country_options_canada::TaxProductRegistrationsResourceCountryOptionsCanada; +pub mod tax_product_registrations_resource_country_options_default; +pub use tax_product_registrations_resource_country_options_default::TaxProductRegistrationsResourceCountryOptionsDefault; +pub mod tax_product_registrations_resource_country_options_eu_standard; +pub use tax_product_registrations_resource_country_options_eu_standard::TaxProductRegistrationsResourceCountryOptionsEuStandard; +pub mod tax_product_registrations_resource_country_options_europe; +pub use tax_product_registrations_resource_country_options_europe::TaxProductRegistrationsResourceCountryOptionsEurope; +pub mod tax_product_registrations_resource_country_options_simplified; +pub use tax_product_registrations_resource_country_options_simplified::TaxProductRegistrationsResourceCountryOptionsSimplified; +pub mod tax_product_registrations_resource_country_options_united_states; +pub use tax_product_registrations_resource_country_options_united_states::TaxProductRegistrationsResourceCountryOptionsUnitedStates; +pub mod tax_product_registrations_resource_country_options_us_local_amusement_tax; +pub use tax_product_registrations_resource_country_options_us_local_amusement_tax::TaxProductRegistrationsResourceCountryOptionsUsLocalAmusementTax; +pub mod tax_product_registrations_resource_country_options_us_local_lease_tax; +pub use tax_product_registrations_resource_country_options_us_local_lease_tax::TaxProductRegistrationsResourceCountryOptionsUsLocalLeaseTax; +pub mod tax_product_resource_customer_details; +pub use tax_product_resource_customer_details::TaxProductResourceCustomerDetails; +pub mod tax_product_resource_customer_details_resource_tax_id; +pub use tax_product_resource_customer_details_resource_tax_id::TaxProductResourceCustomerDetailsResourceTaxId; +pub mod tax_product_resource_jurisdiction; +pub use tax_product_resource_jurisdiction::TaxProductResourceJurisdiction; +pub mod tax_product_resource_line_item_tax_breakdown; +pub use tax_product_resource_line_item_tax_breakdown::TaxProductResourceLineItemTaxBreakdown; +pub mod tax_product_resource_line_item_tax_rate_details; +pub use tax_product_resource_line_item_tax_rate_details::TaxProductResourceLineItemTaxRateDetails; +pub mod tax_product_resource_postal_address; +pub use tax_product_resource_postal_address::TaxProductResourcePostalAddress; +pub mod tax_product_resource_tax_breakdown; +pub use tax_product_resource_tax_breakdown::TaxProductResourceTaxBreakdown; +pub mod tax_product_resource_tax_calculation_shipping_cost; +pub use tax_product_resource_tax_calculation_shipping_cost::TaxProductResourceTaxCalculationShippingCost; +pub mod tax_product_resource_tax_rate_details; +pub use tax_product_resource_tax_rate_details::TaxProductResourceTaxRateDetails; +pub mod tax_product_resource_tax_settings_defaults; +pub use tax_product_resource_tax_settings_defaults::TaxProductResourceTaxSettingsDefaults; +pub mod tax_product_resource_tax_settings_head_office; +pub use tax_product_resource_tax_settings_head_office::TaxProductResourceTaxSettingsHeadOffice; +pub mod tax_product_resource_tax_settings_status_details; +pub use tax_product_resource_tax_settings_status_details::TaxProductResourceTaxSettingsStatusDetails; +pub mod tax_product_resource_tax_settings_status_details_resource_active; +pub use tax_product_resource_tax_settings_status_details_resource_active::TaxProductResourceTaxSettingsStatusDetailsResourceActive; +pub mod tax_product_resource_tax_settings_status_details_resource_pending; +pub use tax_product_resource_tax_settings_status_details_resource_pending::TaxProductResourceTaxSettingsStatusDetailsResourcePending; +pub mod tax_product_resource_tax_transaction_line_item_resource_reversal; +pub use tax_product_resource_tax_transaction_line_item_resource_reversal::TaxProductResourceTaxTransactionLineItemResourceReversal; +pub mod tax_product_resource_tax_transaction_resource_reversal; +pub use tax_product_resource_tax_transaction_resource_reversal::TaxProductResourceTaxTransactionResourceReversal; +pub mod tax_product_resource_tax_transaction_shipping_cost; +pub use tax_product_resource_tax_transaction_shipping_cost::TaxProductResourceTaxTransactionShippingCost; diff --git a/generated/stripe_misc/src/notification_webhook_endpoint/mod.rs b/generated/stripe_misc/src/notification_webhook_endpoint/mod.rs new file mode 100644 index 000000000..8f4a14479 --- /dev/null +++ b/generated/stripe_misc/src/notification_webhook_endpoint/mod.rs @@ -0,0 +1,56 @@ +/// You can configure [webhook endpoints](https://stripe.com/docs/webhooks/) via the API to be +/// notified about events that happen in your Stripe account or connected +/// accounts. +/// +/// Most users configure webhooks from [the dashboard](https://dashboard.stripe.com/webhooks), which provides a user interface for registering and testing your webhook endpoints. +/// +/// Related guide: [Setting up webhooks](https://stripe.com/docs/webhooks/configure) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct NotificationWebhookEndpoint { + /// The API version events are rendered as for this webhook endpoint. + pub api_version: Option, + /// The ID of the associated Connect application. + pub application: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// An optional description of what the webhook is used for. + pub description: Option, + /// The list of events to enable for this endpoint. + /// + /// `['*']` indicates that all events are enabled, except those that require explicit selection. + pub enabled_events: Vec, + /// Unique identifier for the object. + pub id: stripe_misc::notification_webhook_endpoint::WebhookEndpointId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The endpoint's secret, used to generate [webhook signatures](https://stripe.com/docs/webhooks/signatures). + /// + /// Only returned at creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub secret: Option, + /// The status of the webhook. + /// + /// It can be `enabled` or `disabled`. + pub status: String, + /// The URL of the webhook endpoint. + pub url: String, +} +impl stripe_types::Object for NotificationWebhookEndpoint { + type Id = stripe_misc::notification_webhook_endpoint::WebhookEndpointId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(WebhookEndpointId, "we_"); +#[cfg(feature = "notification_webhook_endpoint")] +mod requests; +#[cfg(feature = "notification_webhook_endpoint")] +pub use requests::*; diff --git a/generated/stripe_misc/src/notification_webhook_endpoint/requests.rs b/generated/stripe_misc/src/notification_webhook_endpoint/requests.rs new file mode 100644 index 000000000..cd6778ed7 --- /dev/null +++ b/generated/stripe_misc/src/notification_webhook_endpoint/requests.rs @@ -0,0 +1,1680 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListNotificationWebhookEndpoint<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListNotificationWebhookEndpoint<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListNotificationWebhookEndpoint<'a> { + /// Returns a list of your webhook endpoints. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/webhook_endpoints", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/webhook_endpoints", self) + } +} +impl<'a> stripe::PaginationParams for ListNotificationWebhookEndpoint<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveNotificationWebhookEndpoint<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveNotificationWebhookEndpoint<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveNotificationWebhookEndpoint<'a> { + /// Retrieves the webhook endpoint with the given ID. + pub fn send( + &self, + client: &stripe::Client, + webhook_endpoint: &stripe_misc::notification_webhook_endpoint::WebhookEndpointId, + ) -> stripe::Response { + client.get_query(&format!("/webhook_endpoints/{webhook_endpoint}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateNotificationWebhookEndpoint<'a> { + /// Events sent to this endpoint will be generated with this Stripe Version instead of your account's default Stripe Version. + #[serde(skip_serializing_if = "Option::is_none")] + pub api_version: Option, + /// Whether this endpoint should receive events from connected accounts (`true`), or from your account (`false`). + /// + /// Defaults to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub connect: Option, + /// An optional description of what the webhook is used for. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The list of events to enable for this endpoint. + /// + /// You may specify `['*']` to enable all events, except those that require explicit selection. + pub enabled_events: &'a [CreateNotificationWebhookEndpointEnabledEvents], + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The URL of the webhook endpoint. + pub url: &'a str, +} +impl<'a> CreateNotificationWebhookEndpoint<'a> { + pub fn new( + enabled_events: &'a [CreateNotificationWebhookEndpointEnabledEvents], + url: &'a str, + ) -> Self { + Self { + api_version: Default::default(), + connect: Default::default(), + description: Default::default(), + enabled_events, + expand: Default::default(), + metadata: Default::default(), + url, + } + } +} +/// The list of events to enable for this endpoint. +/// +/// You may specify `['*']` to enable all events, except those that require explicit selection. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateNotificationWebhookEndpointEnabledEvents { + All, + AccountApplicationAuthorized, + AccountApplicationDeauthorized, + AccountExternalAccountCreated, + AccountExternalAccountDeleted, + AccountExternalAccountUpdated, + AccountUpdated, + ApplicationFeeCreated, + ApplicationFeeRefundUpdated, + ApplicationFeeRefunded, + BalanceAvailable, + BillingPortalConfigurationCreated, + BillingPortalConfigurationUpdated, + BillingPortalSessionCreated, + CapabilityUpdated, + CashBalanceFundsAvailable, + ChargeCaptured, + ChargeDisputeClosed, + ChargeDisputeCreated, + ChargeDisputeFundsReinstated, + ChargeDisputeFundsWithdrawn, + ChargeDisputeUpdated, + ChargeExpired, + ChargeFailed, + ChargePending, + ChargeRefundUpdated, + ChargeRefunded, + ChargeSucceeded, + ChargeUpdated, + CheckoutSessionAsyncPaymentFailed, + CheckoutSessionAsyncPaymentSucceeded, + CheckoutSessionCompleted, + CheckoutSessionExpired, + CouponCreated, + CouponDeleted, + CouponUpdated, + CreditNoteCreated, + CreditNoteUpdated, + CreditNoteVoided, + CustomerCreated, + CustomerDeleted, + CustomerDiscountCreated, + CustomerDiscountDeleted, + CustomerDiscountUpdated, + CustomerSourceCreated, + CustomerSourceDeleted, + CustomerSourceExpiring, + CustomerSourceUpdated, + CustomerSubscriptionCreated, + CustomerSubscriptionDeleted, + CustomerSubscriptionPaused, + CustomerSubscriptionPendingUpdateApplied, + CustomerSubscriptionPendingUpdateExpired, + CustomerSubscriptionResumed, + CustomerSubscriptionTrialWillEnd, + CustomerSubscriptionUpdated, + CustomerTaxIdCreated, + CustomerTaxIdDeleted, + CustomerTaxIdUpdated, + CustomerUpdated, + CustomerCashBalanceTransactionCreated, + FileCreated, + FinancialConnectionsAccountCreated, + FinancialConnectionsAccountDeactivated, + FinancialConnectionsAccountDisconnected, + FinancialConnectionsAccountReactivated, + FinancialConnectionsAccountRefreshedBalance, + IdentityVerificationSessionCanceled, + IdentityVerificationSessionCreated, + IdentityVerificationSessionProcessing, + IdentityVerificationSessionRedacted, + IdentityVerificationSessionRequiresInput, + IdentityVerificationSessionVerified, + InvoiceCreated, + InvoiceDeleted, + InvoiceFinalizationFailed, + InvoiceFinalized, + InvoiceMarkedUncollectible, + InvoicePaid, + InvoicePaymentActionRequired, + InvoicePaymentFailed, + InvoicePaymentSucceeded, + InvoiceSent, + InvoiceUpcoming, + InvoiceUpdated, + InvoiceVoided, + InvoiceitemCreated, + InvoiceitemDeleted, + IssuingAuthorizationCreated, + IssuingAuthorizationRequest, + IssuingAuthorizationUpdated, + IssuingCardCreated, + IssuingCardUpdated, + IssuingCardholderCreated, + IssuingCardholderUpdated, + IssuingDisputeClosed, + IssuingDisputeCreated, + IssuingDisputeFundsReinstated, + IssuingDisputeSubmitted, + IssuingDisputeUpdated, + IssuingTokenCreated, + IssuingTokenUpdated, + IssuingTransactionCreated, + IssuingTransactionUpdated, + MandateUpdated, + PaymentIntentAmountCapturableUpdated, + PaymentIntentCanceled, + PaymentIntentCreated, + PaymentIntentPartiallyFunded, + PaymentIntentPaymentFailed, + PaymentIntentProcessing, + PaymentIntentRequiresAction, + PaymentIntentSucceeded, + PaymentLinkCreated, + PaymentLinkUpdated, + PaymentMethodAttached, + PaymentMethodAutomaticallyUpdated, + PaymentMethodDetached, + PaymentMethodUpdated, + PayoutCanceled, + PayoutCreated, + PayoutFailed, + PayoutPaid, + PayoutReconciliationCompleted, + PayoutUpdated, + PersonCreated, + PersonDeleted, + PersonUpdated, + PlanCreated, + PlanDeleted, + PlanUpdated, + PriceCreated, + PriceDeleted, + PriceUpdated, + ProductCreated, + ProductDeleted, + ProductUpdated, + PromotionCodeCreated, + PromotionCodeUpdated, + QuoteAccepted, + QuoteCanceled, + QuoteCreated, + QuoteFinalized, + RadarEarlyFraudWarningCreated, + RadarEarlyFraudWarningUpdated, + RefundCreated, + RefundUpdated, + ReportingReportRunFailed, + ReportingReportRunSucceeded, + ReportingReportTypeUpdated, + ReviewClosed, + ReviewOpened, + SetupIntentCanceled, + SetupIntentCreated, + SetupIntentRequiresAction, + SetupIntentSetupFailed, + SetupIntentSucceeded, + SigmaScheduledQueryRunCreated, + SourceCanceled, + SourceChargeable, + SourceFailed, + SourceMandateNotification, + SourceRefundAttributesRequired, + SourceTransactionCreated, + SourceTransactionUpdated, + SubscriptionScheduleAborted, + SubscriptionScheduleCanceled, + SubscriptionScheduleCompleted, + SubscriptionScheduleCreated, + SubscriptionScheduleExpiring, + SubscriptionScheduleReleased, + SubscriptionScheduleUpdated, + TaxSettingsUpdated, + TaxRateCreated, + TaxRateUpdated, + TerminalReaderActionFailed, + TerminalReaderActionSucceeded, + TestHelpersTestClockAdvancing, + TestHelpersTestClockCreated, + TestHelpersTestClockDeleted, + TestHelpersTestClockInternalFailure, + TestHelpersTestClockReady, + TopupCanceled, + TopupCreated, + TopupFailed, + TopupReversed, + TopupSucceeded, + TransferCreated, + TransferReversed, + TransferUpdated, + TreasuryCreditReversalCreated, + TreasuryCreditReversalPosted, + TreasuryDebitReversalCompleted, + TreasuryDebitReversalCreated, + TreasuryDebitReversalInitialCreditGranted, + TreasuryFinancialAccountClosed, + TreasuryFinancialAccountCreated, + TreasuryFinancialAccountFeaturesStatusUpdated, + TreasuryInboundTransferCanceled, + TreasuryInboundTransferCreated, + TreasuryInboundTransferFailed, + TreasuryInboundTransferSucceeded, + TreasuryOutboundPaymentCanceled, + TreasuryOutboundPaymentCreated, + TreasuryOutboundPaymentExpectedArrivalDateUpdated, + TreasuryOutboundPaymentFailed, + TreasuryOutboundPaymentPosted, + TreasuryOutboundPaymentReturned, + TreasuryOutboundTransferCanceled, + TreasuryOutboundTransferCreated, + TreasuryOutboundTransferExpectedArrivalDateUpdated, + TreasuryOutboundTransferFailed, + TreasuryOutboundTransferPosted, + TreasuryOutboundTransferReturned, + TreasuryReceivedCreditCreated, + TreasuryReceivedCreditFailed, + TreasuryReceivedCreditSucceeded, + TreasuryReceivedDebitCreated, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateNotificationWebhookEndpointEnabledEvents { + pub fn as_str(self) -> &'static str { + use CreateNotificationWebhookEndpointEnabledEvents::*; + match self { + All => "*", + AccountApplicationAuthorized => "account.application.authorized", + AccountApplicationDeauthorized => "account.application.deauthorized", + AccountExternalAccountCreated => "account.external_account.created", + AccountExternalAccountDeleted => "account.external_account.deleted", + AccountExternalAccountUpdated => "account.external_account.updated", + AccountUpdated => "account.updated", + ApplicationFeeCreated => "application_fee.created", + ApplicationFeeRefundUpdated => "application_fee.refund.updated", + ApplicationFeeRefunded => "application_fee.refunded", + BalanceAvailable => "balance.available", + BillingPortalConfigurationCreated => "billing_portal.configuration.created", + BillingPortalConfigurationUpdated => "billing_portal.configuration.updated", + BillingPortalSessionCreated => "billing_portal.session.created", + CapabilityUpdated => "capability.updated", + CashBalanceFundsAvailable => "cash_balance.funds_available", + ChargeCaptured => "charge.captured", + ChargeDisputeClosed => "charge.dispute.closed", + ChargeDisputeCreated => "charge.dispute.created", + ChargeDisputeFundsReinstated => "charge.dispute.funds_reinstated", + ChargeDisputeFundsWithdrawn => "charge.dispute.funds_withdrawn", + ChargeDisputeUpdated => "charge.dispute.updated", + ChargeExpired => "charge.expired", + ChargeFailed => "charge.failed", + ChargePending => "charge.pending", + ChargeRefundUpdated => "charge.refund.updated", + ChargeRefunded => "charge.refunded", + ChargeSucceeded => "charge.succeeded", + ChargeUpdated => "charge.updated", + CheckoutSessionAsyncPaymentFailed => "checkout.session.async_payment_failed", + CheckoutSessionAsyncPaymentSucceeded => "checkout.session.async_payment_succeeded", + CheckoutSessionCompleted => "checkout.session.completed", + CheckoutSessionExpired => "checkout.session.expired", + CouponCreated => "coupon.created", + CouponDeleted => "coupon.deleted", + CouponUpdated => "coupon.updated", + CreditNoteCreated => "credit_note.created", + CreditNoteUpdated => "credit_note.updated", + CreditNoteVoided => "credit_note.voided", + CustomerCreated => "customer.created", + CustomerDeleted => "customer.deleted", + CustomerDiscountCreated => "customer.discount.created", + CustomerDiscountDeleted => "customer.discount.deleted", + CustomerDiscountUpdated => "customer.discount.updated", + CustomerSourceCreated => "customer.source.created", + CustomerSourceDeleted => "customer.source.deleted", + CustomerSourceExpiring => "customer.source.expiring", + CustomerSourceUpdated => "customer.source.updated", + CustomerSubscriptionCreated => "customer.subscription.created", + CustomerSubscriptionDeleted => "customer.subscription.deleted", + CustomerSubscriptionPaused => "customer.subscription.paused", + CustomerSubscriptionPendingUpdateApplied => { + "customer.subscription.pending_update_applied" + } + CustomerSubscriptionPendingUpdateExpired => { + "customer.subscription.pending_update_expired" + } + CustomerSubscriptionResumed => "customer.subscription.resumed", + CustomerSubscriptionTrialWillEnd => "customer.subscription.trial_will_end", + CustomerSubscriptionUpdated => "customer.subscription.updated", + CustomerTaxIdCreated => "customer.tax_id.created", + CustomerTaxIdDeleted => "customer.tax_id.deleted", + CustomerTaxIdUpdated => "customer.tax_id.updated", + CustomerUpdated => "customer.updated", + CustomerCashBalanceTransactionCreated => "customer_cash_balance_transaction.created", + FileCreated => "file.created", + FinancialConnectionsAccountCreated => "financial_connections.account.created", + FinancialConnectionsAccountDeactivated => "financial_connections.account.deactivated", + FinancialConnectionsAccountDisconnected => "financial_connections.account.disconnected", + FinancialConnectionsAccountReactivated => "financial_connections.account.reactivated", + FinancialConnectionsAccountRefreshedBalance => { + "financial_connections.account.refreshed_balance" + } + IdentityVerificationSessionCanceled => "identity.verification_session.canceled", + IdentityVerificationSessionCreated => "identity.verification_session.created", + IdentityVerificationSessionProcessing => "identity.verification_session.processing", + IdentityVerificationSessionRedacted => "identity.verification_session.redacted", + IdentityVerificationSessionRequiresInput => { + "identity.verification_session.requires_input" + } + IdentityVerificationSessionVerified => "identity.verification_session.verified", + InvoiceCreated => "invoice.created", + InvoiceDeleted => "invoice.deleted", + InvoiceFinalizationFailed => "invoice.finalization_failed", + InvoiceFinalized => "invoice.finalized", + InvoiceMarkedUncollectible => "invoice.marked_uncollectible", + InvoicePaid => "invoice.paid", + InvoicePaymentActionRequired => "invoice.payment_action_required", + InvoicePaymentFailed => "invoice.payment_failed", + InvoicePaymentSucceeded => "invoice.payment_succeeded", + InvoiceSent => "invoice.sent", + InvoiceUpcoming => "invoice.upcoming", + InvoiceUpdated => "invoice.updated", + InvoiceVoided => "invoice.voided", + InvoiceitemCreated => "invoiceitem.created", + InvoiceitemDeleted => "invoiceitem.deleted", + IssuingAuthorizationCreated => "issuing_authorization.created", + IssuingAuthorizationRequest => "issuing_authorization.request", + IssuingAuthorizationUpdated => "issuing_authorization.updated", + IssuingCardCreated => "issuing_card.created", + IssuingCardUpdated => "issuing_card.updated", + IssuingCardholderCreated => "issuing_cardholder.created", + IssuingCardholderUpdated => "issuing_cardholder.updated", + IssuingDisputeClosed => "issuing_dispute.closed", + IssuingDisputeCreated => "issuing_dispute.created", + IssuingDisputeFundsReinstated => "issuing_dispute.funds_reinstated", + IssuingDisputeSubmitted => "issuing_dispute.submitted", + IssuingDisputeUpdated => "issuing_dispute.updated", + IssuingTokenCreated => "issuing_token.created", + IssuingTokenUpdated => "issuing_token.updated", + IssuingTransactionCreated => "issuing_transaction.created", + IssuingTransactionUpdated => "issuing_transaction.updated", + MandateUpdated => "mandate.updated", + PaymentIntentAmountCapturableUpdated => "payment_intent.amount_capturable_updated", + PaymentIntentCanceled => "payment_intent.canceled", + PaymentIntentCreated => "payment_intent.created", + PaymentIntentPartiallyFunded => "payment_intent.partially_funded", + PaymentIntentPaymentFailed => "payment_intent.payment_failed", + PaymentIntentProcessing => "payment_intent.processing", + PaymentIntentRequiresAction => "payment_intent.requires_action", + PaymentIntentSucceeded => "payment_intent.succeeded", + PaymentLinkCreated => "payment_link.created", + PaymentLinkUpdated => "payment_link.updated", + PaymentMethodAttached => "payment_method.attached", + PaymentMethodAutomaticallyUpdated => "payment_method.automatically_updated", + PaymentMethodDetached => "payment_method.detached", + PaymentMethodUpdated => "payment_method.updated", + PayoutCanceled => "payout.canceled", + PayoutCreated => "payout.created", + PayoutFailed => "payout.failed", + PayoutPaid => "payout.paid", + PayoutReconciliationCompleted => "payout.reconciliation_completed", + PayoutUpdated => "payout.updated", + PersonCreated => "person.created", + PersonDeleted => "person.deleted", + PersonUpdated => "person.updated", + PlanCreated => "plan.created", + PlanDeleted => "plan.deleted", + PlanUpdated => "plan.updated", + PriceCreated => "price.created", + PriceDeleted => "price.deleted", + PriceUpdated => "price.updated", + ProductCreated => "product.created", + ProductDeleted => "product.deleted", + ProductUpdated => "product.updated", + PromotionCodeCreated => "promotion_code.created", + PromotionCodeUpdated => "promotion_code.updated", + QuoteAccepted => "quote.accepted", + QuoteCanceled => "quote.canceled", + QuoteCreated => "quote.created", + QuoteFinalized => "quote.finalized", + RadarEarlyFraudWarningCreated => "radar.early_fraud_warning.created", + RadarEarlyFraudWarningUpdated => "radar.early_fraud_warning.updated", + RefundCreated => "refund.created", + RefundUpdated => "refund.updated", + ReportingReportRunFailed => "reporting.report_run.failed", + ReportingReportRunSucceeded => "reporting.report_run.succeeded", + ReportingReportTypeUpdated => "reporting.report_type.updated", + ReviewClosed => "review.closed", + ReviewOpened => "review.opened", + SetupIntentCanceled => "setup_intent.canceled", + SetupIntentCreated => "setup_intent.created", + SetupIntentRequiresAction => "setup_intent.requires_action", + SetupIntentSetupFailed => "setup_intent.setup_failed", + SetupIntentSucceeded => "setup_intent.succeeded", + SigmaScheduledQueryRunCreated => "sigma.scheduled_query_run.created", + SourceCanceled => "source.canceled", + SourceChargeable => "source.chargeable", + SourceFailed => "source.failed", + SourceMandateNotification => "source.mandate_notification", + SourceRefundAttributesRequired => "source.refund_attributes_required", + SourceTransactionCreated => "source.transaction.created", + SourceTransactionUpdated => "source.transaction.updated", + SubscriptionScheduleAborted => "subscription_schedule.aborted", + SubscriptionScheduleCanceled => "subscription_schedule.canceled", + SubscriptionScheduleCompleted => "subscription_schedule.completed", + SubscriptionScheduleCreated => "subscription_schedule.created", + SubscriptionScheduleExpiring => "subscription_schedule.expiring", + SubscriptionScheduleReleased => "subscription_schedule.released", + SubscriptionScheduleUpdated => "subscription_schedule.updated", + TaxSettingsUpdated => "tax.settings.updated", + TaxRateCreated => "tax_rate.created", + TaxRateUpdated => "tax_rate.updated", + TerminalReaderActionFailed => "terminal.reader.action_failed", + TerminalReaderActionSucceeded => "terminal.reader.action_succeeded", + TestHelpersTestClockAdvancing => "test_helpers.test_clock.advancing", + TestHelpersTestClockCreated => "test_helpers.test_clock.created", + TestHelpersTestClockDeleted => "test_helpers.test_clock.deleted", + TestHelpersTestClockInternalFailure => "test_helpers.test_clock.internal_failure", + TestHelpersTestClockReady => "test_helpers.test_clock.ready", + TopupCanceled => "topup.canceled", + TopupCreated => "topup.created", + TopupFailed => "topup.failed", + TopupReversed => "topup.reversed", + TopupSucceeded => "topup.succeeded", + TransferCreated => "transfer.created", + TransferReversed => "transfer.reversed", + TransferUpdated => "transfer.updated", + TreasuryCreditReversalCreated => "treasury.credit_reversal.created", + TreasuryCreditReversalPosted => "treasury.credit_reversal.posted", + TreasuryDebitReversalCompleted => "treasury.debit_reversal.completed", + TreasuryDebitReversalCreated => "treasury.debit_reversal.created", + TreasuryDebitReversalInitialCreditGranted => { + "treasury.debit_reversal.initial_credit_granted" + } + TreasuryFinancialAccountClosed => "treasury.financial_account.closed", + TreasuryFinancialAccountCreated => "treasury.financial_account.created", + TreasuryFinancialAccountFeaturesStatusUpdated => { + "treasury.financial_account.features_status_updated" + } + TreasuryInboundTransferCanceled => "treasury.inbound_transfer.canceled", + TreasuryInboundTransferCreated => "treasury.inbound_transfer.created", + TreasuryInboundTransferFailed => "treasury.inbound_transfer.failed", + TreasuryInboundTransferSucceeded => "treasury.inbound_transfer.succeeded", + TreasuryOutboundPaymentCanceled => "treasury.outbound_payment.canceled", + TreasuryOutboundPaymentCreated => "treasury.outbound_payment.created", + TreasuryOutboundPaymentExpectedArrivalDateUpdated => { + "treasury.outbound_payment.expected_arrival_date_updated" + } + TreasuryOutboundPaymentFailed => "treasury.outbound_payment.failed", + TreasuryOutboundPaymentPosted => "treasury.outbound_payment.posted", + TreasuryOutboundPaymentReturned => "treasury.outbound_payment.returned", + TreasuryOutboundTransferCanceled => "treasury.outbound_transfer.canceled", + TreasuryOutboundTransferCreated => "treasury.outbound_transfer.created", + TreasuryOutboundTransferExpectedArrivalDateUpdated => { + "treasury.outbound_transfer.expected_arrival_date_updated" + } + TreasuryOutboundTransferFailed => "treasury.outbound_transfer.failed", + TreasuryOutboundTransferPosted => "treasury.outbound_transfer.posted", + TreasuryOutboundTransferReturned => "treasury.outbound_transfer.returned", + TreasuryReceivedCreditCreated => "treasury.received_credit.created", + TreasuryReceivedCreditFailed => "treasury.received_credit.failed", + TreasuryReceivedCreditSucceeded => "treasury.received_credit.succeeded", + TreasuryReceivedDebitCreated => "treasury.received_debit.created", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateNotificationWebhookEndpointEnabledEvents { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateNotificationWebhookEndpointEnabledEvents::*; + match s { + "*" => Ok(All), + "account.application.authorized" => Ok(AccountApplicationAuthorized), + "account.application.deauthorized" => Ok(AccountApplicationDeauthorized), + "account.external_account.created" => Ok(AccountExternalAccountCreated), + "account.external_account.deleted" => Ok(AccountExternalAccountDeleted), + "account.external_account.updated" => Ok(AccountExternalAccountUpdated), + "account.updated" => Ok(AccountUpdated), + "application_fee.created" => Ok(ApplicationFeeCreated), + "application_fee.refund.updated" => Ok(ApplicationFeeRefundUpdated), + "application_fee.refunded" => Ok(ApplicationFeeRefunded), + "balance.available" => Ok(BalanceAvailable), + "billing_portal.configuration.created" => Ok(BillingPortalConfigurationCreated), + "billing_portal.configuration.updated" => Ok(BillingPortalConfigurationUpdated), + "billing_portal.session.created" => Ok(BillingPortalSessionCreated), + "capability.updated" => Ok(CapabilityUpdated), + "cash_balance.funds_available" => Ok(CashBalanceFundsAvailable), + "charge.captured" => Ok(ChargeCaptured), + "charge.dispute.closed" => Ok(ChargeDisputeClosed), + "charge.dispute.created" => Ok(ChargeDisputeCreated), + "charge.dispute.funds_reinstated" => Ok(ChargeDisputeFundsReinstated), + "charge.dispute.funds_withdrawn" => Ok(ChargeDisputeFundsWithdrawn), + "charge.dispute.updated" => Ok(ChargeDisputeUpdated), + "charge.expired" => Ok(ChargeExpired), + "charge.failed" => Ok(ChargeFailed), + "charge.pending" => Ok(ChargePending), + "charge.refund.updated" => Ok(ChargeRefundUpdated), + "charge.refunded" => Ok(ChargeRefunded), + "charge.succeeded" => Ok(ChargeSucceeded), + "charge.updated" => Ok(ChargeUpdated), + "checkout.session.async_payment_failed" => Ok(CheckoutSessionAsyncPaymentFailed), + "checkout.session.async_payment_succeeded" => Ok(CheckoutSessionAsyncPaymentSucceeded), + "checkout.session.completed" => Ok(CheckoutSessionCompleted), + "checkout.session.expired" => Ok(CheckoutSessionExpired), + "coupon.created" => Ok(CouponCreated), + "coupon.deleted" => Ok(CouponDeleted), + "coupon.updated" => Ok(CouponUpdated), + "credit_note.created" => Ok(CreditNoteCreated), + "credit_note.updated" => Ok(CreditNoteUpdated), + "credit_note.voided" => Ok(CreditNoteVoided), + "customer.created" => Ok(CustomerCreated), + "customer.deleted" => Ok(CustomerDeleted), + "customer.discount.created" => Ok(CustomerDiscountCreated), + "customer.discount.deleted" => Ok(CustomerDiscountDeleted), + "customer.discount.updated" => Ok(CustomerDiscountUpdated), + "customer.source.created" => Ok(CustomerSourceCreated), + "customer.source.deleted" => Ok(CustomerSourceDeleted), + "customer.source.expiring" => Ok(CustomerSourceExpiring), + "customer.source.updated" => Ok(CustomerSourceUpdated), + "customer.subscription.created" => Ok(CustomerSubscriptionCreated), + "customer.subscription.deleted" => Ok(CustomerSubscriptionDeleted), + "customer.subscription.paused" => Ok(CustomerSubscriptionPaused), + "customer.subscription.pending_update_applied" => { + Ok(CustomerSubscriptionPendingUpdateApplied) + } + "customer.subscription.pending_update_expired" => { + Ok(CustomerSubscriptionPendingUpdateExpired) + } + "customer.subscription.resumed" => Ok(CustomerSubscriptionResumed), + "customer.subscription.trial_will_end" => Ok(CustomerSubscriptionTrialWillEnd), + "customer.subscription.updated" => Ok(CustomerSubscriptionUpdated), + "customer.tax_id.created" => Ok(CustomerTaxIdCreated), + "customer.tax_id.deleted" => Ok(CustomerTaxIdDeleted), + "customer.tax_id.updated" => Ok(CustomerTaxIdUpdated), + "customer.updated" => Ok(CustomerUpdated), + "customer_cash_balance_transaction.created" => { + Ok(CustomerCashBalanceTransactionCreated) + } + "file.created" => Ok(FileCreated), + "financial_connections.account.created" => Ok(FinancialConnectionsAccountCreated), + "financial_connections.account.deactivated" => { + Ok(FinancialConnectionsAccountDeactivated) + } + "financial_connections.account.disconnected" => { + Ok(FinancialConnectionsAccountDisconnected) + } + "financial_connections.account.reactivated" => { + Ok(FinancialConnectionsAccountReactivated) + } + "financial_connections.account.refreshed_balance" => { + Ok(FinancialConnectionsAccountRefreshedBalance) + } + "identity.verification_session.canceled" => Ok(IdentityVerificationSessionCanceled), + "identity.verification_session.created" => Ok(IdentityVerificationSessionCreated), + "identity.verification_session.processing" => Ok(IdentityVerificationSessionProcessing), + "identity.verification_session.redacted" => Ok(IdentityVerificationSessionRedacted), + "identity.verification_session.requires_input" => { + Ok(IdentityVerificationSessionRequiresInput) + } + "identity.verification_session.verified" => Ok(IdentityVerificationSessionVerified), + "invoice.created" => Ok(InvoiceCreated), + "invoice.deleted" => Ok(InvoiceDeleted), + "invoice.finalization_failed" => Ok(InvoiceFinalizationFailed), + "invoice.finalized" => Ok(InvoiceFinalized), + "invoice.marked_uncollectible" => Ok(InvoiceMarkedUncollectible), + "invoice.paid" => Ok(InvoicePaid), + "invoice.payment_action_required" => Ok(InvoicePaymentActionRequired), + "invoice.payment_failed" => Ok(InvoicePaymentFailed), + "invoice.payment_succeeded" => Ok(InvoicePaymentSucceeded), + "invoice.sent" => Ok(InvoiceSent), + "invoice.upcoming" => Ok(InvoiceUpcoming), + "invoice.updated" => Ok(InvoiceUpdated), + "invoice.voided" => Ok(InvoiceVoided), + "invoiceitem.created" => Ok(InvoiceitemCreated), + "invoiceitem.deleted" => Ok(InvoiceitemDeleted), + "issuing_authorization.created" => Ok(IssuingAuthorizationCreated), + "issuing_authorization.request" => Ok(IssuingAuthorizationRequest), + "issuing_authorization.updated" => Ok(IssuingAuthorizationUpdated), + "issuing_card.created" => Ok(IssuingCardCreated), + "issuing_card.updated" => Ok(IssuingCardUpdated), + "issuing_cardholder.created" => Ok(IssuingCardholderCreated), + "issuing_cardholder.updated" => Ok(IssuingCardholderUpdated), + "issuing_dispute.closed" => Ok(IssuingDisputeClosed), + "issuing_dispute.created" => Ok(IssuingDisputeCreated), + "issuing_dispute.funds_reinstated" => Ok(IssuingDisputeFundsReinstated), + "issuing_dispute.submitted" => Ok(IssuingDisputeSubmitted), + "issuing_dispute.updated" => Ok(IssuingDisputeUpdated), + "issuing_token.created" => Ok(IssuingTokenCreated), + "issuing_token.updated" => Ok(IssuingTokenUpdated), + "issuing_transaction.created" => Ok(IssuingTransactionCreated), + "issuing_transaction.updated" => Ok(IssuingTransactionUpdated), + "mandate.updated" => Ok(MandateUpdated), + "payment_intent.amount_capturable_updated" => Ok(PaymentIntentAmountCapturableUpdated), + "payment_intent.canceled" => Ok(PaymentIntentCanceled), + "payment_intent.created" => Ok(PaymentIntentCreated), + "payment_intent.partially_funded" => Ok(PaymentIntentPartiallyFunded), + "payment_intent.payment_failed" => Ok(PaymentIntentPaymentFailed), + "payment_intent.processing" => Ok(PaymentIntentProcessing), + "payment_intent.requires_action" => Ok(PaymentIntentRequiresAction), + "payment_intent.succeeded" => Ok(PaymentIntentSucceeded), + "payment_link.created" => Ok(PaymentLinkCreated), + "payment_link.updated" => Ok(PaymentLinkUpdated), + "payment_method.attached" => Ok(PaymentMethodAttached), + "payment_method.automatically_updated" => Ok(PaymentMethodAutomaticallyUpdated), + "payment_method.detached" => Ok(PaymentMethodDetached), + "payment_method.updated" => Ok(PaymentMethodUpdated), + "payout.canceled" => Ok(PayoutCanceled), + "payout.created" => Ok(PayoutCreated), + "payout.failed" => Ok(PayoutFailed), + "payout.paid" => Ok(PayoutPaid), + "payout.reconciliation_completed" => Ok(PayoutReconciliationCompleted), + "payout.updated" => Ok(PayoutUpdated), + "person.created" => Ok(PersonCreated), + "person.deleted" => Ok(PersonDeleted), + "person.updated" => Ok(PersonUpdated), + "plan.created" => Ok(PlanCreated), + "plan.deleted" => Ok(PlanDeleted), + "plan.updated" => Ok(PlanUpdated), + "price.created" => Ok(PriceCreated), + "price.deleted" => Ok(PriceDeleted), + "price.updated" => Ok(PriceUpdated), + "product.created" => Ok(ProductCreated), + "product.deleted" => Ok(ProductDeleted), + "product.updated" => Ok(ProductUpdated), + "promotion_code.created" => Ok(PromotionCodeCreated), + "promotion_code.updated" => Ok(PromotionCodeUpdated), + "quote.accepted" => Ok(QuoteAccepted), + "quote.canceled" => Ok(QuoteCanceled), + "quote.created" => Ok(QuoteCreated), + "quote.finalized" => Ok(QuoteFinalized), + "radar.early_fraud_warning.created" => Ok(RadarEarlyFraudWarningCreated), + "radar.early_fraud_warning.updated" => Ok(RadarEarlyFraudWarningUpdated), + "refund.created" => Ok(RefundCreated), + "refund.updated" => Ok(RefundUpdated), + "reporting.report_run.failed" => Ok(ReportingReportRunFailed), + "reporting.report_run.succeeded" => Ok(ReportingReportRunSucceeded), + "reporting.report_type.updated" => Ok(ReportingReportTypeUpdated), + "review.closed" => Ok(ReviewClosed), + "review.opened" => Ok(ReviewOpened), + "setup_intent.canceled" => Ok(SetupIntentCanceled), + "setup_intent.created" => Ok(SetupIntentCreated), + "setup_intent.requires_action" => Ok(SetupIntentRequiresAction), + "setup_intent.setup_failed" => Ok(SetupIntentSetupFailed), + "setup_intent.succeeded" => Ok(SetupIntentSucceeded), + "sigma.scheduled_query_run.created" => Ok(SigmaScheduledQueryRunCreated), + "source.canceled" => Ok(SourceCanceled), + "source.chargeable" => Ok(SourceChargeable), + "source.failed" => Ok(SourceFailed), + "source.mandate_notification" => Ok(SourceMandateNotification), + "source.refund_attributes_required" => Ok(SourceRefundAttributesRequired), + "source.transaction.created" => Ok(SourceTransactionCreated), + "source.transaction.updated" => Ok(SourceTransactionUpdated), + "subscription_schedule.aborted" => Ok(SubscriptionScheduleAborted), + "subscription_schedule.canceled" => Ok(SubscriptionScheduleCanceled), + "subscription_schedule.completed" => Ok(SubscriptionScheduleCompleted), + "subscription_schedule.created" => Ok(SubscriptionScheduleCreated), + "subscription_schedule.expiring" => Ok(SubscriptionScheduleExpiring), + "subscription_schedule.released" => Ok(SubscriptionScheduleReleased), + "subscription_schedule.updated" => Ok(SubscriptionScheduleUpdated), + "tax.settings.updated" => Ok(TaxSettingsUpdated), + "tax_rate.created" => Ok(TaxRateCreated), + "tax_rate.updated" => Ok(TaxRateUpdated), + "terminal.reader.action_failed" => Ok(TerminalReaderActionFailed), + "terminal.reader.action_succeeded" => Ok(TerminalReaderActionSucceeded), + "test_helpers.test_clock.advancing" => Ok(TestHelpersTestClockAdvancing), + "test_helpers.test_clock.created" => Ok(TestHelpersTestClockCreated), + "test_helpers.test_clock.deleted" => Ok(TestHelpersTestClockDeleted), + "test_helpers.test_clock.internal_failure" => Ok(TestHelpersTestClockInternalFailure), + "test_helpers.test_clock.ready" => Ok(TestHelpersTestClockReady), + "topup.canceled" => Ok(TopupCanceled), + "topup.created" => Ok(TopupCreated), + "topup.failed" => Ok(TopupFailed), + "topup.reversed" => Ok(TopupReversed), + "topup.succeeded" => Ok(TopupSucceeded), + "transfer.created" => Ok(TransferCreated), + "transfer.reversed" => Ok(TransferReversed), + "transfer.updated" => Ok(TransferUpdated), + "treasury.credit_reversal.created" => Ok(TreasuryCreditReversalCreated), + "treasury.credit_reversal.posted" => Ok(TreasuryCreditReversalPosted), + "treasury.debit_reversal.completed" => Ok(TreasuryDebitReversalCompleted), + "treasury.debit_reversal.created" => Ok(TreasuryDebitReversalCreated), + "treasury.debit_reversal.initial_credit_granted" => { + Ok(TreasuryDebitReversalInitialCreditGranted) + } + "treasury.financial_account.closed" => Ok(TreasuryFinancialAccountClosed), + "treasury.financial_account.created" => Ok(TreasuryFinancialAccountCreated), + "treasury.financial_account.features_status_updated" => { + Ok(TreasuryFinancialAccountFeaturesStatusUpdated) + } + "treasury.inbound_transfer.canceled" => Ok(TreasuryInboundTransferCanceled), + "treasury.inbound_transfer.created" => Ok(TreasuryInboundTransferCreated), + "treasury.inbound_transfer.failed" => Ok(TreasuryInboundTransferFailed), + "treasury.inbound_transfer.succeeded" => Ok(TreasuryInboundTransferSucceeded), + "treasury.outbound_payment.canceled" => Ok(TreasuryOutboundPaymentCanceled), + "treasury.outbound_payment.created" => Ok(TreasuryOutboundPaymentCreated), + "treasury.outbound_payment.expected_arrival_date_updated" => { + Ok(TreasuryOutboundPaymentExpectedArrivalDateUpdated) + } + "treasury.outbound_payment.failed" => Ok(TreasuryOutboundPaymentFailed), + "treasury.outbound_payment.posted" => Ok(TreasuryOutboundPaymentPosted), + "treasury.outbound_payment.returned" => Ok(TreasuryOutboundPaymentReturned), + "treasury.outbound_transfer.canceled" => Ok(TreasuryOutboundTransferCanceled), + "treasury.outbound_transfer.created" => Ok(TreasuryOutboundTransferCreated), + "treasury.outbound_transfer.expected_arrival_date_updated" => { + Ok(TreasuryOutboundTransferExpectedArrivalDateUpdated) + } + "treasury.outbound_transfer.failed" => Ok(TreasuryOutboundTransferFailed), + "treasury.outbound_transfer.posted" => Ok(TreasuryOutboundTransferPosted), + "treasury.outbound_transfer.returned" => Ok(TreasuryOutboundTransferReturned), + "treasury.received_credit.created" => Ok(TreasuryReceivedCreditCreated), + "treasury.received_credit.failed" => Ok(TreasuryReceivedCreditFailed), + "treasury.received_credit.succeeded" => Ok(TreasuryReceivedCreditSucceeded), + "treasury.received_debit.created" => Ok(TreasuryReceivedDebitCreated), + _ => Err(()), + } + } +} +impl AsRef for CreateNotificationWebhookEndpointEnabledEvents { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateNotificationWebhookEndpointEnabledEvents { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateNotificationWebhookEndpointEnabledEvents { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateNotificationWebhookEndpointEnabledEvents { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateNotificationWebhookEndpoint<'a> { + /// A webhook endpoint must have a `url` and a list of `enabled_events`. + /// + /// You may optionally specify the Boolean `connect` parameter. + /// If set to true, then a Connect webhook endpoint that notifies the specified `url` about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified `url` only about events from your account is created. + /// You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/webhook_endpoints", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateNotificationWebhookEndpoint<'a> { + /// An optional description of what the webhook is used for. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Disable the webhook endpoint if set to true. + #[serde(skip_serializing_if = "Option::is_none")] + pub disabled: Option, + /// The list of events to enable for this endpoint. + /// + /// You may specify `['*']` to enable all events, except those that require explicit selection. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled_events: Option<&'a [UpdateNotificationWebhookEndpointEnabledEvents]>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The URL of the webhook endpoint. + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option<&'a str>, +} +impl<'a> UpdateNotificationWebhookEndpoint<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of events to enable for this endpoint. +/// +/// You may specify `['*']` to enable all events, except those that require explicit selection. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateNotificationWebhookEndpointEnabledEvents { + All, + AccountApplicationAuthorized, + AccountApplicationDeauthorized, + AccountExternalAccountCreated, + AccountExternalAccountDeleted, + AccountExternalAccountUpdated, + AccountUpdated, + ApplicationFeeCreated, + ApplicationFeeRefundUpdated, + ApplicationFeeRefunded, + BalanceAvailable, + BillingPortalConfigurationCreated, + BillingPortalConfigurationUpdated, + BillingPortalSessionCreated, + CapabilityUpdated, + CashBalanceFundsAvailable, + ChargeCaptured, + ChargeDisputeClosed, + ChargeDisputeCreated, + ChargeDisputeFundsReinstated, + ChargeDisputeFundsWithdrawn, + ChargeDisputeUpdated, + ChargeExpired, + ChargeFailed, + ChargePending, + ChargeRefundUpdated, + ChargeRefunded, + ChargeSucceeded, + ChargeUpdated, + CheckoutSessionAsyncPaymentFailed, + CheckoutSessionAsyncPaymentSucceeded, + CheckoutSessionCompleted, + CheckoutSessionExpired, + CouponCreated, + CouponDeleted, + CouponUpdated, + CreditNoteCreated, + CreditNoteUpdated, + CreditNoteVoided, + CustomerCreated, + CustomerDeleted, + CustomerDiscountCreated, + CustomerDiscountDeleted, + CustomerDiscountUpdated, + CustomerSourceCreated, + CustomerSourceDeleted, + CustomerSourceExpiring, + CustomerSourceUpdated, + CustomerSubscriptionCreated, + CustomerSubscriptionDeleted, + CustomerSubscriptionPaused, + CustomerSubscriptionPendingUpdateApplied, + CustomerSubscriptionPendingUpdateExpired, + CustomerSubscriptionResumed, + CustomerSubscriptionTrialWillEnd, + CustomerSubscriptionUpdated, + CustomerTaxIdCreated, + CustomerTaxIdDeleted, + CustomerTaxIdUpdated, + CustomerUpdated, + CustomerCashBalanceTransactionCreated, + FileCreated, + FinancialConnectionsAccountCreated, + FinancialConnectionsAccountDeactivated, + FinancialConnectionsAccountDisconnected, + FinancialConnectionsAccountReactivated, + FinancialConnectionsAccountRefreshedBalance, + IdentityVerificationSessionCanceled, + IdentityVerificationSessionCreated, + IdentityVerificationSessionProcessing, + IdentityVerificationSessionRedacted, + IdentityVerificationSessionRequiresInput, + IdentityVerificationSessionVerified, + InvoiceCreated, + InvoiceDeleted, + InvoiceFinalizationFailed, + InvoiceFinalized, + InvoiceMarkedUncollectible, + InvoicePaid, + InvoicePaymentActionRequired, + InvoicePaymentFailed, + InvoicePaymentSucceeded, + InvoiceSent, + InvoiceUpcoming, + InvoiceUpdated, + InvoiceVoided, + InvoiceitemCreated, + InvoiceitemDeleted, + IssuingAuthorizationCreated, + IssuingAuthorizationRequest, + IssuingAuthorizationUpdated, + IssuingCardCreated, + IssuingCardUpdated, + IssuingCardholderCreated, + IssuingCardholderUpdated, + IssuingDisputeClosed, + IssuingDisputeCreated, + IssuingDisputeFundsReinstated, + IssuingDisputeSubmitted, + IssuingDisputeUpdated, + IssuingTokenCreated, + IssuingTokenUpdated, + IssuingTransactionCreated, + IssuingTransactionUpdated, + MandateUpdated, + PaymentIntentAmountCapturableUpdated, + PaymentIntentCanceled, + PaymentIntentCreated, + PaymentIntentPartiallyFunded, + PaymentIntentPaymentFailed, + PaymentIntentProcessing, + PaymentIntentRequiresAction, + PaymentIntentSucceeded, + PaymentLinkCreated, + PaymentLinkUpdated, + PaymentMethodAttached, + PaymentMethodAutomaticallyUpdated, + PaymentMethodDetached, + PaymentMethodUpdated, + PayoutCanceled, + PayoutCreated, + PayoutFailed, + PayoutPaid, + PayoutReconciliationCompleted, + PayoutUpdated, + PersonCreated, + PersonDeleted, + PersonUpdated, + PlanCreated, + PlanDeleted, + PlanUpdated, + PriceCreated, + PriceDeleted, + PriceUpdated, + ProductCreated, + ProductDeleted, + ProductUpdated, + PromotionCodeCreated, + PromotionCodeUpdated, + QuoteAccepted, + QuoteCanceled, + QuoteCreated, + QuoteFinalized, + RadarEarlyFraudWarningCreated, + RadarEarlyFraudWarningUpdated, + RefundCreated, + RefundUpdated, + ReportingReportRunFailed, + ReportingReportRunSucceeded, + ReportingReportTypeUpdated, + ReviewClosed, + ReviewOpened, + SetupIntentCanceled, + SetupIntentCreated, + SetupIntentRequiresAction, + SetupIntentSetupFailed, + SetupIntentSucceeded, + SigmaScheduledQueryRunCreated, + SourceCanceled, + SourceChargeable, + SourceFailed, + SourceMandateNotification, + SourceRefundAttributesRequired, + SourceTransactionCreated, + SourceTransactionUpdated, + SubscriptionScheduleAborted, + SubscriptionScheduleCanceled, + SubscriptionScheduleCompleted, + SubscriptionScheduleCreated, + SubscriptionScheduleExpiring, + SubscriptionScheduleReleased, + SubscriptionScheduleUpdated, + TaxSettingsUpdated, + TaxRateCreated, + TaxRateUpdated, + TerminalReaderActionFailed, + TerminalReaderActionSucceeded, + TestHelpersTestClockAdvancing, + TestHelpersTestClockCreated, + TestHelpersTestClockDeleted, + TestHelpersTestClockInternalFailure, + TestHelpersTestClockReady, + TopupCanceled, + TopupCreated, + TopupFailed, + TopupReversed, + TopupSucceeded, + TransferCreated, + TransferReversed, + TransferUpdated, + TreasuryCreditReversalCreated, + TreasuryCreditReversalPosted, + TreasuryDebitReversalCompleted, + TreasuryDebitReversalCreated, + TreasuryDebitReversalInitialCreditGranted, + TreasuryFinancialAccountClosed, + TreasuryFinancialAccountCreated, + TreasuryFinancialAccountFeaturesStatusUpdated, + TreasuryInboundTransferCanceled, + TreasuryInboundTransferCreated, + TreasuryInboundTransferFailed, + TreasuryInboundTransferSucceeded, + TreasuryOutboundPaymentCanceled, + TreasuryOutboundPaymentCreated, + TreasuryOutboundPaymentExpectedArrivalDateUpdated, + TreasuryOutboundPaymentFailed, + TreasuryOutboundPaymentPosted, + TreasuryOutboundPaymentReturned, + TreasuryOutboundTransferCanceled, + TreasuryOutboundTransferCreated, + TreasuryOutboundTransferExpectedArrivalDateUpdated, + TreasuryOutboundTransferFailed, + TreasuryOutboundTransferPosted, + TreasuryOutboundTransferReturned, + TreasuryReceivedCreditCreated, + TreasuryReceivedCreditFailed, + TreasuryReceivedCreditSucceeded, + TreasuryReceivedDebitCreated, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateNotificationWebhookEndpointEnabledEvents { + pub fn as_str(self) -> &'static str { + use UpdateNotificationWebhookEndpointEnabledEvents::*; + match self { + All => "*", + AccountApplicationAuthorized => "account.application.authorized", + AccountApplicationDeauthorized => "account.application.deauthorized", + AccountExternalAccountCreated => "account.external_account.created", + AccountExternalAccountDeleted => "account.external_account.deleted", + AccountExternalAccountUpdated => "account.external_account.updated", + AccountUpdated => "account.updated", + ApplicationFeeCreated => "application_fee.created", + ApplicationFeeRefundUpdated => "application_fee.refund.updated", + ApplicationFeeRefunded => "application_fee.refunded", + BalanceAvailable => "balance.available", + BillingPortalConfigurationCreated => "billing_portal.configuration.created", + BillingPortalConfigurationUpdated => "billing_portal.configuration.updated", + BillingPortalSessionCreated => "billing_portal.session.created", + CapabilityUpdated => "capability.updated", + CashBalanceFundsAvailable => "cash_balance.funds_available", + ChargeCaptured => "charge.captured", + ChargeDisputeClosed => "charge.dispute.closed", + ChargeDisputeCreated => "charge.dispute.created", + ChargeDisputeFundsReinstated => "charge.dispute.funds_reinstated", + ChargeDisputeFundsWithdrawn => "charge.dispute.funds_withdrawn", + ChargeDisputeUpdated => "charge.dispute.updated", + ChargeExpired => "charge.expired", + ChargeFailed => "charge.failed", + ChargePending => "charge.pending", + ChargeRefundUpdated => "charge.refund.updated", + ChargeRefunded => "charge.refunded", + ChargeSucceeded => "charge.succeeded", + ChargeUpdated => "charge.updated", + CheckoutSessionAsyncPaymentFailed => "checkout.session.async_payment_failed", + CheckoutSessionAsyncPaymentSucceeded => "checkout.session.async_payment_succeeded", + CheckoutSessionCompleted => "checkout.session.completed", + CheckoutSessionExpired => "checkout.session.expired", + CouponCreated => "coupon.created", + CouponDeleted => "coupon.deleted", + CouponUpdated => "coupon.updated", + CreditNoteCreated => "credit_note.created", + CreditNoteUpdated => "credit_note.updated", + CreditNoteVoided => "credit_note.voided", + CustomerCreated => "customer.created", + CustomerDeleted => "customer.deleted", + CustomerDiscountCreated => "customer.discount.created", + CustomerDiscountDeleted => "customer.discount.deleted", + CustomerDiscountUpdated => "customer.discount.updated", + CustomerSourceCreated => "customer.source.created", + CustomerSourceDeleted => "customer.source.deleted", + CustomerSourceExpiring => "customer.source.expiring", + CustomerSourceUpdated => "customer.source.updated", + CustomerSubscriptionCreated => "customer.subscription.created", + CustomerSubscriptionDeleted => "customer.subscription.deleted", + CustomerSubscriptionPaused => "customer.subscription.paused", + CustomerSubscriptionPendingUpdateApplied => { + "customer.subscription.pending_update_applied" + } + CustomerSubscriptionPendingUpdateExpired => { + "customer.subscription.pending_update_expired" + } + CustomerSubscriptionResumed => "customer.subscription.resumed", + CustomerSubscriptionTrialWillEnd => "customer.subscription.trial_will_end", + CustomerSubscriptionUpdated => "customer.subscription.updated", + CustomerTaxIdCreated => "customer.tax_id.created", + CustomerTaxIdDeleted => "customer.tax_id.deleted", + CustomerTaxIdUpdated => "customer.tax_id.updated", + CustomerUpdated => "customer.updated", + CustomerCashBalanceTransactionCreated => "customer_cash_balance_transaction.created", + FileCreated => "file.created", + FinancialConnectionsAccountCreated => "financial_connections.account.created", + FinancialConnectionsAccountDeactivated => "financial_connections.account.deactivated", + FinancialConnectionsAccountDisconnected => "financial_connections.account.disconnected", + FinancialConnectionsAccountReactivated => "financial_connections.account.reactivated", + FinancialConnectionsAccountRefreshedBalance => { + "financial_connections.account.refreshed_balance" + } + IdentityVerificationSessionCanceled => "identity.verification_session.canceled", + IdentityVerificationSessionCreated => "identity.verification_session.created", + IdentityVerificationSessionProcessing => "identity.verification_session.processing", + IdentityVerificationSessionRedacted => "identity.verification_session.redacted", + IdentityVerificationSessionRequiresInput => { + "identity.verification_session.requires_input" + } + IdentityVerificationSessionVerified => "identity.verification_session.verified", + InvoiceCreated => "invoice.created", + InvoiceDeleted => "invoice.deleted", + InvoiceFinalizationFailed => "invoice.finalization_failed", + InvoiceFinalized => "invoice.finalized", + InvoiceMarkedUncollectible => "invoice.marked_uncollectible", + InvoicePaid => "invoice.paid", + InvoicePaymentActionRequired => "invoice.payment_action_required", + InvoicePaymentFailed => "invoice.payment_failed", + InvoicePaymentSucceeded => "invoice.payment_succeeded", + InvoiceSent => "invoice.sent", + InvoiceUpcoming => "invoice.upcoming", + InvoiceUpdated => "invoice.updated", + InvoiceVoided => "invoice.voided", + InvoiceitemCreated => "invoiceitem.created", + InvoiceitemDeleted => "invoiceitem.deleted", + IssuingAuthorizationCreated => "issuing_authorization.created", + IssuingAuthorizationRequest => "issuing_authorization.request", + IssuingAuthorizationUpdated => "issuing_authorization.updated", + IssuingCardCreated => "issuing_card.created", + IssuingCardUpdated => "issuing_card.updated", + IssuingCardholderCreated => "issuing_cardholder.created", + IssuingCardholderUpdated => "issuing_cardholder.updated", + IssuingDisputeClosed => "issuing_dispute.closed", + IssuingDisputeCreated => "issuing_dispute.created", + IssuingDisputeFundsReinstated => "issuing_dispute.funds_reinstated", + IssuingDisputeSubmitted => "issuing_dispute.submitted", + IssuingDisputeUpdated => "issuing_dispute.updated", + IssuingTokenCreated => "issuing_token.created", + IssuingTokenUpdated => "issuing_token.updated", + IssuingTransactionCreated => "issuing_transaction.created", + IssuingTransactionUpdated => "issuing_transaction.updated", + MandateUpdated => "mandate.updated", + PaymentIntentAmountCapturableUpdated => "payment_intent.amount_capturable_updated", + PaymentIntentCanceled => "payment_intent.canceled", + PaymentIntentCreated => "payment_intent.created", + PaymentIntentPartiallyFunded => "payment_intent.partially_funded", + PaymentIntentPaymentFailed => "payment_intent.payment_failed", + PaymentIntentProcessing => "payment_intent.processing", + PaymentIntentRequiresAction => "payment_intent.requires_action", + PaymentIntentSucceeded => "payment_intent.succeeded", + PaymentLinkCreated => "payment_link.created", + PaymentLinkUpdated => "payment_link.updated", + PaymentMethodAttached => "payment_method.attached", + PaymentMethodAutomaticallyUpdated => "payment_method.automatically_updated", + PaymentMethodDetached => "payment_method.detached", + PaymentMethodUpdated => "payment_method.updated", + PayoutCanceled => "payout.canceled", + PayoutCreated => "payout.created", + PayoutFailed => "payout.failed", + PayoutPaid => "payout.paid", + PayoutReconciliationCompleted => "payout.reconciliation_completed", + PayoutUpdated => "payout.updated", + PersonCreated => "person.created", + PersonDeleted => "person.deleted", + PersonUpdated => "person.updated", + PlanCreated => "plan.created", + PlanDeleted => "plan.deleted", + PlanUpdated => "plan.updated", + PriceCreated => "price.created", + PriceDeleted => "price.deleted", + PriceUpdated => "price.updated", + ProductCreated => "product.created", + ProductDeleted => "product.deleted", + ProductUpdated => "product.updated", + PromotionCodeCreated => "promotion_code.created", + PromotionCodeUpdated => "promotion_code.updated", + QuoteAccepted => "quote.accepted", + QuoteCanceled => "quote.canceled", + QuoteCreated => "quote.created", + QuoteFinalized => "quote.finalized", + RadarEarlyFraudWarningCreated => "radar.early_fraud_warning.created", + RadarEarlyFraudWarningUpdated => "radar.early_fraud_warning.updated", + RefundCreated => "refund.created", + RefundUpdated => "refund.updated", + ReportingReportRunFailed => "reporting.report_run.failed", + ReportingReportRunSucceeded => "reporting.report_run.succeeded", + ReportingReportTypeUpdated => "reporting.report_type.updated", + ReviewClosed => "review.closed", + ReviewOpened => "review.opened", + SetupIntentCanceled => "setup_intent.canceled", + SetupIntentCreated => "setup_intent.created", + SetupIntentRequiresAction => "setup_intent.requires_action", + SetupIntentSetupFailed => "setup_intent.setup_failed", + SetupIntentSucceeded => "setup_intent.succeeded", + SigmaScheduledQueryRunCreated => "sigma.scheduled_query_run.created", + SourceCanceled => "source.canceled", + SourceChargeable => "source.chargeable", + SourceFailed => "source.failed", + SourceMandateNotification => "source.mandate_notification", + SourceRefundAttributesRequired => "source.refund_attributes_required", + SourceTransactionCreated => "source.transaction.created", + SourceTransactionUpdated => "source.transaction.updated", + SubscriptionScheduleAborted => "subscription_schedule.aborted", + SubscriptionScheduleCanceled => "subscription_schedule.canceled", + SubscriptionScheduleCompleted => "subscription_schedule.completed", + SubscriptionScheduleCreated => "subscription_schedule.created", + SubscriptionScheduleExpiring => "subscription_schedule.expiring", + SubscriptionScheduleReleased => "subscription_schedule.released", + SubscriptionScheduleUpdated => "subscription_schedule.updated", + TaxSettingsUpdated => "tax.settings.updated", + TaxRateCreated => "tax_rate.created", + TaxRateUpdated => "tax_rate.updated", + TerminalReaderActionFailed => "terminal.reader.action_failed", + TerminalReaderActionSucceeded => "terminal.reader.action_succeeded", + TestHelpersTestClockAdvancing => "test_helpers.test_clock.advancing", + TestHelpersTestClockCreated => "test_helpers.test_clock.created", + TestHelpersTestClockDeleted => "test_helpers.test_clock.deleted", + TestHelpersTestClockInternalFailure => "test_helpers.test_clock.internal_failure", + TestHelpersTestClockReady => "test_helpers.test_clock.ready", + TopupCanceled => "topup.canceled", + TopupCreated => "topup.created", + TopupFailed => "topup.failed", + TopupReversed => "topup.reversed", + TopupSucceeded => "topup.succeeded", + TransferCreated => "transfer.created", + TransferReversed => "transfer.reversed", + TransferUpdated => "transfer.updated", + TreasuryCreditReversalCreated => "treasury.credit_reversal.created", + TreasuryCreditReversalPosted => "treasury.credit_reversal.posted", + TreasuryDebitReversalCompleted => "treasury.debit_reversal.completed", + TreasuryDebitReversalCreated => "treasury.debit_reversal.created", + TreasuryDebitReversalInitialCreditGranted => { + "treasury.debit_reversal.initial_credit_granted" + } + TreasuryFinancialAccountClosed => "treasury.financial_account.closed", + TreasuryFinancialAccountCreated => "treasury.financial_account.created", + TreasuryFinancialAccountFeaturesStatusUpdated => { + "treasury.financial_account.features_status_updated" + } + TreasuryInboundTransferCanceled => "treasury.inbound_transfer.canceled", + TreasuryInboundTransferCreated => "treasury.inbound_transfer.created", + TreasuryInboundTransferFailed => "treasury.inbound_transfer.failed", + TreasuryInboundTransferSucceeded => "treasury.inbound_transfer.succeeded", + TreasuryOutboundPaymentCanceled => "treasury.outbound_payment.canceled", + TreasuryOutboundPaymentCreated => "treasury.outbound_payment.created", + TreasuryOutboundPaymentExpectedArrivalDateUpdated => { + "treasury.outbound_payment.expected_arrival_date_updated" + } + TreasuryOutboundPaymentFailed => "treasury.outbound_payment.failed", + TreasuryOutboundPaymentPosted => "treasury.outbound_payment.posted", + TreasuryOutboundPaymentReturned => "treasury.outbound_payment.returned", + TreasuryOutboundTransferCanceled => "treasury.outbound_transfer.canceled", + TreasuryOutboundTransferCreated => "treasury.outbound_transfer.created", + TreasuryOutboundTransferExpectedArrivalDateUpdated => { + "treasury.outbound_transfer.expected_arrival_date_updated" + } + TreasuryOutboundTransferFailed => "treasury.outbound_transfer.failed", + TreasuryOutboundTransferPosted => "treasury.outbound_transfer.posted", + TreasuryOutboundTransferReturned => "treasury.outbound_transfer.returned", + TreasuryReceivedCreditCreated => "treasury.received_credit.created", + TreasuryReceivedCreditFailed => "treasury.received_credit.failed", + TreasuryReceivedCreditSucceeded => "treasury.received_credit.succeeded", + TreasuryReceivedDebitCreated => "treasury.received_debit.created", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateNotificationWebhookEndpointEnabledEvents { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateNotificationWebhookEndpointEnabledEvents::*; + match s { + "*" => Ok(All), + "account.application.authorized" => Ok(AccountApplicationAuthorized), + "account.application.deauthorized" => Ok(AccountApplicationDeauthorized), + "account.external_account.created" => Ok(AccountExternalAccountCreated), + "account.external_account.deleted" => Ok(AccountExternalAccountDeleted), + "account.external_account.updated" => Ok(AccountExternalAccountUpdated), + "account.updated" => Ok(AccountUpdated), + "application_fee.created" => Ok(ApplicationFeeCreated), + "application_fee.refund.updated" => Ok(ApplicationFeeRefundUpdated), + "application_fee.refunded" => Ok(ApplicationFeeRefunded), + "balance.available" => Ok(BalanceAvailable), + "billing_portal.configuration.created" => Ok(BillingPortalConfigurationCreated), + "billing_portal.configuration.updated" => Ok(BillingPortalConfigurationUpdated), + "billing_portal.session.created" => Ok(BillingPortalSessionCreated), + "capability.updated" => Ok(CapabilityUpdated), + "cash_balance.funds_available" => Ok(CashBalanceFundsAvailable), + "charge.captured" => Ok(ChargeCaptured), + "charge.dispute.closed" => Ok(ChargeDisputeClosed), + "charge.dispute.created" => Ok(ChargeDisputeCreated), + "charge.dispute.funds_reinstated" => Ok(ChargeDisputeFundsReinstated), + "charge.dispute.funds_withdrawn" => Ok(ChargeDisputeFundsWithdrawn), + "charge.dispute.updated" => Ok(ChargeDisputeUpdated), + "charge.expired" => Ok(ChargeExpired), + "charge.failed" => Ok(ChargeFailed), + "charge.pending" => Ok(ChargePending), + "charge.refund.updated" => Ok(ChargeRefundUpdated), + "charge.refunded" => Ok(ChargeRefunded), + "charge.succeeded" => Ok(ChargeSucceeded), + "charge.updated" => Ok(ChargeUpdated), + "checkout.session.async_payment_failed" => Ok(CheckoutSessionAsyncPaymentFailed), + "checkout.session.async_payment_succeeded" => Ok(CheckoutSessionAsyncPaymentSucceeded), + "checkout.session.completed" => Ok(CheckoutSessionCompleted), + "checkout.session.expired" => Ok(CheckoutSessionExpired), + "coupon.created" => Ok(CouponCreated), + "coupon.deleted" => Ok(CouponDeleted), + "coupon.updated" => Ok(CouponUpdated), + "credit_note.created" => Ok(CreditNoteCreated), + "credit_note.updated" => Ok(CreditNoteUpdated), + "credit_note.voided" => Ok(CreditNoteVoided), + "customer.created" => Ok(CustomerCreated), + "customer.deleted" => Ok(CustomerDeleted), + "customer.discount.created" => Ok(CustomerDiscountCreated), + "customer.discount.deleted" => Ok(CustomerDiscountDeleted), + "customer.discount.updated" => Ok(CustomerDiscountUpdated), + "customer.source.created" => Ok(CustomerSourceCreated), + "customer.source.deleted" => Ok(CustomerSourceDeleted), + "customer.source.expiring" => Ok(CustomerSourceExpiring), + "customer.source.updated" => Ok(CustomerSourceUpdated), + "customer.subscription.created" => Ok(CustomerSubscriptionCreated), + "customer.subscription.deleted" => Ok(CustomerSubscriptionDeleted), + "customer.subscription.paused" => Ok(CustomerSubscriptionPaused), + "customer.subscription.pending_update_applied" => { + Ok(CustomerSubscriptionPendingUpdateApplied) + } + "customer.subscription.pending_update_expired" => { + Ok(CustomerSubscriptionPendingUpdateExpired) + } + "customer.subscription.resumed" => Ok(CustomerSubscriptionResumed), + "customer.subscription.trial_will_end" => Ok(CustomerSubscriptionTrialWillEnd), + "customer.subscription.updated" => Ok(CustomerSubscriptionUpdated), + "customer.tax_id.created" => Ok(CustomerTaxIdCreated), + "customer.tax_id.deleted" => Ok(CustomerTaxIdDeleted), + "customer.tax_id.updated" => Ok(CustomerTaxIdUpdated), + "customer.updated" => Ok(CustomerUpdated), + "customer_cash_balance_transaction.created" => { + Ok(CustomerCashBalanceTransactionCreated) + } + "file.created" => Ok(FileCreated), + "financial_connections.account.created" => Ok(FinancialConnectionsAccountCreated), + "financial_connections.account.deactivated" => { + Ok(FinancialConnectionsAccountDeactivated) + } + "financial_connections.account.disconnected" => { + Ok(FinancialConnectionsAccountDisconnected) + } + "financial_connections.account.reactivated" => { + Ok(FinancialConnectionsAccountReactivated) + } + "financial_connections.account.refreshed_balance" => { + Ok(FinancialConnectionsAccountRefreshedBalance) + } + "identity.verification_session.canceled" => Ok(IdentityVerificationSessionCanceled), + "identity.verification_session.created" => Ok(IdentityVerificationSessionCreated), + "identity.verification_session.processing" => Ok(IdentityVerificationSessionProcessing), + "identity.verification_session.redacted" => Ok(IdentityVerificationSessionRedacted), + "identity.verification_session.requires_input" => { + Ok(IdentityVerificationSessionRequiresInput) + } + "identity.verification_session.verified" => Ok(IdentityVerificationSessionVerified), + "invoice.created" => Ok(InvoiceCreated), + "invoice.deleted" => Ok(InvoiceDeleted), + "invoice.finalization_failed" => Ok(InvoiceFinalizationFailed), + "invoice.finalized" => Ok(InvoiceFinalized), + "invoice.marked_uncollectible" => Ok(InvoiceMarkedUncollectible), + "invoice.paid" => Ok(InvoicePaid), + "invoice.payment_action_required" => Ok(InvoicePaymentActionRequired), + "invoice.payment_failed" => Ok(InvoicePaymentFailed), + "invoice.payment_succeeded" => Ok(InvoicePaymentSucceeded), + "invoice.sent" => Ok(InvoiceSent), + "invoice.upcoming" => Ok(InvoiceUpcoming), + "invoice.updated" => Ok(InvoiceUpdated), + "invoice.voided" => Ok(InvoiceVoided), + "invoiceitem.created" => Ok(InvoiceitemCreated), + "invoiceitem.deleted" => Ok(InvoiceitemDeleted), + "issuing_authorization.created" => Ok(IssuingAuthorizationCreated), + "issuing_authorization.request" => Ok(IssuingAuthorizationRequest), + "issuing_authorization.updated" => Ok(IssuingAuthorizationUpdated), + "issuing_card.created" => Ok(IssuingCardCreated), + "issuing_card.updated" => Ok(IssuingCardUpdated), + "issuing_cardholder.created" => Ok(IssuingCardholderCreated), + "issuing_cardholder.updated" => Ok(IssuingCardholderUpdated), + "issuing_dispute.closed" => Ok(IssuingDisputeClosed), + "issuing_dispute.created" => Ok(IssuingDisputeCreated), + "issuing_dispute.funds_reinstated" => Ok(IssuingDisputeFundsReinstated), + "issuing_dispute.submitted" => Ok(IssuingDisputeSubmitted), + "issuing_dispute.updated" => Ok(IssuingDisputeUpdated), + "issuing_token.created" => Ok(IssuingTokenCreated), + "issuing_token.updated" => Ok(IssuingTokenUpdated), + "issuing_transaction.created" => Ok(IssuingTransactionCreated), + "issuing_transaction.updated" => Ok(IssuingTransactionUpdated), + "mandate.updated" => Ok(MandateUpdated), + "payment_intent.amount_capturable_updated" => Ok(PaymentIntentAmountCapturableUpdated), + "payment_intent.canceled" => Ok(PaymentIntentCanceled), + "payment_intent.created" => Ok(PaymentIntentCreated), + "payment_intent.partially_funded" => Ok(PaymentIntentPartiallyFunded), + "payment_intent.payment_failed" => Ok(PaymentIntentPaymentFailed), + "payment_intent.processing" => Ok(PaymentIntentProcessing), + "payment_intent.requires_action" => Ok(PaymentIntentRequiresAction), + "payment_intent.succeeded" => Ok(PaymentIntentSucceeded), + "payment_link.created" => Ok(PaymentLinkCreated), + "payment_link.updated" => Ok(PaymentLinkUpdated), + "payment_method.attached" => Ok(PaymentMethodAttached), + "payment_method.automatically_updated" => Ok(PaymentMethodAutomaticallyUpdated), + "payment_method.detached" => Ok(PaymentMethodDetached), + "payment_method.updated" => Ok(PaymentMethodUpdated), + "payout.canceled" => Ok(PayoutCanceled), + "payout.created" => Ok(PayoutCreated), + "payout.failed" => Ok(PayoutFailed), + "payout.paid" => Ok(PayoutPaid), + "payout.reconciliation_completed" => Ok(PayoutReconciliationCompleted), + "payout.updated" => Ok(PayoutUpdated), + "person.created" => Ok(PersonCreated), + "person.deleted" => Ok(PersonDeleted), + "person.updated" => Ok(PersonUpdated), + "plan.created" => Ok(PlanCreated), + "plan.deleted" => Ok(PlanDeleted), + "plan.updated" => Ok(PlanUpdated), + "price.created" => Ok(PriceCreated), + "price.deleted" => Ok(PriceDeleted), + "price.updated" => Ok(PriceUpdated), + "product.created" => Ok(ProductCreated), + "product.deleted" => Ok(ProductDeleted), + "product.updated" => Ok(ProductUpdated), + "promotion_code.created" => Ok(PromotionCodeCreated), + "promotion_code.updated" => Ok(PromotionCodeUpdated), + "quote.accepted" => Ok(QuoteAccepted), + "quote.canceled" => Ok(QuoteCanceled), + "quote.created" => Ok(QuoteCreated), + "quote.finalized" => Ok(QuoteFinalized), + "radar.early_fraud_warning.created" => Ok(RadarEarlyFraudWarningCreated), + "radar.early_fraud_warning.updated" => Ok(RadarEarlyFraudWarningUpdated), + "refund.created" => Ok(RefundCreated), + "refund.updated" => Ok(RefundUpdated), + "reporting.report_run.failed" => Ok(ReportingReportRunFailed), + "reporting.report_run.succeeded" => Ok(ReportingReportRunSucceeded), + "reporting.report_type.updated" => Ok(ReportingReportTypeUpdated), + "review.closed" => Ok(ReviewClosed), + "review.opened" => Ok(ReviewOpened), + "setup_intent.canceled" => Ok(SetupIntentCanceled), + "setup_intent.created" => Ok(SetupIntentCreated), + "setup_intent.requires_action" => Ok(SetupIntentRequiresAction), + "setup_intent.setup_failed" => Ok(SetupIntentSetupFailed), + "setup_intent.succeeded" => Ok(SetupIntentSucceeded), + "sigma.scheduled_query_run.created" => Ok(SigmaScheduledQueryRunCreated), + "source.canceled" => Ok(SourceCanceled), + "source.chargeable" => Ok(SourceChargeable), + "source.failed" => Ok(SourceFailed), + "source.mandate_notification" => Ok(SourceMandateNotification), + "source.refund_attributes_required" => Ok(SourceRefundAttributesRequired), + "source.transaction.created" => Ok(SourceTransactionCreated), + "source.transaction.updated" => Ok(SourceTransactionUpdated), + "subscription_schedule.aborted" => Ok(SubscriptionScheduleAborted), + "subscription_schedule.canceled" => Ok(SubscriptionScheduleCanceled), + "subscription_schedule.completed" => Ok(SubscriptionScheduleCompleted), + "subscription_schedule.created" => Ok(SubscriptionScheduleCreated), + "subscription_schedule.expiring" => Ok(SubscriptionScheduleExpiring), + "subscription_schedule.released" => Ok(SubscriptionScheduleReleased), + "subscription_schedule.updated" => Ok(SubscriptionScheduleUpdated), + "tax.settings.updated" => Ok(TaxSettingsUpdated), + "tax_rate.created" => Ok(TaxRateCreated), + "tax_rate.updated" => Ok(TaxRateUpdated), + "terminal.reader.action_failed" => Ok(TerminalReaderActionFailed), + "terminal.reader.action_succeeded" => Ok(TerminalReaderActionSucceeded), + "test_helpers.test_clock.advancing" => Ok(TestHelpersTestClockAdvancing), + "test_helpers.test_clock.created" => Ok(TestHelpersTestClockCreated), + "test_helpers.test_clock.deleted" => Ok(TestHelpersTestClockDeleted), + "test_helpers.test_clock.internal_failure" => Ok(TestHelpersTestClockInternalFailure), + "test_helpers.test_clock.ready" => Ok(TestHelpersTestClockReady), + "topup.canceled" => Ok(TopupCanceled), + "topup.created" => Ok(TopupCreated), + "topup.failed" => Ok(TopupFailed), + "topup.reversed" => Ok(TopupReversed), + "topup.succeeded" => Ok(TopupSucceeded), + "transfer.created" => Ok(TransferCreated), + "transfer.reversed" => Ok(TransferReversed), + "transfer.updated" => Ok(TransferUpdated), + "treasury.credit_reversal.created" => Ok(TreasuryCreditReversalCreated), + "treasury.credit_reversal.posted" => Ok(TreasuryCreditReversalPosted), + "treasury.debit_reversal.completed" => Ok(TreasuryDebitReversalCompleted), + "treasury.debit_reversal.created" => Ok(TreasuryDebitReversalCreated), + "treasury.debit_reversal.initial_credit_granted" => { + Ok(TreasuryDebitReversalInitialCreditGranted) + } + "treasury.financial_account.closed" => Ok(TreasuryFinancialAccountClosed), + "treasury.financial_account.created" => Ok(TreasuryFinancialAccountCreated), + "treasury.financial_account.features_status_updated" => { + Ok(TreasuryFinancialAccountFeaturesStatusUpdated) + } + "treasury.inbound_transfer.canceled" => Ok(TreasuryInboundTransferCanceled), + "treasury.inbound_transfer.created" => Ok(TreasuryInboundTransferCreated), + "treasury.inbound_transfer.failed" => Ok(TreasuryInboundTransferFailed), + "treasury.inbound_transfer.succeeded" => Ok(TreasuryInboundTransferSucceeded), + "treasury.outbound_payment.canceled" => Ok(TreasuryOutboundPaymentCanceled), + "treasury.outbound_payment.created" => Ok(TreasuryOutboundPaymentCreated), + "treasury.outbound_payment.expected_arrival_date_updated" => { + Ok(TreasuryOutboundPaymentExpectedArrivalDateUpdated) + } + "treasury.outbound_payment.failed" => Ok(TreasuryOutboundPaymentFailed), + "treasury.outbound_payment.posted" => Ok(TreasuryOutboundPaymentPosted), + "treasury.outbound_payment.returned" => Ok(TreasuryOutboundPaymentReturned), + "treasury.outbound_transfer.canceled" => Ok(TreasuryOutboundTransferCanceled), + "treasury.outbound_transfer.created" => Ok(TreasuryOutboundTransferCreated), + "treasury.outbound_transfer.expected_arrival_date_updated" => { + Ok(TreasuryOutboundTransferExpectedArrivalDateUpdated) + } + "treasury.outbound_transfer.failed" => Ok(TreasuryOutboundTransferFailed), + "treasury.outbound_transfer.posted" => Ok(TreasuryOutboundTransferPosted), + "treasury.outbound_transfer.returned" => Ok(TreasuryOutboundTransferReturned), + "treasury.received_credit.created" => Ok(TreasuryReceivedCreditCreated), + "treasury.received_credit.failed" => Ok(TreasuryReceivedCreditFailed), + "treasury.received_credit.succeeded" => Ok(TreasuryReceivedCreditSucceeded), + "treasury.received_debit.created" => Ok(TreasuryReceivedDebitCreated), + _ => Err(()), + } + } +} +impl AsRef for UpdateNotificationWebhookEndpointEnabledEvents { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateNotificationWebhookEndpointEnabledEvents { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateNotificationWebhookEndpointEnabledEvents { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateNotificationWebhookEndpointEnabledEvents { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateNotificationWebhookEndpoint<'a> { + /// Updates the webhook endpoint. + /// + /// You may edit the `url`, the list of `enabled_events`, and the status of your endpoint. + pub fn send( + &self, + client: &stripe::Client, + webhook_endpoint: &stripe_misc::notification_webhook_endpoint::WebhookEndpointId, + ) -> stripe::Response { + client.send_form( + &format!("/webhook_endpoints/{webhook_endpoint}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteNotificationWebhookEndpoint {} +impl DeleteNotificationWebhookEndpoint { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteNotificationWebhookEndpoint { + /// You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. + pub fn send( + &self, + client: &stripe::Client, + webhook_endpoint: &stripe_misc::notification_webhook_endpoint::WebhookEndpointId, + ) -> stripe::Response { + client.send_form( + &format!("/webhook_endpoints/{webhook_endpoint}"), + self, + http_types::Method::Delete, + ) + } +} diff --git a/generated/stripe_misc/src/notification_webhook_endpoint_deleted/mod.rs b/generated/stripe_misc/src/notification_webhook_endpoint_deleted/mod.rs new file mode 100644 index 000000000..491b9feb3 --- /dev/null +++ b/generated/stripe_misc/src/notification_webhook_endpoint_deleted/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct NotificationWebhookEndpointDeleted { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_misc::notification_webhook_endpoint::WebhookEndpointId, +} +impl stripe_types::Object for NotificationWebhookEndpointDeleted { + type Id = stripe_misc::notification_webhook_endpoint::WebhookEndpointId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/generated/stripe_misc/src/reporting_report_run/mod.rs b/generated/stripe_misc/src/reporting_report_run/mod.rs new file mode 100644 index 000000000..683c89074 --- /dev/null +++ b/generated/stripe_misc/src/reporting_report_run/mod.rs @@ -0,0 +1,45 @@ +/// The Report Run object represents an instance of a report type generated with +/// specific run parameters. +/// +/// Once the object is created, Stripe begins processing the report. When the report has finished running, it will give you a reference to a file where you can retrieve your results. +/// For an overview, see [API Access to Reports](https://stripe.com/docs/reporting/statements/api). Note that certain report types can only be run based on your live-mode data (not test-mode data), and will error when queried without a [live-mode API key](https://stripe.com/docs/keys#test-live-modes). For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ReportingReportRun { + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// If something should go wrong during the run, a message about the failure (populated when + /// `status=failed`). + pub error: Option, + /// Unique identifier for the object. + pub id: stripe_misc::reporting_report_run::ReportingReportRunId, + /// `true` if the report is run on live mode data and `false` if it is run on test mode data. + pub livemode: bool, + pub parameters: stripe_misc::FinancialReportingFinanceReportRunRunParameters, + /// The ID of the [report type](https://stripe.com/docs/reports/report-types) to run, such as `"balance.summary.1"`. + pub report_type: String, + /// The file object representing the result of the report run (populated when + /// `status=succeeded`). + pub result: Option, + /// Status of this report run. + /// + /// This will be `pending` when the run is initially created. When the run finishes, this will be set to `succeeded` and the `result` field will be populated. Rarely, we may encounter an error, at which point this will be set to `failed` and the `error` field will be populated. + pub status: String, + /// Timestamp at which this run successfully finished (populated when + /// `status=succeeded`). + /// + /// Measured in seconds since the Unix epoch. + pub succeeded_at: Option, +} +impl stripe_types::Object for ReportingReportRun { + type Id = stripe_misc::reporting_report_run::ReportingReportRunId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(ReportingReportRunId); +#[cfg(feature = "reporting_report_run")] +mod requests; +#[cfg(feature = "reporting_report_run")] +pub use requests::*; diff --git a/generated/stripe_misc/src/reporting_report_run/requests.rs b/generated/stripe_misc/src/reporting_report_run/requests.rs new file mode 100644 index 000000000..1832870d0 --- /dev/null +++ b/generated/stripe_misc/src/reporting_report_run/requests.rs @@ -0,0 +1,2138 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveReportingReportRun<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveReportingReportRun<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveReportingReportRun<'a> { + /// Retrieves the details of an existing Report Run. + pub fn send( + &self, + client: &stripe::Client, + report_run: &str, + ) -> stripe::Response { + client.get_query(&format!("/reporting/report_runs/{report_run}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateReportingReportRun<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Parameters specifying how the report should be run. + /// + /// Different Report Types have different required and optional parameters, listed in the [API Access to Reports](https://stripe.com/docs/reporting/statements/api) documentation. + #[serde(skip_serializing_if = "Option::is_none")] + pub parameters: Option>, + /// The ID of the [report type](https://stripe.com/docs/reporting/statements/api#report-types) to run, such as `"balance.summary.1"`. + pub report_type: &'a str, +} +impl<'a> CreateReportingReportRun<'a> { + pub fn new(report_type: &'a str) -> Self { + Self { expand: Default::default(), parameters: Default::default(), report_type } + } +} +/// Parameters specifying how the report should be run. +/// +/// Different Report Types have different required and optional parameters, listed in the [API Access to Reports](https://stripe.com/docs/reporting/statements/api) documentation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateReportingReportRunParameters<'a> { + /// The set of report columns to include in the report output. + /// + /// If omitted, the Report Type is run with its default column set. + #[serde(skip_serializing_if = "Option::is_none")] + pub columns: Option<&'a [&'a str]>, + /// Connected account ID to filter for in the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub connected_account: Option<&'a str>, + /// Currency of objects to be included in the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Ending timestamp of data to be included in the report run (exclusive). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_end: Option, + /// Starting timestamp of data to be included in the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_start: Option, + /// Payout ID by which to filter the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub payout: Option<&'a str>, + /// Category of balance transactions to be included in the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub reporting_category: Option, + /// Defaults to `Etc/UTC`. + /// + /// The output timezone for all timestamps in the report. + /// A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). + /// Has no effect on `interval_start` or `interval_end`. + #[serde(skip_serializing_if = "Option::is_none")] + pub timezone: Option, +} +impl<'a> CreateReportingReportRunParameters<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Category of balance transactions to be included in the report run. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateReportingReportRunParametersReportingCategory { + Advance, + AdvanceFunding, + AnticipationRepayment, + Charge, + ChargeFailure, + ConnectCollectionTransfer, + ConnectReservedFunds, + Contribution, + Dispute, + DisputeReversal, + Fee, + FinancingPaydown, + FinancingPaydownReversal, + FinancingPayout, + FinancingPayoutReversal, + IssuingAuthorizationHold, + IssuingAuthorizationRelease, + IssuingDispute, + IssuingTransaction, + NetworkCost, + Obligation, + OtherAdjustment, + PartialCaptureReversal, + Payout, + PayoutReversal, + PlatformEarning, + PlatformEarningRefund, + Refund, + RefundFailure, + RiskReservedFunds, + Tax, + Topup, + TopupReversal, + Transfer, + TransferReversal, + UnreconciledCustomerFunds, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateReportingReportRunParametersReportingCategory { + pub fn as_str(self) -> &'static str { + use CreateReportingReportRunParametersReportingCategory::*; + match self { + Advance => "advance", + AdvanceFunding => "advance_funding", + AnticipationRepayment => "anticipation_repayment", + Charge => "charge", + ChargeFailure => "charge_failure", + ConnectCollectionTransfer => "connect_collection_transfer", + ConnectReservedFunds => "connect_reserved_funds", + Contribution => "contribution", + Dispute => "dispute", + DisputeReversal => "dispute_reversal", + Fee => "fee", + FinancingPaydown => "financing_paydown", + FinancingPaydownReversal => "financing_paydown_reversal", + FinancingPayout => "financing_payout", + FinancingPayoutReversal => "financing_payout_reversal", + IssuingAuthorizationHold => "issuing_authorization_hold", + IssuingAuthorizationRelease => "issuing_authorization_release", + IssuingDispute => "issuing_dispute", + IssuingTransaction => "issuing_transaction", + NetworkCost => "network_cost", + Obligation => "obligation", + OtherAdjustment => "other_adjustment", + PartialCaptureReversal => "partial_capture_reversal", + Payout => "payout", + PayoutReversal => "payout_reversal", + PlatformEarning => "platform_earning", + PlatformEarningRefund => "platform_earning_refund", + Refund => "refund", + RefundFailure => "refund_failure", + RiskReservedFunds => "risk_reserved_funds", + Tax => "tax", + Topup => "topup", + TopupReversal => "topup_reversal", + Transfer => "transfer", + TransferReversal => "transfer_reversal", + UnreconciledCustomerFunds => "unreconciled_customer_funds", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateReportingReportRunParametersReportingCategory { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateReportingReportRunParametersReportingCategory::*; + match s { + "advance" => Ok(Advance), + "advance_funding" => Ok(AdvanceFunding), + "anticipation_repayment" => Ok(AnticipationRepayment), + "charge" => Ok(Charge), + "charge_failure" => Ok(ChargeFailure), + "connect_collection_transfer" => Ok(ConnectCollectionTransfer), + "connect_reserved_funds" => Ok(ConnectReservedFunds), + "contribution" => Ok(Contribution), + "dispute" => Ok(Dispute), + "dispute_reversal" => Ok(DisputeReversal), + "fee" => Ok(Fee), + "financing_paydown" => Ok(FinancingPaydown), + "financing_paydown_reversal" => Ok(FinancingPaydownReversal), + "financing_payout" => Ok(FinancingPayout), + "financing_payout_reversal" => Ok(FinancingPayoutReversal), + "issuing_authorization_hold" => Ok(IssuingAuthorizationHold), + "issuing_authorization_release" => Ok(IssuingAuthorizationRelease), + "issuing_dispute" => Ok(IssuingDispute), + "issuing_transaction" => Ok(IssuingTransaction), + "network_cost" => Ok(NetworkCost), + "obligation" => Ok(Obligation), + "other_adjustment" => Ok(OtherAdjustment), + "partial_capture_reversal" => Ok(PartialCaptureReversal), + "payout" => Ok(Payout), + "payout_reversal" => Ok(PayoutReversal), + "platform_earning" => Ok(PlatformEarning), + "platform_earning_refund" => Ok(PlatformEarningRefund), + "refund" => Ok(Refund), + "refund_failure" => Ok(RefundFailure), + "risk_reserved_funds" => Ok(RiskReservedFunds), + "tax" => Ok(Tax), + "topup" => Ok(Topup), + "topup_reversal" => Ok(TopupReversal), + "transfer" => Ok(Transfer), + "transfer_reversal" => Ok(TransferReversal), + "unreconciled_customer_funds" => Ok(UnreconciledCustomerFunds), + _ => Err(()), + } + } +} +impl AsRef for CreateReportingReportRunParametersReportingCategory { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateReportingReportRunParametersReportingCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateReportingReportRunParametersReportingCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateReportingReportRunParametersReportingCategory { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Defaults to `Etc/UTC`. +/// +/// The output timezone for all timestamps in the report. +/// A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). +/// Has no effect on `interval_start` or `interval_end`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateReportingReportRunParametersTimezone { + AfricaAbidjan, + AfricaAccra, + AfricaAddisAbaba, + AfricaAlgiers, + AfricaAsmara, + AfricaAsmera, + AfricaBamako, + AfricaBangui, + AfricaBanjul, + AfricaBissau, + AfricaBlantyre, + AfricaBrazzaville, + AfricaBujumbura, + AfricaCairo, + AfricaCasablanca, + AfricaCeuta, + AfricaConakry, + AfricaDakar, + AfricaDarEsSalaam, + AfricaDjibouti, + AfricaDouala, + AfricaElAaiun, + AfricaFreetown, + AfricaGaborone, + AfricaHarare, + AfricaJohannesburg, + AfricaJuba, + AfricaKampala, + AfricaKhartoum, + AfricaKigali, + AfricaKinshasa, + AfricaLagos, + AfricaLibreville, + AfricaLome, + AfricaLuanda, + AfricaLubumbashi, + AfricaLusaka, + AfricaMalabo, + AfricaMaputo, + AfricaMaseru, + AfricaMbabane, + AfricaMogadishu, + AfricaMonrovia, + AfricaNairobi, + AfricaNdjamena, + AfricaNiamey, + AfricaNouakchott, + AfricaOuagadougou, + AfricaPortoMinusNovo, + AfricaSaoTome, + AfricaTimbuktu, + AfricaTripoli, + AfricaTunis, + AfricaWindhoek, + AmericaAdak, + AmericaAnchorage, + AmericaAnguilla, + AmericaAntigua, + AmericaAraguaina, + AmericaArgentinaBuenosAires, + AmericaArgentinaCatamarca, + AmericaArgentinaComodRivadavia, + AmericaArgentinaCordoba, + AmericaArgentinaJujuy, + AmericaArgentinaLaRioja, + AmericaArgentinaMendoza, + AmericaArgentinaRioGallegos, + AmericaArgentinaSalta, + AmericaArgentinaSanJuan, + AmericaArgentinaSanLuis, + AmericaArgentinaTucuman, + AmericaArgentinaUshuaia, + AmericaAruba, + AmericaAsuncion, + AmericaAtikokan, + AmericaAtka, + AmericaBahia, + AmericaBahiaBanderas, + AmericaBarbados, + AmericaBelem, + AmericaBelize, + AmericaBlancMinusSablon, + AmericaBoaVista, + AmericaBogota, + AmericaBoise, + AmericaBuenosAires, + AmericaCambridgeBay, + AmericaCampoGrande, + AmericaCancun, + AmericaCaracas, + AmericaCatamarca, + AmericaCayenne, + AmericaCayman, + AmericaChicago, + AmericaChihuahua, + AmericaCiudadJuarez, + AmericaCoralHarbour, + AmericaCordoba, + AmericaCostaRica, + AmericaCreston, + AmericaCuiaba, + AmericaCuracao, + AmericaDanmarkshavn, + AmericaDawson, + AmericaDawsonCreek, + AmericaDenver, + AmericaDetroit, + AmericaDominica, + AmericaEdmonton, + AmericaEirunepe, + AmericaElSalvador, + AmericaEnsenada, + AmericaFortNelson, + AmericaFortWayne, + AmericaFortaleza, + AmericaGlaceBay, + AmericaGodthab, + AmericaGooseBay, + AmericaGrandTurk, + AmericaGrenada, + AmericaGuadeloupe, + AmericaGuatemala, + AmericaGuayaquil, + AmericaGuyana, + AmericaHalifax, + AmericaHavana, + AmericaHermosillo, + AmericaIndianaIndianapolis, + AmericaIndianaKnox, + AmericaIndianaMarengo, + AmericaIndianaPetersburg, + AmericaIndianaTellCity, + AmericaIndianaVevay, + AmericaIndianaVincennes, + AmericaIndianaWinamac, + AmericaIndianapolis, + AmericaInuvik, + AmericaIqaluit, + AmericaJamaica, + AmericaJujuy, + AmericaJuneau, + AmericaKentuckyLouisville, + AmericaKentuckyMonticello, + AmericaKnoxIn, + AmericaKralendijk, + AmericaLaPaz, + AmericaLima, + AmericaLosAngeles, + AmericaLouisville, + AmericaLowerPrinces, + AmericaMaceio, + AmericaManagua, + AmericaManaus, + AmericaMarigot, + AmericaMartinique, + AmericaMatamoros, + AmericaMazatlan, + AmericaMendoza, + AmericaMenominee, + AmericaMerida, + AmericaMetlakatla, + AmericaMexicoCity, + AmericaMiquelon, + AmericaMoncton, + AmericaMonterrey, + AmericaMontevideo, + AmericaMontreal, + AmericaMontserrat, + AmericaNassau, + AmericaNewYork, + AmericaNipigon, + AmericaNome, + AmericaNoronha, + AmericaNorthDakotaBeulah, + AmericaNorthDakotaCenter, + AmericaNorthDakotaNewSalem, + AmericaNuuk, + AmericaOjinaga, + AmericaPanama, + AmericaPangnirtung, + AmericaParamaribo, + AmericaPhoenix, + AmericaPortMinusauMinusPrince, + AmericaPortOfSpain, + AmericaPortoAcre, + AmericaPortoVelho, + AmericaPuertoRico, + AmericaPuntaArenas, + AmericaRainyRiver, + AmericaRankinInlet, + AmericaRecife, + AmericaRegina, + AmericaResolute, + AmericaRioBranco, + AmericaRosario, + AmericaSantaIsabel, + AmericaSantarem, + AmericaSantiago, + AmericaSantoDomingo, + AmericaSaoPaulo, + AmericaScoresbysund, + AmericaShiprock, + AmericaSitka, + AmericaStBarthelemy, + AmericaStJohns, + AmericaStKitts, + AmericaStLucia, + AmericaStThomas, + AmericaStVincent, + AmericaSwiftCurrent, + AmericaTegucigalpa, + AmericaThule, + AmericaThunderBay, + AmericaTijuana, + AmericaToronto, + AmericaTortola, + AmericaVancouver, + AmericaVirgin, + AmericaWhitehorse, + AmericaWinnipeg, + AmericaYakutat, + AmericaYellowknife, + AntarcticaCasey, + AntarcticaDavis, + AntarcticaDumontDUrville, + AntarcticaMacquarie, + AntarcticaMawson, + AntarcticaMcMurdo, + AntarcticaPalmer, + AntarcticaRothera, + AntarcticaSouthPole, + AntarcticaSyowa, + AntarcticaTroll, + AntarcticaVostok, + ArcticLongyearbyen, + AsiaAden, + AsiaAlmaty, + AsiaAmman, + AsiaAnadyr, + AsiaAqtau, + AsiaAqtobe, + AsiaAshgabat, + AsiaAshkhabad, + AsiaAtyrau, + AsiaBaghdad, + AsiaBahrain, + AsiaBaku, + AsiaBangkok, + AsiaBarnaul, + AsiaBeirut, + AsiaBishkek, + AsiaBrunei, + AsiaCalcutta, + AsiaChita, + AsiaChoibalsan, + AsiaChongqing, + AsiaChungking, + AsiaColombo, + AsiaDacca, + AsiaDamascus, + AsiaDhaka, + AsiaDili, + AsiaDubai, + AsiaDushanbe, + AsiaFamagusta, + AsiaGaza, + AsiaHarbin, + AsiaHebron, + AsiaHoChiMinh, + AsiaHongKong, + AsiaHovd, + AsiaIrkutsk, + AsiaIstanbul, + AsiaJakarta, + AsiaJayapura, + AsiaJerusalem, + AsiaKabul, + AsiaKamchatka, + AsiaKarachi, + AsiaKashgar, + AsiaKathmandu, + AsiaKatmandu, + AsiaKhandyga, + AsiaKolkata, + AsiaKrasnoyarsk, + AsiaKualaLumpur, + AsiaKuching, + AsiaKuwait, + AsiaMacao, + AsiaMacau, + AsiaMagadan, + AsiaMakassar, + AsiaManila, + AsiaMuscat, + AsiaNicosia, + AsiaNovokuznetsk, + AsiaNovosibirsk, + AsiaOmsk, + AsiaOral, + AsiaPhnomPenh, + AsiaPontianak, + AsiaPyongyang, + AsiaQatar, + AsiaQostanay, + AsiaQyzylorda, + AsiaRangoon, + AsiaRiyadh, + AsiaSaigon, + AsiaSakhalin, + AsiaSamarkand, + AsiaSeoul, + AsiaShanghai, + AsiaSingapore, + AsiaSrednekolymsk, + AsiaTaipei, + AsiaTashkent, + AsiaTbilisi, + AsiaTehran, + AsiaTelAviv, + AsiaThimbu, + AsiaThimphu, + AsiaTokyo, + AsiaTomsk, + AsiaUjungPandang, + AsiaUlaanbaatar, + AsiaUlanBator, + AsiaUrumqi, + AsiaUstMinusNera, + AsiaVientiane, + AsiaVladivostok, + AsiaYakutsk, + AsiaYangon, + AsiaYekaterinburg, + AsiaYerevan, + AtlanticAzores, + AtlanticBermuda, + AtlanticCanary, + AtlanticCapeVerde, + AtlanticFaeroe, + AtlanticFaroe, + AtlanticJanMayen, + AtlanticMadeira, + AtlanticReykjavik, + AtlanticSouthGeorgia, + AtlanticStHelena, + AtlanticStanley, + AustraliaAct, + AustraliaAdelaide, + AustraliaBrisbane, + AustraliaBrokenHill, + AustraliaCanberra, + AustraliaCurrie, + AustraliaDarwin, + AustraliaEucla, + AustraliaHobart, + AustraliaLhi, + AustraliaLindeman, + AustraliaLordHowe, + AustraliaMelbourne, + AustraliaNsw, + AustraliaNorth, + AustraliaPerth, + AustraliaQueensland, + AustraliaSouth, + AustraliaSydney, + AustraliaTasmania, + AustraliaVictoria, + AustraliaWest, + AustraliaYancowinna, + BrazilAcre, + BrazilDeNoronha, + BrazilEast, + BrazilWest, + Cet, + Cst6cdt, + CanadaAtlantic, + CanadaCentral, + CanadaEastern, + CanadaMountain, + CanadaNewfoundland, + CanadaPacific, + CanadaSaskatchewan, + CanadaYukon, + ChileContinental, + ChileEasterIsland, + Cuba, + Eet, + Est, + Est5edt, + Egypt, + Eire, + EtcGmt, + EtcGmtPlus0, + EtcGmtPlus1, + EtcGmtPlus10, + EtcGmtPlus11, + EtcGmtPlus12, + EtcGmtPlus2, + EtcGmtPlus3, + EtcGmtPlus4, + EtcGmtPlus5, + EtcGmtPlus6, + EtcGmtPlus7, + EtcGmtPlus8, + EtcGmtPlus9, + EtcGmtMinus0, + EtcGmtMinus1, + EtcGmtMinus10, + EtcGmtMinus11, + EtcGmtMinus12, + EtcGmtMinus13, + EtcGmtMinus14, + EtcGmtMinus2, + EtcGmtMinus3, + EtcGmtMinus4, + EtcGmtMinus5, + EtcGmtMinus6, + EtcGmtMinus7, + EtcGmtMinus8, + EtcGmtMinus9, + EtcGmt0, + EtcGreenwich, + EtcUct, + EtcUtc, + EtcUniversal, + EtcZulu, + EuropeAmsterdam, + EuropeAndorra, + EuropeAstrakhan, + EuropeAthens, + EuropeBelfast, + EuropeBelgrade, + EuropeBerlin, + EuropeBratislava, + EuropeBrussels, + EuropeBucharest, + EuropeBudapest, + EuropeBusingen, + EuropeChisinau, + EuropeCopenhagen, + EuropeDublin, + EuropeGibraltar, + EuropeGuernsey, + EuropeHelsinki, + EuropeIsleOfMan, + EuropeIstanbul, + EuropeJersey, + EuropeKaliningrad, + EuropeKiev, + EuropeKirov, + EuropeKyiv, + EuropeLisbon, + EuropeLjubljana, + EuropeLondon, + EuropeLuxembourg, + EuropeMadrid, + EuropeMalta, + EuropeMariehamn, + EuropeMinsk, + EuropeMonaco, + EuropeMoscow, + EuropeNicosia, + EuropeOslo, + EuropeParis, + EuropePodgorica, + EuropePrague, + EuropeRiga, + EuropeRome, + EuropeSamara, + EuropeSanMarino, + EuropeSarajevo, + EuropeSaratov, + EuropeSimferopol, + EuropeSkopje, + EuropeSofia, + EuropeStockholm, + EuropeTallinn, + EuropeTirane, + EuropeTiraspol, + EuropeUlyanovsk, + EuropeUzhgorod, + EuropeVaduz, + EuropeVatican, + EuropeVienna, + EuropeVilnius, + EuropeVolgograd, + EuropeWarsaw, + EuropeZagreb, + EuropeZaporozhye, + EuropeZurich, + Factory, + Gb, + GbMinusEire, + Gmt, + GmtPlus0, + GmtMinus0, + Gmt0, + Greenwich, + Hst, + Hongkong, + Iceland, + IndianAntananarivo, + IndianChagos, + IndianChristmas, + IndianCocos, + IndianComoro, + IndianKerguelen, + IndianMahe, + IndianMaldives, + IndianMauritius, + IndianMayotte, + IndianReunion, + Iran, + Israel, + Jamaica, + Japan, + Kwajalein, + Libya, + Met, + Mst, + Mst7mdt, + MexicoBajaNorte, + MexicoBajaSur, + MexicoGeneral, + Nz, + NzMinusChat, + Navajo, + Prc, + Pst8pdt, + PacificApia, + PacificAuckland, + PacificBougainville, + PacificChatham, + PacificChuuk, + PacificEaster, + PacificEfate, + PacificEnderbury, + PacificFakaofo, + PacificFiji, + PacificFunafuti, + PacificGalapagos, + PacificGambier, + PacificGuadalcanal, + PacificGuam, + PacificHonolulu, + PacificJohnston, + PacificKanton, + PacificKiritimati, + PacificKosrae, + PacificKwajalein, + PacificMajuro, + PacificMarquesas, + PacificMidway, + PacificNauru, + PacificNiue, + PacificNorfolk, + PacificNoumea, + PacificPagoPago, + PacificPalau, + PacificPitcairn, + PacificPohnpei, + PacificPonape, + PacificPortMoresby, + PacificRarotonga, + PacificSaipan, + PacificSamoa, + PacificTahiti, + PacificTarawa, + PacificTongatapu, + PacificTruk, + PacificWake, + PacificWallis, + PacificYap, + Poland, + Portugal, + Roc, + Rok, + Singapore, + Turkey, + Uct, + UsAlaska, + UsAleutian, + UsArizona, + UsCentral, + UsEastMinusIndiana, + UsEastern, + UsHawaii, + UsIndianaMinusStarke, + UsMichigan, + UsMountain, + UsPacific, + UsPacificMinusNew, + UsSamoa, + Utc, + Universal, + WMinusSu, + Wet, + Zulu, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateReportingReportRunParametersTimezone { + pub fn as_str(self) -> &'static str { + use CreateReportingReportRunParametersTimezone::*; + match self { + AfricaAbidjan => "Africa/Abidjan", + AfricaAccra => "Africa/Accra", + AfricaAddisAbaba => "Africa/Addis_Ababa", + AfricaAlgiers => "Africa/Algiers", + AfricaAsmara => "Africa/Asmara", + AfricaAsmera => "Africa/Asmera", + AfricaBamako => "Africa/Bamako", + AfricaBangui => "Africa/Bangui", + AfricaBanjul => "Africa/Banjul", + AfricaBissau => "Africa/Bissau", + AfricaBlantyre => "Africa/Blantyre", + AfricaBrazzaville => "Africa/Brazzaville", + AfricaBujumbura => "Africa/Bujumbura", + AfricaCairo => "Africa/Cairo", + AfricaCasablanca => "Africa/Casablanca", + AfricaCeuta => "Africa/Ceuta", + AfricaConakry => "Africa/Conakry", + AfricaDakar => "Africa/Dakar", + AfricaDarEsSalaam => "Africa/Dar_es_Salaam", + AfricaDjibouti => "Africa/Djibouti", + AfricaDouala => "Africa/Douala", + AfricaElAaiun => "Africa/El_Aaiun", + AfricaFreetown => "Africa/Freetown", + AfricaGaborone => "Africa/Gaborone", + AfricaHarare => "Africa/Harare", + AfricaJohannesburg => "Africa/Johannesburg", + AfricaJuba => "Africa/Juba", + AfricaKampala => "Africa/Kampala", + AfricaKhartoum => "Africa/Khartoum", + AfricaKigali => "Africa/Kigali", + AfricaKinshasa => "Africa/Kinshasa", + AfricaLagos => "Africa/Lagos", + AfricaLibreville => "Africa/Libreville", + AfricaLome => "Africa/Lome", + AfricaLuanda => "Africa/Luanda", + AfricaLubumbashi => "Africa/Lubumbashi", + AfricaLusaka => "Africa/Lusaka", + AfricaMalabo => "Africa/Malabo", + AfricaMaputo => "Africa/Maputo", + AfricaMaseru => "Africa/Maseru", + AfricaMbabane => "Africa/Mbabane", + AfricaMogadishu => "Africa/Mogadishu", + AfricaMonrovia => "Africa/Monrovia", + AfricaNairobi => "Africa/Nairobi", + AfricaNdjamena => "Africa/Ndjamena", + AfricaNiamey => "Africa/Niamey", + AfricaNouakchott => "Africa/Nouakchott", + AfricaOuagadougou => "Africa/Ouagadougou", + AfricaPortoMinusNovo => "Africa/Porto-Novo", + AfricaSaoTome => "Africa/Sao_Tome", + AfricaTimbuktu => "Africa/Timbuktu", + AfricaTripoli => "Africa/Tripoli", + AfricaTunis => "Africa/Tunis", + AfricaWindhoek => "Africa/Windhoek", + AmericaAdak => "America/Adak", + AmericaAnchorage => "America/Anchorage", + AmericaAnguilla => "America/Anguilla", + AmericaAntigua => "America/Antigua", + AmericaAraguaina => "America/Araguaina", + AmericaArgentinaBuenosAires => "America/Argentina/Buenos_Aires", + AmericaArgentinaCatamarca => "America/Argentina/Catamarca", + AmericaArgentinaComodRivadavia => "America/Argentina/ComodRivadavia", + AmericaArgentinaCordoba => "America/Argentina/Cordoba", + AmericaArgentinaJujuy => "America/Argentina/Jujuy", + AmericaArgentinaLaRioja => "America/Argentina/La_Rioja", + AmericaArgentinaMendoza => "America/Argentina/Mendoza", + AmericaArgentinaRioGallegos => "America/Argentina/Rio_Gallegos", + AmericaArgentinaSalta => "America/Argentina/Salta", + AmericaArgentinaSanJuan => "America/Argentina/San_Juan", + AmericaArgentinaSanLuis => "America/Argentina/San_Luis", + AmericaArgentinaTucuman => "America/Argentina/Tucuman", + AmericaArgentinaUshuaia => "America/Argentina/Ushuaia", + AmericaAruba => "America/Aruba", + AmericaAsuncion => "America/Asuncion", + AmericaAtikokan => "America/Atikokan", + AmericaAtka => "America/Atka", + AmericaBahia => "America/Bahia", + AmericaBahiaBanderas => "America/Bahia_Banderas", + AmericaBarbados => "America/Barbados", + AmericaBelem => "America/Belem", + AmericaBelize => "America/Belize", + AmericaBlancMinusSablon => "America/Blanc-Sablon", + AmericaBoaVista => "America/Boa_Vista", + AmericaBogota => "America/Bogota", + AmericaBoise => "America/Boise", + AmericaBuenosAires => "America/Buenos_Aires", + AmericaCambridgeBay => "America/Cambridge_Bay", + AmericaCampoGrande => "America/Campo_Grande", + AmericaCancun => "America/Cancun", + AmericaCaracas => "America/Caracas", + AmericaCatamarca => "America/Catamarca", + AmericaCayenne => "America/Cayenne", + AmericaCayman => "America/Cayman", + AmericaChicago => "America/Chicago", + AmericaChihuahua => "America/Chihuahua", + AmericaCiudadJuarez => "America/Ciudad_Juarez", + AmericaCoralHarbour => "America/Coral_Harbour", + AmericaCordoba => "America/Cordoba", + AmericaCostaRica => "America/Costa_Rica", + AmericaCreston => "America/Creston", + AmericaCuiaba => "America/Cuiaba", + AmericaCuracao => "America/Curacao", + AmericaDanmarkshavn => "America/Danmarkshavn", + AmericaDawson => "America/Dawson", + AmericaDawsonCreek => "America/Dawson_Creek", + AmericaDenver => "America/Denver", + AmericaDetroit => "America/Detroit", + AmericaDominica => "America/Dominica", + AmericaEdmonton => "America/Edmonton", + AmericaEirunepe => "America/Eirunepe", + AmericaElSalvador => "America/El_Salvador", + AmericaEnsenada => "America/Ensenada", + AmericaFortNelson => "America/Fort_Nelson", + AmericaFortWayne => "America/Fort_Wayne", + AmericaFortaleza => "America/Fortaleza", + AmericaGlaceBay => "America/Glace_Bay", + AmericaGodthab => "America/Godthab", + AmericaGooseBay => "America/Goose_Bay", + AmericaGrandTurk => "America/Grand_Turk", + AmericaGrenada => "America/Grenada", + AmericaGuadeloupe => "America/Guadeloupe", + AmericaGuatemala => "America/Guatemala", + AmericaGuayaquil => "America/Guayaquil", + AmericaGuyana => "America/Guyana", + AmericaHalifax => "America/Halifax", + AmericaHavana => "America/Havana", + AmericaHermosillo => "America/Hermosillo", + AmericaIndianaIndianapolis => "America/Indiana/Indianapolis", + AmericaIndianaKnox => "America/Indiana/Knox", + AmericaIndianaMarengo => "America/Indiana/Marengo", + AmericaIndianaPetersburg => "America/Indiana/Petersburg", + AmericaIndianaTellCity => "America/Indiana/Tell_City", + AmericaIndianaVevay => "America/Indiana/Vevay", + AmericaIndianaVincennes => "America/Indiana/Vincennes", + AmericaIndianaWinamac => "America/Indiana/Winamac", + AmericaIndianapolis => "America/Indianapolis", + AmericaInuvik => "America/Inuvik", + AmericaIqaluit => "America/Iqaluit", + AmericaJamaica => "America/Jamaica", + AmericaJujuy => "America/Jujuy", + AmericaJuneau => "America/Juneau", + AmericaKentuckyLouisville => "America/Kentucky/Louisville", + AmericaKentuckyMonticello => "America/Kentucky/Monticello", + AmericaKnoxIn => "America/Knox_IN", + AmericaKralendijk => "America/Kralendijk", + AmericaLaPaz => "America/La_Paz", + AmericaLima => "America/Lima", + AmericaLosAngeles => "America/Los_Angeles", + AmericaLouisville => "America/Louisville", + AmericaLowerPrinces => "America/Lower_Princes", + AmericaMaceio => "America/Maceio", + AmericaManagua => "America/Managua", + AmericaManaus => "America/Manaus", + AmericaMarigot => "America/Marigot", + AmericaMartinique => "America/Martinique", + AmericaMatamoros => "America/Matamoros", + AmericaMazatlan => "America/Mazatlan", + AmericaMendoza => "America/Mendoza", + AmericaMenominee => "America/Menominee", + AmericaMerida => "America/Merida", + AmericaMetlakatla => "America/Metlakatla", + AmericaMexicoCity => "America/Mexico_City", + AmericaMiquelon => "America/Miquelon", + AmericaMoncton => "America/Moncton", + AmericaMonterrey => "America/Monterrey", + AmericaMontevideo => "America/Montevideo", + AmericaMontreal => "America/Montreal", + AmericaMontserrat => "America/Montserrat", + AmericaNassau => "America/Nassau", + AmericaNewYork => "America/New_York", + AmericaNipigon => "America/Nipigon", + AmericaNome => "America/Nome", + AmericaNoronha => "America/Noronha", + AmericaNorthDakotaBeulah => "America/North_Dakota/Beulah", + AmericaNorthDakotaCenter => "America/North_Dakota/Center", + AmericaNorthDakotaNewSalem => "America/North_Dakota/New_Salem", + AmericaNuuk => "America/Nuuk", + AmericaOjinaga => "America/Ojinaga", + AmericaPanama => "America/Panama", + AmericaPangnirtung => "America/Pangnirtung", + AmericaParamaribo => "America/Paramaribo", + AmericaPhoenix => "America/Phoenix", + AmericaPortMinusauMinusPrince => "America/Port-au-Prince", + AmericaPortOfSpain => "America/Port_of_Spain", + AmericaPortoAcre => "America/Porto_Acre", + AmericaPortoVelho => "America/Porto_Velho", + AmericaPuertoRico => "America/Puerto_Rico", + AmericaPuntaArenas => "America/Punta_Arenas", + AmericaRainyRiver => "America/Rainy_River", + AmericaRankinInlet => "America/Rankin_Inlet", + AmericaRecife => "America/Recife", + AmericaRegina => "America/Regina", + AmericaResolute => "America/Resolute", + AmericaRioBranco => "America/Rio_Branco", + AmericaRosario => "America/Rosario", + AmericaSantaIsabel => "America/Santa_Isabel", + AmericaSantarem => "America/Santarem", + AmericaSantiago => "America/Santiago", + AmericaSantoDomingo => "America/Santo_Domingo", + AmericaSaoPaulo => "America/Sao_Paulo", + AmericaScoresbysund => "America/Scoresbysund", + AmericaShiprock => "America/Shiprock", + AmericaSitka => "America/Sitka", + AmericaStBarthelemy => "America/St_Barthelemy", + AmericaStJohns => "America/St_Johns", + AmericaStKitts => "America/St_Kitts", + AmericaStLucia => "America/St_Lucia", + AmericaStThomas => "America/St_Thomas", + AmericaStVincent => "America/St_Vincent", + AmericaSwiftCurrent => "America/Swift_Current", + AmericaTegucigalpa => "America/Tegucigalpa", + AmericaThule => "America/Thule", + AmericaThunderBay => "America/Thunder_Bay", + AmericaTijuana => "America/Tijuana", + AmericaToronto => "America/Toronto", + AmericaTortola => "America/Tortola", + AmericaVancouver => "America/Vancouver", + AmericaVirgin => "America/Virgin", + AmericaWhitehorse => "America/Whitehorse", + AmericaWinnipeg => "America/Winnipeg", + AmericaYakutat => "America/Yakutat", + AmericaYellowknife => "America/Yellowknife", + AntarcticaCasey => "Antarctica/Casey", + AntarcticaDavis => "Antarctica/Davis", + AntarcticaDumontDUrville => "Antarctica/DumontDUrville", + AntarcticaMacquarie => "Antarctica/Macquarie", + AntarcticaMawson => "Antarctica/Mawson", + AntarcticaMcMurdo => "Antarctica/McMurdo", + AntarcticaPalmer => "Antarctica/Palmer", + AntarcticaRothera => "Antarctica/Rothera", + AntarcticaSouthPole => "Antarctica/South_Pole", + AntarcticaSyowa => "Antarctica/Syowa", + AntarcticaTroll => "Antarctica/Troll", + AntarcticaVostok => "Antarctica/Vostok", + ArcticLongyearbyen => "Arctic/Longyearbyen", + AsiaAden => "Asia/Aden", + AsiaAlmaty => "Asia/Almaty", + AsiaAmman => "Asia/Amman", + AsiaAnadyr => "Asia/Anadyr", + AsiaAqtau => "Asia/Aqtau", + AsiaAqtobe => "Asia/Aqtobe", + AsiaAshgabat => "Asia/Ashgabat", + AsiaAshkhabad => "Asia/Ashkhabad", + AsiaAtyrau => "Asia/Atyrau", + AsiaBaghdad => "Asia/Baghdad", + AsiaBahrain => "Asia/Bahrain", + AsiaBaku => "Asia/Baku", + AsiaBangkok => "Asia/Bangkok", + AsiaBarnaul => "Asia/Barnaul", + AsiaBeirut => "Asia/Beirut", + AsiaBishkek => "Asia/Bishkek", + AsiaBrunei => "Asia/Brunei", + AsiaCalcutta => "Asia/Calcutta", + AsiaChita => "Asia/Chita", + AsiaChoibalsan => "Asia/Choibalsan", + AsiaChongqing => "Asia/Chongqing", + AsiaChungking => "Asia/Chungking", + AsiaColombo => "Asia/Colombo", + AsiaDacca => "Asia/Dacca", + AsiaDamascus => "Asia/Damascus", + AsiaDhaka => "Asia/Dhaka", + AsiaDili => "Asia/Dili", + AsiaDubai => "Asia/Dubai", + AsiaDushanbe => "Asia/Dushanbe", + AsiaFamagusta => "Asia/Famagusta", + AsiaGaza => "Asia/Gaza", + AsiaHarbin => "Asia/Harbin", + AsiaHebron => "Asia/Hebron", + AsiaHoChiMinh => "Asia/Ho_Chi_Minh", + AsiaHongKong => "Asia/Hong_Kong", + AsiaHovd => "Asia/Hovd", + AsiaIrkutsk => "Asia/Irkutsk", + AsiaIstanbul => "Asia/Istanbul", + AsiaJakarta => "Asia/Jakarta", + AsiaJayapura => "Asia/Jayapura", + AsiaJerusalem => "Asia/Jerusalem", + AsiaKabul => "Asia/Kabul", + AsiaKamchatka => "Asia/Kamchatka", + AsiaKarachi => "Asia/Karachi", + AsiaKashgar => "Asia/Kashgar", + AsiaKathmandu => "Asia/Kathmandu", + AsiaKatmandu => "Asia/Katmandu", + AsiaKhandyga => "Asia/Khandyga", + AsiaKolkata => "Asia/Kolkata", + AsiaKrasnoyarsk => "Asia/Krasnoyarsk", + AsiaKualaLumpur => "Asia/Kuala_Lumpur", + AsiaKuching => "Asia/Kuching", + AsiaKuwait => "Asia/Kuwait", + AsiaMacao => "Asia/Macao", + AsiaMacau => "Asia/Macau", + AsiaMagadan => "Asia/Magadan", + AsiaMakassar => "Asia/Makassar", + AsiaManila => "Asia/Manila", + AsiaMuscat => "Asia/Muscat", + AsiaNicosia => "Asia/Nicosia", + AsiaNovokuznetsk => "Asia/Novokuznetsk", + AsiaNovosibirsk => "Asia/Novosibirsk", + AsiaOmsk => "Asia/Omsk", + AsiaOral => "Asia/Oral", + AsiaPhnomPenh => "Asia/Phnom_Penh", + AsiaPontianak => "Asia/Pontianak", + AsiaPyongyang => "Asia/Pyongyang", + AsiaQatar => "Asia/Qatar", + AsiaQostanay => "Asia/Qostanay", + AsiaQyzylorda => "Asia/Qyzylorda", + AsiaRangoon => "Asia/Rangoon", + AsiaRiyadh => "Asia/Riyadh", + AsiaSaigon => "Asia/Saigon", + AsiaSakhalin => "Asia/Sakhalin", + AsiaSamarkand => "Asia/Samarkand", + AsiaSeoul => "Asia/Seoul", + AsiaShanghai => "Asia/Shanghai", + AsiaSingapore => "Asia/Singapore", + AsiaSrednekolymsk => "Asia/Srednekolymsk", + AsiaTaipei => "Asia/Taipei", + AsiaTashkent => "Asia/Tashkent", + AsiaTbilisi => "Asia/Tbilisi", + AsiaTehran => "Asia/Tehran", + AsiaTelAviv => "Asia/Tel_Aviv", + AsiaThimbu => "Asia/Thimbu", + AsiaThimphu => "Asia/Thimphu", + AsiaTokyo => "Asia/Tokyo", + AsiaTomsk => "Asia/Tomsk", + AsiaUjungPandang => "Asia/Ujung_Pandang", + AsiaUlaanbaatar => "Asia/Ulaanbaatar", + AsiaUlanBator => "Asia/Ulan_Bator", + AsiaUrumqi => "Asia/Urumqi", + AsiaUstMinusNera => "Asia/Ust-Nera", + AsiaVientiane => "Asia/Vientiane", + AsiaVladivostok => "Asia/Vladivostok", + AsiaYakutsk => "Asia/Yakutsk", + AsiaYangon => "Asia/Yangon", + AsiaYekaterinburg => "Asia/Yekaterinburg", + AsiaYerevan => "Asia/Yerevan", + AtlanticAzores => "Atlantic/Azores", + AtlanticBermuda => "Atlantic/Bermuda", + AtlanticCanary => "Atlantic/Canary", + AtlanticCapeVerde => "Atlantic/Cape_Verde", + AtlanticFaeroe => "Atlantic/Faeroe", + AtlanticFaroe => "Atlantic/Faroe", + AtlanticJanMayen => "Atlantic/Jan_Mayen", + AtlanticMadeira => "Atlantic/Madeira", + AtlanticReykjavik => "Atlantic/Reykjavik", + AtlanticSouthGeorgia => "Atlantic/South_Georgia", + AtlanticStHelena => "Atlantic/St_Helena", + AtlanticStanley => "Atlantic/Stanley", + AustraliaAct => "Australia/ACT", + AustraliaAdelaide => "Australia/Adelaide", + AustraliaBrisbane => "Australia/Brisbane", + AustraliaBrokenHill => "Australia/Broken_Hill", + AustraliaCanberra => "Australia/Canberra", + AustraliaCurrie => "Australia/Currie", + AustraliaDarwin => "Australia/Darwin", + AustraliaEucla => "Australia/Eucla", + AustraliaHobart => "Australia/Hobart", + AustraliaLhi => "Australia/LHI", + AustraliaLindeman => "Australia/Lindeman", + AustraliaLordHowe => "Australia/Lord_Howe", + AustraliaMelbourne => "Australia/Melbourne", + AustraliaNsw => "Australia/NSW", + AustraliaNorth => "Australia/North", + AustraliaPerth => "Australia/Perth", + AustraliaQueensland => "Australia/Queensland", + AustraliaSouth => "Australia/South", + AustraliaSydney => "Australia/Sydney", + AustraliaTasmania => "Australia/Tasmania", + AustraliaVictoria => "Australia/Victoria", + AustraliaWest => "Australia/West", + AustraliaYancowinna => "Australia/Yancowinna", + BrazilAcre => "Brazil/Acre", + BrazilDeNoronha => "Brazil/DeNoronha", + BrazilEast => "Brazil/East", + BrazilWest => "Brazil/West", + Cet => "CET", + Cst6cdt => "CST6CDT", + CanadaAtlantic => "Canada/Atlantic", + CanadaCentral => "Canada/Central", + CanadaEastern => "Canada/Eastern", + CanadaMountain => "Canada/Mountain", + CanadaNewfoundland => "Canada/Newfoundland", + CanadaPacific => "Canada/Pacific", + CanadaSaskatchewan => "Canada/Saskatchewan", + CanadaYukon => "Canada/Yukon", + ChileContinental => "Chile/Continental", + ChileEasterIsland => "Chile/EasterIsland", + Cuba => "Cuba", + Eet => "EET", + Est => "EST", + Est5edt => "EST5EDT", + Egypt => "Egypt", + Eire => "Eire", + EtcGmt => "Etc/GMT", + EtcGmtPlus0 => "Etc/GMT+0", + EtcGmtPlus1 => "Etc/GMT+1", + EtcGmtPlus10 => "Etc/GMT+10", + EtcGmtPlus11 => "Etc/GMT+11", + EtcGmtPlus12 => "Etc/GMT+12", + EtcGmtPlus2 => "Etc/GMT+2", + EtcGmtPlus3 => "Etc/GMT+3", + EtcGmtPlus4 => "Etc/GMT+4", + EtcGmtPlus5 => "Etc/GMT+5", + EtcGmtPlus6 => "Etc/GMT+6", + EtcGmtPlus7 => "Etc/GMT+7", + EtcGmtPlus8 => "Etc/GMT+8", + EtcGmtPlus9 => "Etc/GMT+9", + EtcGmtMinus0 => "Etc/GMT-0", + EtcGmtMinus1 => "Etc/GMT-1", + EtcGmtMinus10 => "Etc/GMT-10", + EtcGmtMinus11 => "Etc/GMT-11", + EtcGmtMinus12 => "Etc/GMT-12", + EtcGmtMinus13 => "Etc/GMT-13", + EtcGmtMinus14 => "Etc/GMT-14", + EtcGmtMinus2 => "Etc/GMT-2", + EtcGmtMinus3 => "Etc/GMT-3", + EtcGmtMinus4 => "Etc/GMT-4", + EtcGmtMinus5 => "Etc/GMT-5", + EtcGmtMinus6 => "Etc/GMT-6", + EtcGmtMinus7 => "Etc/GMT-7", + EtcGmtMinus8 => "Etc/GMT-8", + EtcGmtMinus9 => "Etc/GMT-9", + EtcGmt0 => "Etc/GMT0", + EtcGreenwich => "Etc/Greenwich", + EtcUct => "Etc/UCT", + EtcUtc => "Etc/UTC", + EtcUniversal => "Etc/Universal", + EtcZulu => "Etc/Zulu", + EuropeAmsterdam => "Europe/Amsterdam", + EuropeAndorra => "Europe/Andorra", + EuropeAstrakhan => "Europe/Astrakhan", + EuropeAthens => "Europe/Athens", + EuropeBelfast => "Europe/Belfast", + EuropeBelgrade => "Europe/Belgrade", + EuropeBerlin => "Europe/Berlin", + EuropeBratislava => "Europe/Bratislava", + EuropeBrussels => "Europe/Brussels", + EuropeBucharest => "Europe/Bucharest", + EuropeBudapest => "Europe/Budapest", + EuropeBusingen => "Europe/Busingen", + EuropeChisinau => "Europe/Chisinau", + EuropeCopenhagen => "Europe/Copenhagen", + EuropeDublin => "Europe/Dublin", + EuropeGibraltar => "Europe/Gibraltar", + EuropeGuernsey => "Europe/Guernsey", + EuropeHelsinki => "Europe/Helsinki", + EuropeIsleOfMan => "Europe/Isle_of_Man", + EuropeIstanbul => "Europe/Istanbul", + EuropeJersey => "Europe/Jersey", + EuropeKaliningrad => "Europe/Kaliningrad", + EuropeKiev => "Europe/Kiev", + EuropeKirov => "Europe/Kirov", + EuropeKyiv => "Europe/Kyiv", + EuropeLisbon => "Europe/Lisbon", + EuropeLjubljana => "Europe/Ljubljana", + EuropeLondon => "Europe/London", + EuropeLuxembourg => "Europe/Luxembourg", + EuropeMadrid => "Europe/Madrid", + EuropeMalta => "Europe/Malta", + EuropeMariehamn => "Europe/Mariehamn", + EuropeMinsk => "Europe/Minsk", + EuropeMonaco => "Europe/Monaco", + EuropeMoscow => "Europe/Moscow", + EuropeNicosia => "Europe/Nicosia", + EuropeOslo => "Europe/Oslo", + EuropeParis => "Europe/Paris", + EuropePodgorica => "Europe/Podgorica", + EuropePrague => "Europe/Prague", + EuropeRiga => "Europe/Riga", + EuropeRome => "Europe/Rome", + EuropeSamara => "Europe/Samara", + EuropeSanMarino => "Europe/San_Marino", + EuropeSarajevo => "Europe/Sarajevo", + EuropeSaratov => "Europe/Saratov", + EuropeSimferopol => "Europe/Simferopol", + EuropeSkopje => "Europe/Skopje", + EuropeSofia => "Europe/Sofia", + EuropeStockholm => "Europe/Stockholm", + EuropeTallinn => "Europe/Tallinn", + EuropeTirane => "Europe/Tirane", + EuropeTiraspol => "Europe/Tiraspol", + EuropeUlyanovsk => "Europe/Ulyanovsk", + EuropeUzhgorod => "Europe/Uzhgorod", + EuropeVaduz => "Europe/Vaduz", + EuropeVatican => "Europe/Vatican", + EuropeVienna => "Europe/Vienna", + EuropeVilnius => "Europe/Vilnius", + EuropeVolgograd => "Europe/Volgograd", + EuropeWarsaw => "Europe/Warsaw", + EuropeZagreb => "Europe/Zagreb", + EuropeZaporozhye => "Europe/Zaporozhye", + EuropeZurich => "Europe/Zurich", + Factory => "Factory", + Gb => "GB", + GbMinusEire => "GB-Eire", + Gmt => "GMT", + GmtPlus0 => "GMT+0", + GmtMinus0 => "GMT-0", + Gmt0 => "GMT0", + Greenwich => "Greenwich", + Hst => "HST", + Hongkong => "Hongkong", + Iceland => "Iceland", + IndianAntananarivo => "Indian/Antananarivo", + IndianChagos => "Indian/Chagos", + IndianChristmas => "Indian/Christmas", + IndianCocos => "Indian/Cocos", + IndianComoro => "Indian/Comoro", + IndianKerguelen => "Indian/Kerguelen", + IndianMahe => "Indian/Mahe", + IndianMaldives => "Indian/Maldives", + IndianMauritius => "Indian/Mauritius", + IndianMayotte => "Indian/Mayotte", + IndianReunion => "Indian/Reunion", + Iran => "Iran", + Israel => "Israel", + Jamaica => "Jamaica", + Japan => "Japan", + Kwajalein => "Kwajalein", + Libya => "Libya", + Met => "MET", + Mst => "MST", + Mst7mdt => "MST7MDT", + MexicoBajaNorte => "Mexico/BajaNorte", + MexicoBajaSur => "Mexico/BajaSur", + MexicoGeneral => "Mexico/General", + Nz => "NZ", + NzMinusChat => "NZ-CHAT", + Navajo => "Navajo", + Prc => "PRC", + Pst8pdt => "PST8PDT", + PacificApia => "Pacific/Apia", + PacificAuckland => "Pacific/Auckland", + PacificBougainville => "Pacific/Bougainville", + PacificChatham => "Pacific/Chatham", + PacificChuuk => "Pacific/Chuuk", + PacificEaster => "Pacific/Easter", + PacificEfate => "Pacific/Efate", + PacificEnderbury => "Pacific/Enderbury", + PacificFakaofo => "Pacific/Fakaofo", + PacificFiji => "Pacific/Fiji", + PacificFunafuti => "Pacific/Funafuti", + PacificGalapagos => "Pacific/Galapagos", + PacificGambier => "Pacific/Gambier", + PacificGuadalcanal => "Pacific/Guadalcanal", + PacificGuam => "Pacific/Guam", + PacificHonolulu => "Pacific/Honolulu", + PacificJohnston => "Pacific/Johnston", + PacificKanton => "Pacific/Kanton", + PacificKiritimati => "Pacific/Kiritimati", + PacificKosrae => "Pacific/Kosrae", + PacificKwajalein => "Pacific/Kwajalein", + PacificMajuro => "Pacific/Majuro", + PacificMarquesas => "Pacific/Marquesas", + PacificMidway => "Pacific/Midway", + PacificNauru => "Pacific/Nauru", + PacificNiue => "Pacific/Niue", + PacificNorfolk => "Pacific/Norfolk", + PacificNoumea => "Pacific/Noumea", + PacificPagoPago => "Pacific/Pago_Pago", + PacificPalau => "Pacific/Palau", + PacificPitcairn => "Pacific/Pitcairn", + PacificPohnpei => "Pacific/Pohnpei", + PacificPonape => "Pacific/Ponape", + PacificPortMoresby => "Pacific/Port_Moresby", + PacificRarotonga => "Pacific/Rarotonga", + PacificSaipan => "Pacific/Saipan", + PacificSamoa => "Pacific/Samoa", + PacificTahiti => "Pacific/Tahiti", + PacificTarawa => "Pacific/Tarawa", + PacificTongatapu => "Pacific/Tongatapu", + PacificTruk => "Pacific/Truk", + PacificWake => "Pacific/Wake", + PacificWallis => "Pacific/Wallis", + PacificYap => "Pacific/Yap", + Poland => "Poland", + Portugal => "Portugal", + Roc => "ROC", + Rok => "ROK", + Singapore => "Singapore", + Turkey => "Turkey", + Uct => "UCT", + UsAlaska => "US/Alaska", + UsAleutian => "US/Aleutian", + UsArizona => "US/Arizona", + UsCentral => "US/Central", + UsEastMinusIndiana => "US/East-Indiana", + UsEastern => "US/Eastern", + UsHawaii => "US/Hawaii", + UsIndianaMinusStarke => "US/Indiana-Starke", + UsMichigan => "US/Michigan", + UsMountain => "US/Mountain", + UsPacific => "US/Pacific", + UsPacificMinusNew => "US/Pacific-New", + UsSamoa => "US/Samoa", + Utc => "UTC", + Universal => "Universal", + WMinusSu => "W-SU", + Wet => "WET", + Zulu => "Zulu", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateReportingReportRunParametersTimezone { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateReportingReportRunParametersTimezone::*; + match s { + "Africa/Abidjan" => Ok(AfricaAbidjan), + "Africa/Accra" => Ok(AfricaAccra), + "Africa/Addis_Ababa" => Ok(AfricaAddisAbaba), + "Africa/Algiers" => Ok(AfricaAlgiers), + "Africa/Asmara" => Ok(AfricaAsmara), + "Africa/Asmera" => Ok(AfricaAsmera), + "Africa/Bamako" => Ok(AfricaBamako), + "Africa/Bangui" => Ok(AfricaBangui), + "Africa/Banjul" => Ok(AfricaBanjul), + "Africa/Bissau" => Ok(AfricaBissau), + "Africa/Blantyre" => Ok(AfricaBlantyre), + "Africa/Brazzaville" => Ok(AfricaBrazzaville), + "Africa/Bujumbura" => Ok(AfricaBujumbura), + "Africa/Cairo" => Ok(AfricaCairo), + "Africa/Casablanca" => Ok(AfricaCasablanca), + "Africa/Ceuta" => Ok(AfricaCeuta), + "Africa/Conakry" => Ok(AfricaConakry), + "Africa/Dakar" => Ok(AfricaDakar), + "Africa/Dar_es_Salaam" => Ok(AfricaDarEsSalaam), + "Africa/Djibouti" => Ok(AfricaDjibouti), + "Africa/Douala" => Ok(AfricaDouala), + "Africa/El_Aaiun" => Ok(AfricaElAaiun), + "Africa/Freetown" => Ok(AfricaFreetown), + "Africa/Gaborone" => Ok(AfricaGaborone), + "Africa/Harare" => Ok(AfricaHarare), + "Africa/Johannesburg" => Ok(AfricaJohannesburg), + "Africa/Juba" => Ok(AfricaJuba), + "Africa/Kampala" => Ok(AfricaKampala), + "Africa/Khartoum" => Ok(AfricaKhartoum), + "Africa/Kigali" => Ok(AfricaKigali), + "Africa/Kinshasa" => Ok(AfricaKinshasa), + "Africa/Lagos" => Ok(AfricaLagos), + "Africa/Libreville" => Ok(AfricaLibreville), + "Africa/Lome" => Ok(AfricaLome), + "Africa/Luanda" => Ok(AfricaLuanda), + "Africa/Lubumbashi" => Ok(AfricaLubumbashi), + "Africa/Lusaka" => Ok(AfricaLusaka), + "Africa/Malabo" => Ok(AfricaMalabo), + "Africa/Maputo" => Ok(AfricaMaputo), + "Africa/Maseru" => Ok(AfricaMaseru), + "Africa/Mbabane" => Ok(AfricaMbabane), + "Africa/Mogadishu" => Ok(AfricaMogadishu), + "Africa/Monrovia" => Ok(AfricaMonrovia), + "Africa/Nairobi" => Ok(AfricaNairobi), + "Africa/Ndjamena" => Ok(AfricaNdjamena), + "Africa/Niamey" => Ok(AfricaNiamey), + "Africa/Nouakchott" => Ok(AfricaNouakchott), + "Africa/Ouagadougou" => Ok(AfricaOuagadougou), + "Africa/Porto-Novo" => Ok(AfricaPortoMinusNovo), + "Africa/Sao_Tome" => Ok(AfricaSaoTome), + "Africa/Timbuktu" => Ok(AfricaTimbuktu), + "Africa/Tripoli" => Ok(AfricaTripoli), + "Africa/Tunis" => Ok(AfricaTunis), + "Africa/Windhoek" => Ok(AfricaWindhoek), + "America/Adak" => Ok(AmericaAdak), + "America/Anchorage" => Ok(AmericaAnchorage), + "America/Anguilla" => Ok(AmericaAnguilla), + "America/Antigua" => Ok(AmericaAntigua), + "America/Araguaina" => Ok(AmericaAraguaina), + "America/Argentina/Buenos_Aires" => Ok(AmericaArgentinaBuenosAires), + "America/Argentina/Catamarca" => Ok(AmericaArgentinaCatamarca), + "America/Argentina/ComodRivadavia" => Ok(AmericaArgentinaComodRivadavia), + "America/Argentina/Cordoba" => Ok(AmericaArgentinaCordoba), + "America/Argentina/Jujuy" => Ok(AmericaArgentinaJujuy), + "America/Argentina/La_Rioja" => Ok(AmericaArgentinaLaRioja), + "America/Argentina/Mendoza" => Ok(AmericaArgentinaMendoza), + "America/Argentina/Rio_Gallegos" => Ok(AmericaArgentinaRioGallegos), + "America/Argentina/Salta" => Ok(AmericaArgentinaSalta), + "America/Argentina/San_Juan" => Ok(AmericaArgentinaSanJuan), + "America/Argentina/San_Luis" => Ok(AmericaArgentinaSanLuis), + "America/Argentina/Tucuman" => Ok(AmericaArgentinaTucuman), + "America/Argentina/Ushuaia" => Ok(AmericaArgentinaUshuaia), + "America/Aruba" => Ok(AmericaAruba), + "America/Asuncion" => Ok(AmericaAsuncion), + "America/Atikokan" => Ok(AmericaAtikokan), + "America/Atka" => Ok(AmericaAtka), + "America/Bahia" => Ok(AmericaBahia), + "America/Bahia_Banderas" => Ok(AmericaBahiaBanderas), + "America/Barbados" => Ok(AmericaBarbados), + "America/Belem" => Ok(AmericaBelem), + "America/Belize" => Ok(AmericaBelize), + "America/Blanc-Sablon" => Ok(AmericaBlancMinusSablon), + "America/Boa_Vista" => Ok(AmericaBoaVista), + "America/Bogota" => Ok(AmericaBogota), + "America/Boise" => Ok(AmericaBoise), + "America/Buenos_Aires" => Ok(AmericaBuenosAires), + "America/Cambridge_Bay" => Ok(AmericaCambridgeBay), + "America/Campo_Grande" => Ok(AmericaCampoGrande), + "America/Cancun" => Ok(AmericaCancun), + "America/Caracas" => Ok(AmericaCaracas), + "America/Catamarca" => Ok(AmericaCatamarca), + "America/Cayenne" => Ok(AmericaCayenne), + "America/Cayman" => Ok(AmericaCayman), + "America/Chicago" => Ok(AmericaChicago), + "America/Chihuahua" => Ok(AmericaChihuahua), + "America/Ciudad_Juarez" => Ok(AmericaCiudadJuarez), + "America/Coral_Harbour" => Ok(AmericaCoralHarbour), + "America/Cordoba" => Ok(AmericaCordoba), + "America/Costa_Rica" => Ok(AmericaCostaRica), + "America/Creston" => Ok(AmericaCreston), + "America/Cuiaba" => Ok(AmericaCuiaba), + "America/Curacao" => Ok(AmericaCuracao), + "America/Danmarkshavn" => Ok(AmericaDanmarkshavn), + "America/Dawson" => Ok(AmericaDawson), + "America/Dawson_Creek" => Ok(AmericaDawsonCreek), + "America/Denver" => Ok(AmericaDenver), + "America/Detroit" => Ok(AmericaDetroit), + "America/Dominica" => Ok(AmericaDominica), + "America/Edmonton" => Ok(AmericaEdmonton), + "America/Eirunepe" => Ok(AmericaEirunepe), + "America/El_Salvador" => Ok(AmericaElSalvador), + "America/Ensenada" => Ok(AmericaEnsenada), + "America/Fort_Nelson" => Ok(AmericaFortNelson), + "America/Fort_Wayne" => Ok(AmericaFortWayne), + "America/Fortaleza" => Ok(AmericaFortaleza), + "America/Glace_Bay" => Ok(AmericaGlaceBay), + "America/Godthab" => Ok(AmericaGodthab), + "America/Goose_Bay" => Ok(AmericaGooseBay), + "America/Grand_Turk" => Ok(AmericaGrandTurk), + "America/Grenada" => Ok(AmericaGrenada), + "America/Guadeloupe" => Ok(AmericaGuadeloupe), + "America/Guatemala" => Ok(AmericaGuatemala), + "America/Guayaquil" => Ok(AmericaGuayaquil), + "America/Guyana" => Ok(AmericaGuyana), + "America/Halifax" => Ok(AmericaHalifax), + "America/Havana" => Ok(AmericaHavana), + "America/Hermosillo" => Ok(AmericaHermosillo), + "America/Indiana/Indianapolis" => Ok(AmericaIndianaIndianapolis), + "America/Indiana/Knox" => Ok(AmericaIndianaKnox), + "America/Indiana/Marengo" => Ok(AmericaIndianaMarengo), + "America/Indiana/Petersburg" => Ok(AmericaIndianaPetersburg), + "America/Indiana/Tell_City" => Ok(AmericaIndianaTellCity), + "America/Indiana/Vevay" => Ok(AmericaIndianaVevay), + "America/Indiana/Vincennes" => Ok(AmericaIndianaVincennes), + "America/Indiana/Winamac" => Ok(AmericaIndianaWinamac), + "America/Indianapolis" => Ok(AmericaIndianapolis), + "America/Inuvik" => Ok(AmericaInuvik), + "America/Iqaluit" => Ok(AmericaIqaluit), + "America/Jamaica" => Ok(AmericaJamaica), + "America/Jujuy" => Ok(AmericaJujuy), + "America/Juneau" => Ok(AmericaJuneau), + "America/Kentucky/Louisville" => Ok(AmericaKentuckyLouisville), + "America/Kentucky/Monticello" => Ok(AmericaKentuckyMonticello), + "America/Knox_IN" => Ok(AmericaKnoxIn), + "America/Kralendijk" => Ok(AmericaKralendijk), + "America/La_Paz" => Ok(AmericaLaPaz), + "America/Lima" => Ok(AmericaLima), + "America/Los_Angeles" => Ok(AmericaLosAngeles), + "America/Louisville" => Ok(AmericaLouisville), + "America/Lower_Princes" => Ok(AmericaLowerPrinces), + "America/Maceio" => Ok(AmericaMaceio), + "America/Managua" => Ok(AmericaManagua), + "America/Manaus" => Ok(AmericaManaus), + "America/Marigot" => Ok(AmericaMarigot), + "America/Martinique" => Ok(AmericaMartinique), + "America/Matamoros" => Ok(AmericaMatamoros), + "America/Mazatlan" => Ok(AmericaMazatlan), + "America/Mendoza" => Ok(AmericaMendoza), + "America/Menominee" => Ok(AmericaMenominee), + "America/Merida" => Ok(AmericaMerida), + "America/Metlakatla" => Ok(AmericaMetlakatla), + "America/Mexico_City" => Ok(AmericaMexicoCity), + "America/Miquelon" => Ok(AmericaMiquelon), + "America/Moncton" => Ok(AmericaMoncton), + "America/Monterrey" => Ok(AmericaMonterrey), + "America/Montevideo" => Ok(AmericaMontevideo), + "America/Montreal" => Ok(AmericaMontreal), + "America/Montserrat" => Ok(AmericaMontserrat), + "America/Nassau" => Ok(AmericaNassau), + "America/New_York" => Ok(AmericaNewYork), + "America/Nipigon" => Ok(AmericaNipigon), + "America/Nome" => Ok(AmericaNome), + "America/Noronha" => Ok(AmericaNoronha), + "America/North_Dakota/Beulah" => Ok(AmericaNorthDakotaBeulah), + "America/North_Dakota/Center" => Ok(AmericaNorthDakotaCenter), + "America/North_Dakota/New_Salem" => Ok(AmericaNorthDakotaNewSalem), + "America/Nuuk" => Ok(AmericaNuuk), + "America/Ojinaga" => Ok(AmericaOjinaga), + "America/Panama" => Ok(AmericaPanama), + "America/Pangnirtung" => Ok(AmericaPangnirtung), + "America/Paramaribo" => Ok(AmericaParamaribo), + "America/Phoenix" => Ok(AmericaPhoenix), + "America/Port-au-Prince" => Ok(AmericaPortMinusauMinusPrince), + "America/Port_of_Spain" => Ok(AmericaPortOfSpain), + "America/Porto_Acre" => Ok(AmericaPortoAcre), + "America/Porto_Velho" => Ok(AmericaPortoVelho), + "America/Puerto_Rico" => Ok(AmericaPuertoRico), + "America/Punta_Arenas" => Ok(AmericaPuntaArenas), + "America/Rainy_River" => Ok(AmericaRainyRiver), + "America/Rankin_Inlet" => Ok(AmericaRankinInlet), + "America/Recife" => Ok(AmericaRecife), + "America/Regina" => Ok(AmericaRegina), + "America/Resolute" => Ok(AmericaResolute), + "America/Rio_Branco" => Ok(AmericaRioBranco), + "America/Rosario" => Ok(AmericaRosario), + "America/Santa_Isabel" => Ok(AmericaSantaIsabel), + "America/Santarem" => Ok(AmericaSantarem), + "America/Santiago" => Ok(AmericaSantiago), + "America/Santo_Domingo" => Ok(AmericaSantoDomingo), + "America/Sao_Paulo" => Ok(AmericaSaoPaulo), + "America/Scoresbysund" => Ok(AmericaScoresbysund), + "America/Shiprock" => Ok(AmericaShiprock), + "America/Sitka" => Ok(AmericaSitka), + "America/St_Barthelemy" => Ok(AmericaStBarthelemy), + "America/St_Johns" => Ok(AmericaStJohns), + "America/St_Kitts" => Ok(AmericaStKitts), + "America/St_Lucia" => Ok(AmericaStLucia), + "America/St_Thomas" => Ok(AmericaStThomas), + "America/St_Vincent" => Ok(AmericaStVincent), + "America/Swift_Current" => Ok(AmericaSwiftCurrent), + "America/Tegucigalpa" => Ok(AmericaTegucigalpa), + "America/Thule" => Ok(AmericaThule), + "America/Thunder_Bay" => Ok(AmericaThunderBay), + "America/Tijuana" => Ok(AmericaTijuana), + "America/Toronto" => Ok(AmericaToronto), + "America/Tortola" => Ok(AmericaTortola), + "America/Vancouver" => Ok(AmericaVancouver), + "America/Virgin" => Ok(AmericaVirgin), + "America/Whitehorse" => Ok(AmericaWhitehorse), + "America/Winnipeg" => Ok(AmericaWinnipeg), + "America/Yakutat" => Ok(AmericaYakutat), + "America/Yellowknife" => Ok(AmericaYellowknife), + "Antarctica/Casey" => Ok(AntarcticaCasey), + "Antarctica/Davis" => Ok(AntarcticaDavis), + "Antarctica/DumontDUrville" => Ok(AntarcticaDumontDUrville), + "Antarctica/Macquarie" => Ok(AntarcticaMacquarie), + "Antarctica/Mawson" => Ok(AntarcticaMawson), + "Antarctica/McMurdo" => Ok(AntarcticaMcMurdo), + "Antarctica/Palmer" => Ok(AntarcticaPalmer), + "Antarctica/Rothera" => Ok(AntarcticaRothera), + "Antarctica/South_Pole" => Ok(AntarcticaSouthPole), + "Antarctica/Syowa" => Ok(AntarcticaSyowa), + "Antarctica/Troll" => Ok(AntarcticaTroll), + "Antarctica/Vostok" => Ok(AntarcticaVostok), + "Arctic/Longyearbyen" => Ok(ArcticLongyearbyen), + "Asia/Aden" => Ok(AsiaAden), + "Asia/Almaty" => Ok(AsiaAlmaty), + "Asia/Amman" => Ok(AsiaAmman), + "Asia/Anadyr" => Ok(AsiaAnadyr), + "Asia/Aqtau" => Ok(AsiaAqtau), + "Asia/Aqtobe" => Ok(AsiaAqtobe), + "Asia/Ashgabat" => Ok(AsiaAshgabat), + "Asia/Ashkhabad" => Ok(AsiaAshkhabad), + "Asia/Atyrau" => Ok(AsiaAtyrau), + "Asia/Baghdad" => Ok(AsiaBaghdad), + "Asia/Bahrain" => Ok(AsiaBahrain), + "Asia/Baku" => Ok(AsiaBaku), + "Asia/Bangkok" => Ok(AsiaBangkok), + "Asia/Barnaul" => Ok(AsiaBarnaul), + "Asia/Beirut" => Ok(AsiaBeirut), + "Asia/Bishkek" => Ok(AsiaBishkek), + "Asia/Brunei" => Ok(AsiaBrunei), + "Asia/Calcutta" => Ok(AsiaCalcutta), + "Asia/Chita" => Ok(AsiaChita), + "Asia/Choibalsan" => Ok(AsiaChoibalsan), + "Asia/Chongqing" => Ok(AsiaChongqing), + "Asia/Chungking" => Ok(AsiaChungking), + "Asia/Colombo" => Ok(AsiaColombo), + "Asia/Dacca" => Ok(AsiaDacca), + "Asia/Damascus" => Ok(AsiaDamascus), + "Asia/Dhaka" => Ok(AsiaDhaka), + "Asia/Dili" => Ok(AsiaDili), + "Asia/Dubai" => Ok(AsiaDubai), + "Asia/Dushanbe" => Ok(AsiaDushanbe), + "Asia/Famagusta" => Ok(AsiaFamagusta), + "Asia/Gaza" => Ok(AsiaGaza), + "Asia/Harbin" => Ok(AsiaHarbin), + "Asia/Hebron" => Ok(AsiaHebron), + "Asia/Ho_Chi_Minh" => Ok(AsiaHoChiMinh), + "Asia/Hong_Kong" => Ok(AsiaHongKong), + "Asia/Hovd" => Ok(AsiaHovd), + "Asia/Irkutsk" => Ok(AsiaIrkutsk), + "Asia/Istanbul" => Ok(AsiaIstanbul), + "Asia/Jakarta" => Ok(AsiaJakarta), + "Asia/Jayapura" => Ok(AsiaJayapura), + "Asia/Jerusalem" => Ok(AsiaJerusalem), + "Asia/Kabul" => Ok(AsiaKabul), + "Asia/Kamchatka" => Ok(AsiaKamchatka), + "Asia/Karachi" => Ok(AsiaKarachi), + "Asia/Kashgar" => Ok(AsiaKashgar), + "Asia/Kathmandu" => Ok(AsiaKathmandu), + "Asia/Katmandu" => Ok(AsiaKatmandu), + "Asia/Khandyga" => Ok(AsiaKhandyga), + "Asia/Kolkata" => Ok(AsiaKolkata), + "Asia/Krasnoyarsk" => Ok(AsiaKrasnoyarsk), + "Asia/Kuala_Lumpur" => Ok(AsiaKualaLumpur), + "Asia/Kuching" => Ok(AsiaKuching), + "Asia/Kuwait" => Ok(AsiaKuwait), + "Asia/Macao" => Ok(AsiaMacao), + "Asia/Macau" => Ok(AsiaMacau), + "Asia/Magadan" => Ok(AsiaMagadan), + "Asia/Makassar" => Ok(AsiaMakassar), + "Asia/Manila" => Ok(AsiaManila), + "Asia/Muscat" => Ok(AsiaMuscat), + "Asia/Nicosia" => Ok(AsiaNicosia), + "Asia/Novokuznetsk" => Ok(AsiaNovokuznetsk), + "Asia/Novosibirsk" => Ok(AsiaNovosibirsk), + "Asia/Omsk" => Ok(AsiaOmsk), + "Asia/Oral" => Ok(AsiaOral), + "Asia/Phnom_Penh" => Ok(AsiaPhnomPenh), + "Asia/Pontianak" => Ok(AsiaPontianak), + "Asia/Pyongyang" => Ok(AsiaPyongyang), + "Asia/Qatar" => Ok(AsiaQatar), + "Asia/Qostanay" => Ok(AsiaQostanay), + "Asia/Qyzylorda" => Ok(AsiaQyzylorda), + "Asia/Rangoon" => Ok(AsiaRangoon), + "Asia/Riyadh" => Ok(AsiaRiyadh), + "Asia/Saigon" => Ok(AsiaSaigon), + "Asia/Sakhalin" => Ok(AsiaSakhalin), + "Asia/Samarkand" => Ok(AsiaSamarkand), + "Asia/Seoul" => Ok(AsiaSeoul), + "Asia/Shanghai" => Ok(AsiaShanghai), + "Asia/Singapore" => Ok(AsiaSingapore), + "Asia/Srednekolymsk" => Ok(AsiaSrednekolymsk), + "Asia/Taipei" => Ok(AsiaTaipei), + "Asia/Tashkent" => Ok(AsiaTashkent), + "Asia/Tbilisi" => Ok(AsiaTbilisi), + "Asia/Tehran" => Ok(AsiaTehran), + "Asia/Tel_Aviv" => Ok(AsiaTelAviv), + "Asia/Thimbu" => Ok(AsiaThimbu), + "Asia/Thimphu" => Ok(AsiaThimphu), + "Asia/Tokyo" => Ok(AsiaTokyo), + "Asia/Tomsk" => Ok(AsiaTomsk), + "Asia/Ujung_Pandang" => Ok(AsiaUjungPandang), + "Asia/Ulaanbaatar" => Ok(AsiaUlaanbaatar), + "Asia/Ulan_Bator" => Ok(AsiaUlanBator), + "Asia/Urumqi" => Ok(AsiaUrumqi), + "Asia/Ust-Nera" => Ok(AsiaUstMinusNera), + "Asia/Vientiane" => Ok(AsiaVientiane), + "Asia/Vladivostok" => Ok(AsiaVladivostok), + "Asia/Yakutsk" => Ok(AsiaYakutsk), + "Asia/Yangon" => Ok(AsiaYangon), + "Asia/Yekaterinburg" => Ok(AsiaYekaterinburg), + "Asia/Yerevan" => Ok(AsiaYerevan), + "Atlantic/Azores" => Ok(AtlanticAzores), + "Atlantic/Bermuda" => Ok(AtlanticBermuda), + "Atlantic/Canary" => Ok(AtlanticCanary), + "Atlantic/Cape_Verde" => Ok(AtlanticCapeVerde), + "Atlantic/Faeroe" => Ok(AtlanticFaeroe), + "Atlantic/Faroe" => Ok(AtlanticFaroe), + "Atlantic/Jan_Mayen" => Ok(AtlanticJanMayen), + "Atlantic/Madeira" => Ok(AtlanticMadeira), + "Atlantic/Reykjavik" => Ok(AtlanticReykjavik), + "Atlantic/South_Georgia" => Ok(AtlanticSouthGeorgia), + "Atlantic/St_Helena" => Ok(AtlanticStHelena), + "Atlantic/Stanley" => Ok(AtlanticStanley), + "Australia/ACT" => Ok(AustraliaAct), + "Australia/Adelaide" => Ok(AustraliaAdelaide), + "Australia/Brisbane" => Ok(AustraliaBrisbane), + "Australia/Broken_Hill" => Ok(AustraliaBrokenHill), + "Australia/Canberra" => Ok(AustraliaCanberra), + "Australia/Currie" => Ok(AustraliaCurrie), + "Australia/Darwin" => Ok(AustraliaDarwin), + "Australia/Eucla" => Ok(AustraliaEucla), + "Australia/Hobart" => Ok(AustraliaHobart), + "Australia/LHI" => Ok(AustraliaLhi), + "Australia/Lindeman" => Ok(AustraliaLindeman), + "Australia/Lord_Howe" => Ok(AustraliaLordHowe), + "Australia/Melbourne" => Ok(AustraliaMelbourne), + "Australia/NSW" => Ok(AustraliaNsw), + "Australia/North" => Ok(AustraliaNorth), + "Australia/Perth" => Ok(AustraliaPerth), + "Australia/Queensland" => Ok(AustraliaQueensland), + "Australia/South" => Ok(AustraliaSouth), + "Australia/Sydney" => Ok(AustraliaSydney), + "Australia/Tasmania" => Ok(AustraliaTasmania), + "Australia/Victoria" => Ok(AustraliaVictoria), + "Australia/West" => Ok(AustraliaWest), + "Australia/Yancowinna" => Ok(AustraliaYancowinna), + "Brazil/Acre" => Ok(BrazilAcre), + "Brazil/DeNoronha" => Ok(BrazilDeNoronha), + "Brazil/East" => Ok(BrazilEast), + "Brazil/West" => Ok(BrazilWest), + "CET" => Ok(Cet), + "CST6CDT" => Ok(Cst6cdt), + "Canada/Atlantic" => Ok(CanadaAtlantic), + "Canada/Central" => Ok(CanadaCentral), + "Canada/Eastern" => Ok(CanadaEastern), + "Canada/Mountain" => Ok(CanadaMountain), + "Canada/Newfoundland" => Ok(CanadaNewfoundland), + "Canada/Pacific" => Ok(CanadaPacific), + "Canada/Saskatchewan" => Ok(CanadaSaskatchewan), + "Canada/Yukon" => Ok(CanadaYukon), + "Chile/Continental" => Ok(ChileContinental), + "Chile/EasterIsland" => Ok(ChileEasterIsland), + "Cuba" => Ok(Cuba), + "EET" => Ok(Eet), + "EST" => Ok(Est), + "EST5EDT" => Ok(Est5edt), + "Egypt" => Ok(Egypt), + "Eire" => Ok(Eire), + "Etc/GMT" => Ok(EtcGmt), + "Etc/GMT+0" => Ok(EtcGmtPlus0), + "Etc/GMT+1" => Ok(EtcGmtPlus1), + "Etc/GMT+10" => Ok(EtcGmtPlus10), + "Etc/GMT+11" => Ok(EtcGmtPlus11), + "Etc/GMT+12" => Ok(EtcGmtPlus12), + "Etc/GMT+2" => Ok(EtcGmtPlus2), + "Etc/GMT+3" => Ok(EtcGmtPlus3), + "Etc/GMT+4" => Ok(EtcGmtPlus4), + "Etc/GMT+5" => Ok(EtcGmtPlus5), + "Etc/GMT+6" => Ok(EtcGmtPlus6), + "Etc/GMT+7" => Ok(EtcGmtPlus7), + "Etc/GMT+8" => Ok(EtcGmtPlus8), + "Etc/GMT+9" => Ok(EtcGmtPlus9), + "Etc/GMT-0" => Ok(EtcGmtMinus0), + "Etc/GMT-1" => Ok(EtcGmtMinus1), + "Etc/GMT-10" => Ok(EtcGmtMinus10), + "Etc/GMT-11" => Ok(EtcGmtMinus11), + "Etc/GMT-12" => Ok(EtcGmtMinus12), + "Etc/GMT-13" => Ok(EtcGmtMinus13), + "Etc/GMT-14" => Ok(EtcGmtMinus14), + "Etc/GMT-2" => Ok(EtcGmtMinus2), + "Etc/GMT-3" => Ok(EtcGmtMinus3), + "Etc/GMT-4" => Ok(EtcGmtMinus4), + "Etc/GMT-5" => Ok(EtcGmtMinus5), + "Etc/GMT-6" => Ok(EtcGmtMinus6), + "Etc/GMT-7" => Ok(EtcGmtMinus7), + "Etc/GMT-8" => Ok(EtcGmtMinus8), + "Etc/GMT-9" => Ok(EtcGmtMinus9), + "Etc/GMT0" => Ok(EtcGmt0), + "Etc/Greenwich" => Ok(EtcGreenwich), + "Etc/UCT" => Ok(EtcUct), + "Etc/UTC" => Ok(EtcUtc), + "Etc/Universal" => Ok(EtcUniversal), + "Etc/Zulu" => Ok(EtcZulu), + "Europe/Amsterdam" => Ok(EuropeAmsterdam), + "Europe/Andorra" => Ok(EuropeAndorra), + "Europe/Astrakhan" => Ok(EuropeAstrakhan), + "Europe/Athens" => Ok(EuropeAthens), + "Europe/Belfast" => Ok(EuropeBelfast), + "Europe/Belgrade" => Ok(EuropeBelgrade), + "Europe/Berlin" => Ok(EuropeBerlin), + "Europe/Bratislava" => Ok(EuropeBratislava), + "Europe/Brussels" => Ok(EuropeBrussels), + "Europe/Bucharest" => Ok(EuropeBucharest), + "Europe/Budapest" => Ok(EuropeBudapest), + "Europe/Busingen" => Ok(EuropeBusingen), + "Europe/Chisinau" => Ok(EuropeChisinau), + "Europe/Copenhagen" => Ok(EuropeCopenhagen), + "Europe/Dublin" => Ok(EuropeDublin), + "Europe/Gibraltar" => Ok(EuropeGibraltar), + "Europe/Guernsey" => Ok(EuropeGuernsey), + "Europe/Helsinki" => Ok(EuropeHelsinki), + "Europe/Isle_of_Man" => Ok(EuropeIsleOfMan), + "Europe/Istanbul" => Ok(EuropeIstanbul), + "Europe/Jersey" => Ok(EuropeJersey), + "Europe/Kaliningrad" => Ok(EuropeKaliningrad), + "Europe/Kiev" => Ok(EuropeKiev), + "Europe/Kirov" => Ok(EuropeKirov), + "Europe/Kyiv" => Ok(EuropeKyiv), + "Europe/Lisbon" => Ok(EuropeLisbon), + "Europe/Ljubljana" => Ok(EuropeLjubljana), + "Europe/London" => Ok(EuropeLondon), + "Europe/Luxembourg" => Ok(EuropeLuxembourg), + "Europe/Madrid" => Ok(EuropeMadrid), + "Europe/Malta" => Ok(EuropeMalta), + "Europe/Mariehamn" => Ok(EuropeMariehamn), + "Europe/Minsk" => Ok(EuropeMinsk), + "Europe/Monaco" => Ok(EuropeMonaco), + "Europe/Moscow" => Ok(EuropeMoscow), + "Europe/Nicosia" => Ok(EuropeNicosia), + "Europe/Oslo" => Ok(EuropeOslo), + "Europe/Paris" => Ok(EuropeParis), + "Europe/Podgorica" => Ok(EuropePodgorica), + "Europe/Prague" => Ok(EuropePrague), + "Europe/Riga" => Ok(EuropeRiga), + "Europe/Rome" => Ok(EuropeRome), + "Europe/Samara" => Ok(EuropeSamara), + "Europe/San_Marino" => Ok(EuropeSanMarino), + "Europe/Sarajevo" => Ok(EuropeSarajevo), + "Europe/Saratov" => Ok(EuropeSaratov), + "Europe/Simferopol" => Ok(EuropeSimferopol), + "Europe/Skopje" => Ok(EuropeSkopje), + "Europe/Sofia" => Ok(EuropeSofia), + "Europe/Stockholm" => Ok(EuropeStockholm), + "Europe/Tallinn" => Ok(EuropeTallinn), + "Europe/Tirane" => Ok(EuropeTirane), + "Europe/Tiraspol" => Ok(EuropeTiraspol), + "Europe/Ulyanovsk" => Ok(EuropeUlyanovsk), + "Europe/Uzhgorod" => Ok(EuropeUzhgorod), + "Europe/Vaduz" => Ok(EuropeVaduz), + "Europe/Vatican" => Ok(EuropeVatican), + "Europe/Vienna" => Ok(EuropeVienna), + "Europe/Vilnius" => Ok(EuropeVilnius), + "Europe/Volgograd" => Ok(EuropeVolgograd), + "Europe/Warsaw" => Ok(EuropeWarsaw), + "Europe/Zagreb" => Ok(EuropeZagreb), + "Europe/Zaporozhye" => Ok(EuropeZaporozhye), + "Europe/Zurich" => Ok(EuropeZurich), + "Factory" => Ok(Factory), + "GB" => Ok(Gb), + "GB-Eire" => Ok(GbMinusEire), + "GMT" => Ok(Gmt), + "GMT+0" => Ok(GmtPlus0), + "GMT-0" => Ok(GmtMinus0), + "GMT0" => Ok(Gmt0), + "Greenwich" => Ok(Greenwich), + "HST" => Ok(Hst), + "Hongkong" => Ok(Hongkong), + "Iceland" => Ok(Iceland), + "Indian/Antananarivo" => Ok(IndianAntananarivo), + "Indian/Chagos" => Ok(IndianChagos), + "Indian/Christmas" => Ok(IndianChristmas), + "Indian/Cocos" => Ok(IndianCocos), + "Indian/Comoro" => Ok(IndianComoro), + "Indian/Kerguelen" => Ok(IndianKerguelen), + "Indian/Mahe" => Ok(IndianMahe), + "Indian/Maldives" => Ok(IndianMaldives), + "Indian/Mauritius" => Ok(IndianMauritius), + "Indian/Mayotte" => Ok(IndianMayotte), + "Indian/Reunion" => Ok(IndianReunion), + "Iran" => Ok(Iran), + "Israel" => Ok(Israel), + "Jamaica" => Ok(Jamaica), + "Japan" => Ok(Japan), + "Kwajalein" => Ok(Kwajalein), + "Libya" => Ok(Libya), + "MET" => Ok(Met), + "MST" => Ok(Mst), + "MST7MDT" => Ok(Mst7mdt), + "Mexico/BajaNorte" => Ok(MexicoBajaNorte), + "Mexico/BajaSur" => Ok(MexicoBajaSur), + "Mexico/General" => Ok(MexicoGeneral), + "NZ" => Ok(Nz), + "NZ-CHAT" => Ok(NzMinusChat), + "Navajo" => Ok(Navajo), + "PRC" => Ok(Prc), + "PST8PDT" => Ok(Pst8pdt), + "Pacific/Apia" => Ok(PacificApia), + "Pacific/Auckland" => Ok(PacificAuckland), + "Pacific/Bougainville" => Ok(PacificBougainville), + "Pacific/Chatham" => Ok(PacificChatham), + "Pacific/Chuuk" => Ok(PacificChuuk), + "Pacific/Easter" => Ok(PacificEaster), + "Pacific/Efate" => Ok(PacificEfate), + "Pacific/Enderbury" => Ok(PacificEnderbury), + "Pacific/Fakaofo" => Ok(PacificFakaofo), + "Pacific/Fiji" => Ok(PacificFiji), + "Pacific/Funafuti" => Ok(PacificFunafuti), + "Pacific/Galapagos" => Ok(PacificGalapagos), + "Pacific/Gambier" => Ok(PacificGambier), + "Pacific/Guadalcanal" => Ok(PacificGuadalcanal), + "Pacific/Guam" => Ok(PacificGuam), + "Pacific/Honolulu" => Ok(PacificHonolulu), + "Pacific/Johnston" => Ok(PacificJohnston), + "Pacific/Kanton" => Ok(PacificKanton), + "Pacific/Kiritimati" => Ok(PacificKiritimati), + "Pacific/Kosrae" => Ok(PacificKosrae), + "Pacific/Kwajalein" => Ok(PacificKwajalein), + "Pacific/Majuro" => Ok(PacificMajuro), + "Pacific/Marquesas" => Ok(PacificMarquesas), + "Pacific/Midway" => Ok(PacificMidway), + "Pacific/Nauru" => Ok(PacificNauru), + "Pacific/Niue" => Ok(PacificNiue), + "Pacific/Norfolk" => Ok(PacificNorfolk), + "Pacific/Noumea" => Ok(PacificNoumea), + "Pacific/Pago_Pago" => Ok(PacificPagoPago), + "Pacific/Palau" => Ok(PacificPalau), + "Pacific/Pitcairn" => Ok(PacificPitcairn), + "Pacific/Pohnpei" => Ok(PacificPohnpei), + "Pacific/Ponape" => Ok(PacificPonape), + "Pacific/Port_Moresby" => Ok(PacificPortMoresby), + "Pacific/Rarotonga" => Ok(PacificRarotonga), + "Pacific/Saipan" => Ok(PacificSaipan), + "Pacific/Samoa" => Ok(PacificSamoa), + "Pacific/Tahiti" => Ok(PacificTahiti), + "Pacific/Tarawa" => Ok(PacificTarawa), + "Pacific/Tongatapu" => Ok(PacificTongatapu), + "Pacific/Truk" => Ok(PacificTruk), + "Pacific/Wake" => Ok(PacificWake), + "Pacific/Wallis" => Ok(PacificWallis), + "Pacific/Yap" => Ok(PacificYap), + "Poland" => Ok(Poland), + "Portugal" => Ok(Portugal), + "ROC" => Ok(Roc), + "ROK" => Ok(Rok), + "Singapore" => Ok(Singapore), + "Turkey" => Ok(Turkey), + "UCT" => Ok(Uct), + "US/Alaska" => Ok(UsAlaska), + "US/Aleutian" => Ok(UsAleutian), + "US/Arizona" => Ok(UsArizona), + "US/Central" => Ok(UsCentral), + "US/East-Indiana" => Ok(UsEastMinusIndiana), + "US/Eastern" => Ok(UsEastern), + "US/Hawaii" => Ok(UsHawaii), + "US/Indiana-Starke" => Ok(UsIndianaMinusStarke), + "US/Michigan" => Ok(UsMichigan), + "US/Mountain" => Ok(UsMountain), + "US/Pacific" => Ok(UsPacific), + "US/Pacific-New" => Ok(UsPacificMinusNew), + "US/Samoa" => Ok(UsSamoa), + "UTC" => Ok(Utc), + "Universal" => Ok(Universal), + "W-SU" => Ok(WMinusSu), + "WET" => Ok(Wet), + "Zulu" => Ok(Zulu), + _ => Err(()), + } + } +} +impl AsRef for CreateReportingReportRunParametersTimezone { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateReportingReportRunParametersTimezone { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateReportingReportRunParametersTimezone { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateReportingReportRunParametersTimezone { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateReportingReportRun<'a> { + /// Creates a new object and begin running the report. + /// + /// (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).). + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/reporting/report_runs", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListReportingReportRun<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListReportingReportRun<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListReportingReportRun<'a> { + /// Returns a list of Report Runs, with the most recent appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/reporting/report_runs", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/reporting/report_runs", self) + } +} +impl<'a> stripe::PaginationParams for ListReportingReportRun<'a> {} diff --git a/generated/stripe_misc/src/reporting_report_type/mod.rs b/generated/stripe_misc/src/reporting_report_type/mod.rs new file mode 100644 index 000000000..222375364 --- /dev/null +++ b/generated/stripe_misc/src/reporting_report_type/mod.rs @@ -0,0 +1,45 @@ +/// The Report Type resource corresponds to a particular type of report, such as +/// the "Activity summary" or "Itemized payouts" reports. +/// +/// These objects are identified by an ID belonging to a set of enumerated values. +/// See [API Access to Reports documentation](https://stripe.com/docs/reporting/statements/api) for those Report Type IDs, along with required and optional parameters. Note that certain report types can only be run based on your live-mode data (not test-mode data), and will error when queried without a [live-mode API key](https://stripe.com/docs/keys#test-live-modes). For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ReportingReportType { + /// Most recent time for which this Report Type is available. + /// + /// Measured in seconds since the Unix epoch. + pub data_available_end: stripe_types::Timestamp, + /// Earliest time for which this Report Type is available. + /// + /// Measured in seconds since the Unix epoch. + pub data_available_start: stripe_types::Timestamp, + /// List of column names that are included by default when this Report Type gets run. + /// + /// (If the Report Type doesn't support the `columns` parameter, this will be null.). + pub default_columns: Option>, + /// The [ID of the Report Type](https://stripe.com/docs/reporting/statements/api#available-report-types), such as `balance.summary.1`. + pub id: stripe_misc::reporting_report_type::ReportingReportTypeId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Human-readable name of the Report Type. + pub name: String, + /// When this Report Type was latest updated. + /// + /// Measured in seconds since the Unix epoch. + pub updated: stripe_types::Timestamp, + /// Version of the Report Type. + /// + /// Different versions report with the same ID will have the same purpose, but may take different run parameters or have different result schemas. + pub version: i64, +} +impl stripe_types::Object for ReportingReportType { + type Id = stripe_misc::reporting_report_type::ReportingReportTypeId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(ReportingReportTypeId); +#[cfg(feature = "reporting_report_type")] +mod requests; +#[cfg(feature = "reporting_report_type")] +pub use requests::*; diff --git a/generated/stripe_misc/src/reporting_report_type/requests.rs b/generated/stripe_misc/src/reporting_report_type/requests.rs new file mode 100644 index 000000000..c7ea41626 --- /dev/null +++ b/generated/stripe_misc/src/reporting_report_type/requests.rs @@ -0,0 +1,47 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveReportingReportType<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveReportingReportType<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveReportingReportType<'a> { + /// Retrieves the details of a Report Type. + /// + /// (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).). + pub fn send( + &self, + client: &stripe::Client, + report_type: &str, + ) -> stripe::Response { + client.get_query(&format!("/reporting/report_types/{report_type}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListReportingReportType<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ListReportingReportType<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListReportingReportType<'a> { + /// Returns a full list of Report Types. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/reporting/report_types", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/reporting/report_types", self) + } +} +impl<'a> stripe::PaginationParams for ListReportingReportType<'a> {} diff --git a/generated/stripe_misc/src/scheduled_query_run/mod.rs b/generated/stripe_misc/src/scheduled_query_run/mod.rs new file mode 100644 index 000000000..a6b3e8763 --- /dev/null +++ b/generated/stripe_misc/src/scheduled_query_run/mod.rs @@ -0,0 +1,41 @@ +/// If you have [scheduled a Sigma query](https://stripe.com/docs/sigma/scheduled-queries), you'll +/// receive a `sigma.scheduled_query_run.created` webhook each time the query +/// runs. +/// +/// The webhook contains a `ScheduledQueryRun` object, which you can use to retrieve the query results. For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ScheduledQueryRun { + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// When the query was run, Sigma contained a snapshot of your Stripe data at this time. + pub data_load_time: stripe_types::Timestamp, + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, + /// The file object representing the results of the query. + pub file: Option, + /// Unique identifier for the object. + pub id: stripe_misc::scheduled_query_run::ScheduledQueryRunId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Time at which the result expires and is no longer available for download. + pub result_available_until: stripe_types::Timestamp, + /// SQL for the query. + pub sql: String, + /// The query's execution status, which will be `completed` for successful runs, and `canceled`, `failed`, or `timed_out` otherwise. + pub status: String, + /// Title of the query. + pub title: String, +} +impl stripe_types::Object for ScheduledQueryRun { + type Id = stripe_misc::scheduled_query_run::ScheduledQueryRunId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(ScheduledQueryRunId, "sqr_"); +#[cfg(feature = "scheduled_query_run")] +mod requests; +#[cfg(feature = "scheduled_query_run")] +pub use requests::*; diff --git a/generated/stripe_misc/src/scheduled_query_run/requests.rs b/generated/stripe_misc/src/scheduled_query_run/requests.rs new file mode 100644 index 000000000..f70621f85 --- /dev/null +++ b/generated/stripe_misc/src/scheduled_query_run/requests.rs @@ -0,0 +1,62 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListScheduledQueryRun<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListScheduledQueryRun<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListScheduledQueryRun<'a> { + /// Returns a list of scheduled query runs. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/sigma/scheduled_query_runs", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/sigma/scheduled_query_runs", self) + } +} +impl<'a> stripe::PaginationParams for ListScheduledQueryRun<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveScheduledQueryRun<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveScheduledQueryRun<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveScheduledQueryRun<'a> { + /// Retrieves the details of an scheduled query run. + pub fn send( + &self, + client: &stripe::Client, + scheduled_query_run: &stripe_misc::scheduled_query_run::ScheduledQueryRunId, + ) -> stripe::Response { + client.get_query(&format!("/sigma/scheduled_query_runs/{scheduled_query_run}"), self) + } +} diff --git a/generated/stripe_misc/src/sigma_scheduled_query_run_error/mod.rs b/generated/stripe_misc/src/sigma_scheduled_query_run_error/mod.rs new file mode 100644 index 000000000..e52c463a5 --- /dev/null +++ b/generated/stripe_misc/src/sigma_scheduled_query_run_error/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SigmaScheduledQueryRunError { + /// Information about the run failure. + pub message: String, +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options/mod.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options/mod.rs new file mode 100644 index 000000000..aae0c58f1 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options/mod.rs @@ -0,0 +1,101 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub ae: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub at: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub be: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bg: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ca: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ch: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cl: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub co: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cy: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cz: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub de: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub dk: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ee: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub es: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fi: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fr: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub gb: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub gr: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub hr: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub hu: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ie: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub is: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub it: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub jp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub kr: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub lt: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub lu: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub lv: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mt: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mx: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub my: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub nl: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub no: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub nz: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pl: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pt: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ro: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sa: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub se: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sg: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub si: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sk: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub th: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tr: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub us: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub vn: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub za: Option, +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_ca_province_standard/mod.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_ca_province_standard/mod.rs new file mode 100644 index 000000000..25ebd3e5c --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_ca_province_standard/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsCaProvinceStandard { + /// Two-letter CA province code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + pub province: String, +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_canada/mod.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_canada/mod.rs new file mode 100644 index 000000000..26af7a635 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_canada/mod.rs @@ -0,0 +1,74 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsCanada { + #[serde(skip_serializing_if = "Option::is_none")] + pub province_standard: + Option, + /// Type of registration in Canada. + #[serde(rename = "type")] + pub type_: TaxProductRegistrationsResourceCountryOptionsCanadaType, +} +/// Type of registration in Canada. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductRegistrationsResourceCountryOptionsCanadaType { + ProvinceStandard, + Simplified, + Standard, +} +impl TaxProductRegistrationsResourceCountryOptionsCanadaType { + pub fn as_str(self) -> &'static str { + use TaxProductRegistrationsResourceCountryOptionsCanadaType::*; + match self { + ProvinceStandard => "province_standard", + Simplified => "simplified", + Standard => "standard", + } + } +} + +impl std::str::FromStr for TaxProductRegistrationsResourceCountryOptionsCanadaType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductRegistrationsResourceCountryOptionsCanadaType::*; + match s { + "province_standard" => Ok(ProvinceStandard), + "simplified" => Ok(Simplified), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for TaxProductRegistrationsResourceCountryOptionsCanadaType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductRegistrationsResourceCountryOptionsCanadaType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductRegistrationsResourceCountryOptionsCanadaType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductRegistrationsResourceCountryOptionsCanadaType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductRegistrationsResourceCountryOptionsCanadaType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductRegistrationsResourceCountryOptionsCanadaType", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_default/mod.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_default/mod.rs new file mode 100644 index 000000000..6687fade5 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_default/mod.rs @@ -0,0 +1,65 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsDefault { + /// Type of registration in `country`. + #[serde(rename = "type")] + pub type_: TaxProductRegistrationsResourceCountryOptionsDefaultType, +} +/// Type of registration in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductRegistrationsResourceCountryOptionsDefaultType { + Standard, +} +impl TaxProductRegistrationsResourceCountryOptionsDefaultType { + pub fn as_str(self) -> &'static str { + use TaxProductRegistrationsResourceCountryOptionsDefaultType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr for TaxProductRegistrationsResourceCountryOptionsDefaultType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductRegistrationsResourceCountryOptionsDefaultType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for TaxProductRegistrationsResourceCountryOptionsDefaultType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductRegistrationsResourceCountryOptionsDefaultType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductRegistrationsResourceCountryOptionsDefaultType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductRegistrationsResourceCountryOptionsDefaultType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductRegistrationsResourceCountryOptionsDefaultType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductRegistrationsResourceCountryOptionsDefaultType", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_eu_standard/mod.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_eu_standard/mod.rs new file mode 100644 index 000000000..bd47eec6f --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_eu_standard/mod.rs @@ -0,0 +1,74 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsEuStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: + TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme, +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme +{ + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme")) + } +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_europe/mod.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_europe/mod.rs new file mode 100644 index 000000000..9a0c7b93c --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_europe/mod.rs @@ -0,0 +1,76 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsEurope { + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration in an EU country. + #[serde(rename = "type")] + pub type_: TaxProductRegistrationsResourceCountryOptionsEuropeType, +} +/// Type of registration in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductRegistrationsResourceCountryOptionsEuropeType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl TaxProductRegistrationsResourceCountryOptionsEuropeType { + pub fn as_str(self) -> &'static str { + use TaxProductRegistrationsResourceCountryOptionsEuropeType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for TaxProductRegistrationsResourceCountryOptionsEuropeType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductRegistrationsResourceCountryOptionsEuropeType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for TaxProductRegistrationsResourceCountryOptionsEuropeType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductRegistrationsResourceCountryOptionsEuropeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductRegistrationsResourceCountryOptionsEuropeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductRegistrationsResourceCountryOptionsEuropeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductRegistrationsResourceCountryOptionsEuropeType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductRegistrationsResourceCountryOptionsEuropeType", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_simplified/mod.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_simplified/mod.rs new file mode 100644 index 000000000..77fd5efaf --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_simplified/mod.rs @@ -0,0 +1,65 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsSimplified { + /// Type of registration in `country`. + #[serde(rename = "type")] + pub type_: TaxProductRegistrationsResourceCountryOptionsSimplifiedType, +} +/// Type of registration in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductRegistrationsResourceCountryOptionsSimplifiedType { + Simplified, +} +impl TaxProductRegistrationsResourceCountryOptionsSimplifiedType { + pub fn as_str(self) -> &'static str { + use TaxProductRegistrationsResourceCountryOptionsSimplifiedType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr for TaxProductRegistrationsResourceCountryOptionsSimplifiedType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductRegistrationsResourceCountryOptionsSimplifiedType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl AsRef for TaxProductRegistrationsResourceCountryOptionsSimplifiedType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductRegistrationsResourceCountryOptionsSimplifiedType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductRegistrationsResourceCountryOptionsSimplifiedType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductRegistrationsResourceCountryOptionsSimplifiedType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductRegistrationsResourceCountryOptionsSimplifiedType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductRegistrationsResourceCountryOptionsSimplifiedType", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_united_states/mod.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_united_states/mod.rs new file mode 100644 index 000000000..c2bf76735 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_united_states/mod.rs @@ -0,0 +1,84 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsUnitedStates { + #[serde(skip_serializing_if = "Option::is_none")] + pub local_amusement_tax: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub local_lease_tax: + Option, + /// Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + pub state: String, + /// Type of registration in the US. + #[serde(rename = "type")] + pub type_: TaxProductRegistrationsResourceCountryOptionsUnitedStatesType, +} +/// Type of registration in the US. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { + LocalAmusementTax, + LocalLeaseTax, + StateCommunicationsTax, + StateSalesTax, +} +impl TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { + pub fn as_str(self) -> &'static str { + use TaxProductRegistrationsResourceCountryOptionsUnitedStatesType::*; + match self { + LocalAmusementTax => "local_amusement_tax", + LocalLeaseTax => "local_lease_tax", + StateCommunicationsTax => "state_communications_tax", + StateSalesTax => "state_sales_tax", + } + } +} + +impl std::str::FromStr for TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductRegistrationsResourceCountryOptionsUnitedStatesType::*; + match s { + "local_amusement_tax" => Ok(LocalAmusementTax), + "local_lease_tax" => Ok(LocalLeaseTax), + "state_communications_tax" => Ok(StateCommunicationsTax), + "state_sales_tax" => Ok(StateSalesTax), + _ => Err(()), + } + } +} +impl AsRef for TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for TaxProductRegistrationsResourceCountryOptionsUnitedStatesType +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductRegistrationsResourceCountryOptionsUnitedStatesType", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_us_local_amusement_tax/mod.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_us_local_amusement_tax/mod.rs new file mode 100644 index 000000000..9ddcfee48 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_us_local_amusement_tax/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsUsLocalAmusementTax { + /// A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. + pub jurisdiction: String, +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_us_local_lease_tax/mod.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_us_local_lease_tax/mod.rs new file mode 100644 index 000000000..69c7fb567 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_us_local_lease_tax/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsUsLocalLeaseTax { + /// A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. + pub jurisdiction: String, +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_tax_registration/mod.rs b/generated/stripe_misc/src/tax_product_registrations_resource_tax_registration/mod.rs new file mode 100644 index 000000000..280a819dc --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_tax_registration/mod.rs @@ -0,0 +1,110 @@ +/// A Tax `Registration` lets us know that your business is registered to collect tax on payments within a region, enabling you to [automatically collect tax](https://stripe.com/docs/tax). +/// +/// Stripe doesn't register on your behalf with the relevant authorities when you create a Tax `Registration` object. +/// +/// For more information on how to register to collect tax, see [our guide](https://stripe.com/docs/tax/registering). Related guide: [Using the Registrations API](https://stripe.com/docs/tax/registrations-api) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceTaxRegistration { + /// Time at which the registration becomes active. + /// + /// Measured in seconds since the Unix epoch. + pub active_from: stripe_types::Timestamp, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: String, + pub country_options: stripe_misc::TaxProductRegistrationsResourceCountryOptions, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// If set, the registration stops being active at this time. + /// + /// If not set, the registration will be active indefinitely. + /// Measured in seconds since the Unix epoch. + pub expires_at: Option, + /// Unique identifier for the object. + pub id: stripe_misc::tax_product_registrations_resource_tax_registration::TaxRegistrationId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The status of the registration. + /// + /// This field is present for convenience and can be deduced from `active_from` and `expires_at`. + pub status: TaxProductRegistrationsResourceTaxRegistrationStatus, +} +/// The status of the registration. +/// +/// This field is present for convenience and can be deduced from `active_from` and `expires_at`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductRegistrationsResourceTaxRegistrationStatus { + Active, + Expired, + Scheduled, +} +impl TaxProductRegistrationsResourceTaxRegistrationStatus { + pub fn as_str(self) -> &'static str { + use TaxProductRegistrationsResourceTaxRegistrationStatus::*; + match self { + Active => "active", + Expired => "expired", + Scheduled => "scheduled", + } + } +} + +impl std::str::FromStr for TaxProductRegistrationsResourceTaxRegistrationStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductRegistrationsResourceTaxRegistrationStatus::*; + match s { + "active" => Ok(Active), + "expired" => Ok(Expired), + "scheduled" => Ok(Scheduled), + _ => Err(()), + } + } +} +impl AsRef for TaxProductRegistrationsResourceTaxRegistrationStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductRegistrationsResourceTaxRegistrationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductRegistrationsResourceTaxRegistrationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductRegistrationsResourceTaxRegistrationStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductRegistrationsResourceTaxRegistrationStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductRegistrationsResourceTaxRegistrationStatus", + ) + }) + } +} +impl stripe_types::Object for TaxProductRegistrationsResourceTaxRegistration { + type Id = stripe_misc::tax_product_registrations_resource_tax_registration::TaxRegistrationId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TaxRegistrationId); +#[cfg(feature = "tax_product_registrations_resource_tax_registration")] +mod requests; +#[cfg(feature = "tax_product_registrations_resource_tax_registration")] +pub use requests::*; diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_tax_registration/requests.rs b/generated/stripe_misc/src/tax_product_registrations_resource_tax_registration/requests.rs new file mode 100644 index 000000000..08df66372 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_tax_registration/requests.rs @@ -0,0 +1,5813 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTaxProductRegistrationsResourceTaxRegistration<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// The status of the Tax Registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTaxProductRegistrationsResourceTaxRegistration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The status of the Tax Registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTaxProductRegistrationsResourceTaxRegistrationStatus { + Active, + All, + Expired, + Scheduled, +} +impl ListTaxProductRegistrationsResourceTaxRegistrationStatus { + pub fn as_str(self) -> &'static str { + use ListTaxProductRegistrationsResourceTaxRegistrationStatus::*; + match self { + Active => "active", + All => "all", + Expired => "expired", + Scheduled => "scheduled", + } + } +} + +impl std::str::FromStr for ListTaxProductRegistrationsResourceTaxRegistrationStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTaxProductRegistrationsResourceTaxRegistrationStatus::*; + match s { + "active" => Ok(Active), + "all" => Ok(All), + "expired" => Ok(Expired), + "scheduled" => Ok(Scheduled), + _ => Err(()), + } + } +} +impl AsRef for ListTaxProductRegistrationsResourceTaxRegistrationStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListTaxProductRegistrationsResourceTaxRegistrationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTaxProductRegistrationsResourceTaxRegistrationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTaxProductRegistrationsResourceTaxRegistrationStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListTaxProductRegistrationsResourceTaxRegistration<'a> { + /// Returns a list of Tax `Registration` objects. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response< + stripe_types::List, + > { + client.get_query("/tax/registrations", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/tax/registrations", self) + } +} +impl<'a> stripe::PaginationParams for ListTaxProductRegistrationsResourceTaxRegistration<'a> {} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistration<'a> { + /// Time at which the Tax Registration becomes active. + /// + /// It can be either `now` to indicate the current time, or a future timestamp measured in seconds since the Unix epoch. + pub active_from: CreateTaxProductRegistrationsResourceTaxRegistrationActiveFrom, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: &'a str, + /// Specific options for a registration in the specified `country`. + pub country_options: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptions<'a>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// If set, the Tax Registration stops being active at this time. + /// + /// If not set, the Tax Registration will be active indefinitely. + /// Timestamp measured in seconds since the Unix epoch. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, +} +impl<'a> CreateTaxProductRegistrationsResourceTaxRegistration<'a> { + pub fn new( + active_from: CreateTaxProductRegistrationsResourceTaxRegistrationActiveFrom, + country: &'a str, + country_options: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptions<'a>, + ) -> Self { + Self { + active_from, + country, + country_options, + expand: Default::default(), + expires_at: Default::default(), + } + } +} +/// Time at which the Tax Registration becomes active. +/// +/// It can be either `now` to indicate the current time, or a future timestamp measured in seconds since the Unix epoch. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationActiveFrom { + Now, + Timestamp(stripe_types::Timestamp), +} +/// Specific options for a registration in the specified `country`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptions<'a> { + /// Options for the registration in AE. + #[serde(skip_serializing_if = "Option::is_none")] + pub ae: Option, + /// Options for the registration in AT. + #[serde(skip_serializing_if = "Option::is_none")] + pub at: Option, + /// Options for the registration in AU. + #[serde(skip_serializing_if = "Option::is_none")] + pub au: Option, + /// Options for the registration in BE. + #[serde(skip_serializing_if = "Option::is_none")] + pub be: Option, + /// Options for the registration in BG. + #[serde(skip_serializing_if = "Option::is_none")] + pub bg: Option, + /// Options for the registration in CA. + #[serde(skip_serializing_if = "Option::is_none")] + pub ca: Option>, + /// Options for the registration in CH. + #[serde(skip_serializing_if = "Option::is_none")] + pub ch: Option, + /// Options for the registration in CL. + #[serde(skip_serializing_if = "Option::is_none")] + pub cl: Option, + /// Options for the registration in CO. + #[serde(skip_serializing_if = "Option::is_none")] + pub co: Option, + /// Options for the registration in CY. + #[serde(skip_serializing_if = "Option::is_none")] + pub cy: Option, + /// Options for the registration in CZ. + #[serde(skip_serializing_if = "Option::is_none")] + pub cz: Option, + /// Options for the registration in DE. + #[serde(skip_serializing_if = "Option::is_none")] + pub de: Option, + /// Options for the registration in DK. + #[serde(skip_serializing_if = "Option::is_none")] + pub dk: Option, + /// Options for the registration in EE. + #[serde(skip_serializing_if = "Option::is_none")] + pub ee: Option, + /// Options for the registration in ES. + #[serde(skip_serializing_if = "Option::is_none")] + pub es: Option, + /// Options for the registration in FI. + #[serde(skip_serializing_if = "Option::is_none")] + pub fi: Option, + /// Options for the registration in FR. + #[serde(skip_serializing_if = "Option::is_none")] + pub fr: Option, + /// Options for the registration in GB. + #[serde(skip_serializing_if = "Option::is_none")] + pub gb: Option, + /// Options for the registration in GR. + #[serde(skip_serializing_if = "Option::is_none")] + pub gr: Option, + /// Options for the registration in HR. + #[serde(skip_serializing_if = "Option::is_none")] + pub hr: Option, + /// Options for the registration in HU. + #[serde(skip_serializing_if = "Option::is_none")] + pub hu: Option, + /// Options for the registration in ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + /// Options for the registration in IE. + #[serde(skip_serializing_if = "Option::is_none")] + pub ie: Option, + /// Options for the registration in IS. + #[serde(skip_serializing_if = "Option::is_none")] + pub is: Option, + /// Options for the registration in IT. + #[serde(skip_serializing_if = "Option::is_none")] + pub it: Option, + /// Options for the registration in JP. + #[serde(skip_serializing_if = "Option::is_none")] + pub jp: Option, + /// Options for the registration in KR. + #[serde(skip_serializing_if = "Option::is_none")] + pub kr: Option, + /// Options for the registration in LT. + #[serde(skip_serializing_if = "Option::is_none")] + pub lt: Option, + /// Options for the registration in LU. + #[serde(skip_serializing_if = "Option::is_none")] + pub lu: Option, + /// Options for the registration in LV. + #[serde(skip_serializing_if = "Option::is_none")] + pub lv: Option, + /// Options for the registration in MT. + #[serde(skip_serializing_if = "Option::is_none")] + pub mt: Option, + /// Options for the registration in MX. + #[serde(skip_serializing_if = "Option::is_none")] + pub mx: Option, + /// Options for the registration in MY. + #[serde(skip_serializing_if = "Option::is_none")] + pub my: Option, + /// Options for the registration in NL. + #[serde(skip_serializing_if = "Option::is_none")] + pub nl: Option, + /// Options for the registration in NO. + #[serde(skip_serializing_if = "Option::is_none")] + pub no: Option, + /// Options for the registration in NZ. + #[serde(skip_serializing_if = "Option::is_none")] + pub nz: Option, + /// Options for the registration in PL. + #[serde(skip_serializing_if = "Option::is_none")] + pub pl: Option, + /// Options for the registration in PT. + #[serde(skip_serializing_if = "Option::is_none")] + pub pt: Option, + /// Options for the registration in RO. + #[serde(skip_serializing_if = "Option::is_none")] + pub ro: Option, + /// Options for the registration in SA. + #[serde(skip_serializing_if = "Option::is_none")] + pub sa: Option, + /// Options for the registration in SE. + #[serde(skip_serializing_if = "Option::is_none")] + pub se: Option, + /// Options for the registration in SG. + #[serde(skip_serializing_if = "Option::is_none")] + pub sg: Option, + /// Options for the registration in SI. + #[serde(skip_serializing_if = "Option::is_none")] + pub si: Option, + /// Options for the registration in SK. + #[serde(skip_serializing_if = "Option::is_none")] + pub sk: Option, + /// Options for the registration in TH. + #[serde(skip_serializing_if = "Option::is_none")] + pub th: Option, + /// Options for the registration in TR. + #[serde(skip_serializing_if = "Option::is_none")] + pub tr: Option, + /// Options for the registration in US. + #[serde(skip_serializing_if = "Option::is_none")] + pub us: Option>, + /// Options for the registration in VN. + #[serde(skip_serializing_if = "Option::is_none")] + pub vn: Option, + /// Options for the registration in ZA. + #[serde(skip_serializing_if = "Option::is_none")] + pub za: Option, +} +impl<'a> CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Options for the registration in AE. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAe { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAeType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAe { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAeType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAeType { + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAeType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAeType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAeType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAeType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAeType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAeType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in AT. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAt { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAt { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAtType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in AU. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAu { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAuType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAu { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAuType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAuType { + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAuType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAuType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAuType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAuType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAuType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAuType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAuType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsAuType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in BE. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBe { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBe { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in BG. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBg { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBg { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsBgType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in CA. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCa<'a> { + /// Options for the provincial tax registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub province_standard: Option< + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCaProvinceStandard<'a>, + >, + /// Type of registration to be created in Canada. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCaType, +} +impl<'a> CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCa<'a> { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCaType, + ) -> Self { + Self { province_standard: Default::default(), type_ } + } +} +/// Options for the provincial tax registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCaProvinceStandard<'a> +{ + /// Two-letter CA province code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + pub province: &'a str, +} +impl<'a> CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCaProvinceStandard<'a> { + pub fn new(province: &'a str) -> Self { + Self { province } + } +} +/// Type of registration to be created in Canada. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCaType { + ProvinceStandard, + Simplified, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCaType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCaType::*; + match self { + ProvinceStandard => "province_standard", + Simplified => "simplified", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCaType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCaType::*; + match s { + "province_standard" => Ok(ProvinceStandard), + "simplified" => Ok(Simplified), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCaType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCaType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCaType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCaType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in CH. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCh { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsChType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCh { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsChType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsChType { + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsChType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsChType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsChType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsChType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsChType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsChType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsChType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsChType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in CL. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCl { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsClType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCl { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsClType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsClType { + Simplified, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsClType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsClType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsClType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsClType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsClType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsClType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsClType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsClType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in CO. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCo { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCoType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCo { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCoType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCoType { + Simplified, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCoType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCoType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCoType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCoType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCoType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCoType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCoType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCoType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in CY. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCy { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCy { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCyType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in CZ. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCz { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCz { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsCzType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in DE. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDe { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDe { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in DK. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDk { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDk { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsDkType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in EE. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEe { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEe { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in ES. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEs { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEs { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsEsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in FI. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFi { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFi { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFiType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in FR. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFr { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFr { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsFrType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in GB. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGb { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGbType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGb { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGbType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGbType { + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGbType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGbType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGbType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGbType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGbType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGbType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGbType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGbType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in GR. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGr { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGr { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsGrType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in HR. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHr { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHr { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHrType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in HU. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHu { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHu { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsHuType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in ID. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsId { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIdType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsId { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIdType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIdType { + Simplified, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIdType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIdType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIdType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIdType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIdType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIdType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIdType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in IE. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIe { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIe { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in IS. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIs { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIsType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIs { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIsType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIsType { + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIsType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIsType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIsType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIsType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIsType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in IT. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIt { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsIt { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsItType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in JP. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsJp { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsJpType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsJp { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsJpType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsJpType { + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsJpType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsJpType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsJpType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsJpType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsJpType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsJpType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsJpType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsJpType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in KR. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsKr { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsKrType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsKr { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsKrType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsKrType { + Simplified, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsKrType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsKrType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsKrType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsKrType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsKrType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsKrType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsKrType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsKrType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in LT. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLt { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLt { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLtType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in LU. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLu { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLu { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLuType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in LV. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLv { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLv { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsLvType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in MT. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMt { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMt { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMtType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in MX. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMx { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMxType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMx { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMxType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMxType { + Simplified, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMxType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMxType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMxType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMxType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMxType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMxType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMxType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in MY. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMy { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMyType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMy { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMyType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMyType { + Simplified, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMyType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMyType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMyType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMyType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMyType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMyType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMyType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsMyType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in NL. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNl { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNl { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNlType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in NO. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNo { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNoType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNo { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNoType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNoType { + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNoType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNoType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNoType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNoType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNoType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNoType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNoType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNoType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in NZ. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNz { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNzType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNz { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNzType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNzType { + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNzType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNzType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNzType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNzType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNzType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNzType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNzType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsNzType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in PL. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPl { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPl { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPlType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in PT. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPt { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPt { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsPtType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in RO. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRo { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRo { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsRoType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in SA. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSa { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSaType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSa { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSaType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSaType { + Simplified, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSaType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSaType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSaType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSaType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSaType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSaType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSaType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSaType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in SE. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSe { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSe { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in SG. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSg { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSgType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSg { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSgType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSgType { + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSgType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSgType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSgType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSgType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSgType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSgType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSgType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSgType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in SI. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSi { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSi { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSiType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in SK. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSk { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: + Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSk { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkType, + ) -> Self { + Self { standard: Default::default(), type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkStandard { + /// Place of supply scheme used in an EU standard registration. +pub place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme, + +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkStandard { + pub fn new( + place_of_supply_scheme: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme +{ + SmallSeller, + Standard, +} +impl + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme +{ + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), +"standard" => Ok(Standard), +_ => Err(()) + + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsSkType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in TH. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsTh { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsThType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsTh { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsThType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsThType { + Simplified, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsThType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsThType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsThType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsThType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsThType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsThType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsThType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsThType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in TR. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsTr { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsTrType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsTr { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsTrType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsTrType { + Simplified, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsTrType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsTrType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsTrType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsTrType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsTrType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsTrType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsTrType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsTrType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in US. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUs<'a> { + /// Options for the local amusement tax registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub local_amusement_tax: Option< + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUsLocalAmusementTax<'a>, + >, + /// Options for the local lease tax registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub local_lease_tax: Option< + CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUsLocalLeaseTax<'a>, + >, + /// Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + pub state: &'a str, + /// Type of registration to be created in the US. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUsType, +} +impl<'a> CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUs<'a> { + pub fn new( + state: &'a str, + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUsType, + ) -> Self { + Self { + local_amusement_tax: Default::default(), + local_lease_tax: Default::default(), + state, + type_, + } + } +} +/// Options for the local amusement tax registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUsLocalAmusementTax<'a> +{ + /// A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. + /// + /// Supported FIPS codes are: `14000` (Chicago), `06613` (Bloomington), `21696` (East Dundee), `24582` (Evanston), and `68081` (Schiller Park). + pub jurisdiction: &'a str, +} +impl<'a> CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUsLocalAmusementTax<'a> { + pub fn new(jurisdiction: &'a str) -> Self { + Self { jurisdiction } + } +} +/// Options for the local lease tax registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUsLocalLeaseTax<'a> { + /// A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. + /// + /// Supported FIPS codes are: `14000` (Chicago). + pub jurisdiction: &'a str, +} +impl<'a> CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUsLocalLeaseTax<'a> { + pub fn new(jurisdiction: &'a str) -> Self { + Self { jurisdiction } + } +} +/// Type of registration to be created in the US. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUsType { + LocalAmusementTax, + LocalLeaseTax, + StateCommunicationsTax, + StateSalesTax, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUsType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUsType::*; + match self { + LocalAmusementTax => "local_amusement_tax", + LocalLeaseTax => "local_lease_tax", + StateCommunicationsTax => "state_communications_tax", + StateSalesTax => "state_sales_tax", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUsType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUsType::*; + match s { + "local_amusement_tax" => Ok(LocalAmusementTax), + "local_lease_tax" => Ok(LocalLeaseTax), + "state_communications_tax" => Ok(StateCommunicationsTax), + "state_sales_tax" => Ok(StateSalesTax), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUsType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsUsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in VN. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsVn { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsVnType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsVn { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsVnType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsVnType { + Simplified, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsVnType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsVnType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsVnType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsVnType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsVnType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsVnType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsVnType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsVnType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in ZA. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsZa { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsZaType, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsZa { + pub fn new( + type_: CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsZaType, + ) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsZaType { + Standard, +} +impl CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsZaType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsZaType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsZaType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsZaType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsZaType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsZaType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsZaType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductRegistrationsResourceTaxRegistrationCountryOptionsZaType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateTaxProductRegistrationsResourceTaxRegistration<'a> { + /// Creates a new Tax `Registration` object. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/tax/registrations", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTaxProductRegistrationsResourceTaxRegistration<'a> { + /// Time at which the registration becomes active. + /// + /// It can be either `now` to indicate the current time, or a timestamp measured in seconds since the Unix epoch. + #[serde(skip_serializing_if = "Option::is_none")] + pub active_from: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// If set, the registration stops being active at this time. + /// + /// If not set, the registration will be active indefinitely. + /// It can be either `now` to indicate the current time, or a timestamp measured in seconds since the Unix epoch. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, +} +impl<'a> UpdateTaxProductRegistrationsResourceTaxRegistration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Time at which the registration becomes active. +/// +/// It can be either `now` to indicate the current time, or a timestamp measured in seconds since the Unix epoch. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateTaxProductRegistrationsResourceTaxRegistrationActiveFrom { + Now, + Timestamp(stripe_types::Timestamp), +} +/// If set, the registration stops being active at this time. +/// +/// If not set, the registration will be active indefinitely. +/// It can be either `now` to indicate the current time, or a timestamp measured in seconds since the Unix epoch. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateTaxProductRegistrationsResourceTaxRegistrationExpiresAt { + Now, + Timestamp(stripe_types::Timestamp), +} +impl<'a> UpdateTaxProductRegistrationsResourceTaxRegistration<'a> { + /// Updates an existing Tax `Registration` object. + /// + /// A registration cannot be deleted after it has been created. + /// + /// If you wish to end a registration you may do so by setting `expires_at`. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_misc::tax_product_registrations_resource_tax_registration::TaxRegistrationId, + ) -> stripe::Response { + client.send_form(&format!("/tax/registrations/{id}"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_customer_details/mod.rs b/generated/stripe_misc/src/tax_product_resource_customer_details/mod.rs new file mode 100644 index 000000000..632fd0b3b --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_customer_details/mod.rs @@ -0,0 +1,140 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceCustomerDetails { + /// The customer's postal address (for example, home or business location). + pub address: Option, + /// The type of customer address provided. + pub address_source: Option, + /// The customer's IP address (IPv4 or IPv6). + pub ip_address: Option, + /// The customer's tax IDs (for example, EU VAT numbers). + pub tax_ids: Vec, + /// The taxability override used for taxation. + pub taxability_override: TaxProductResourceCustomerDetailsTaxabilityOverride, +} +/// The type of customer address provided. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceCustomerDetailsAddressSource { + Billing, + Shipping, +} +impl TaxProductResourceCustomerDetailsAddressSource { + pub fn as_str(self) -> &'static str { + use TaxProductResourceCustomerDetailsAddressSource::*; + match self { + Billing => "billing", + Shipping => "shipping", + } + } +} + +impl std::str::FromStr for TaxProductResourceCustomerDetailsAddressSource { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceCustomerDetailsAddressSource::*; + match s { + "billing" => Ok(Billing), + "shipping" => Ok(Shipping), + _ => Err(()), + } + } +} +impl AsRef for TaxProductResourceCustomerDetailsAddressSource { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductResourceCustomerDetailsAddressSource { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceCustomerDetailsAddressSource { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceCustomerDetailsAddressSource { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceCustomerDetailsAddressSource { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceCustomerDetailsAddressSource", + ) + }) + } +} +/// The taxability override used for taxation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceCustomerDetailsTaxabilityOverride { + CustomerExempt, + None, + ReverseCharge, +} +impl TaxProductResourceCustomerDetailsTaxabilityOverride { + pub fn as_str(self) -> &'static str { + use TaxProductResourceCustomerDetailsTaxabilityOverride::*; + match self { + CustomerExempt => "customer_exempt", + None => "none", + ReverseCharge => "reverse_charge", + } + } +} + +impl std::str::FromStr for TaxProductResourceCustomerDetailsTaxabilityOverride { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceCustomerDetailsTaxabilityOverride::*; + match s { + "customer_exempt" => Ok(CustomerExempt), + "none" => Ok(None), + "reverse_charge" => Ok(ReverseCharge), + _ => Err(()), + } + } +} +impl AsRef for TaxProductResourceCustomerDetailsTaxabilityOverride { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductResourceCustomerDetailsTaxabilityOverride { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceCustomerDetailsTaxabilityOverride { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceCustomerDetailsTaxabilityOverride { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceCustomerDetailsTaxabilityOverride { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceCustomerDetailsTaxabilityOverride", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_customer_details_resource_tax_id/mod.rs b/generated/stripe_misc/src/tax_product_resource_customer_details_resource_tax_id/mod.rs new file mode 100644 index 000000000..be04abdaa --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_customer_details_resource_tax_id/mod.rs @@ -0,0 +1,265 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceCustomerDetailsResourceTaxId { + /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. + #[serde(rename = "type")] + pub type_: TaxProductResourceCustomerDetailsResourceTaxIdType, + /// The value of the tax ID. + pub value: String, +} +/// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceCustomerDetailsResourceTaxIdType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + Unknown, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, +} +impl TaxProductResourceCustomerDetailsResourceTaxIdType { + pub fn as_str(self) -> &'static str { + use TaxProductResourceCustomerDetailsResourceTaxIdType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + Unknown => "unknown", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + } + } +} + +impl std::str::FromStr for TaxProductResourceCustomerDetailsResourceTaxIdType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceCustomerDetailsResourceTaxIdType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "unknown" => Ok(Unknown), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl AsRef for TaxProductResourceCustomerDetailsResourceTaxIdType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductResourceCustomerDetailsResourceTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceCustomerDetailsResourceTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceCustomerDetailsResourceTaxIdType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceCustomerDetailsResourceTaxIdType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceCustomerDetailsResourceTaxIdType", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_jurisdiction/mod.rs b/generated/stripe_misc/src/tax_product_resource_jurisdiction/mod.rs new file mode 100644 index 000000000..9ea0cf422 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_jurisdiction/mod.rs @@ -0,0 +1,82 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceJurisdiction { + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: String, + /// A human-readable name for the jurisdiction imposing the tax. + pub display_name: String, + /// Indicates the level of the jurisdiction imposing the tax. + pub level: TaxProductResourceJurisdictionLevel, + /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. + /// + /// For example, "NY" for New York, United States. + pub state: Option, +} +/// Indicates the level of the jurisdiction imposing the tax. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceJurisdictionLevel { + City, + Country, + County, + District, + State, +} +impl TaxProductResourceJurisdictionLevel { + pub fn as_str(self) -> &'static str { + use TaxProductResourceJurisdictionLevel::*; + match self { + City => "city", + Country => "country", + County => "county", + District => "district", + State => "state", + } + } +} + +impl std::str::FromStr for TaxProductResourceJurisdictionLevel { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceJurisdictionLevel::*; + match s { + "city" => Ok(City), + "country" => Ok(Country), + "county" => Ok(County), + "district" => Ok(District), + "state" => Ok(State), + _ => Err(()), + } + } +} +impl AsRef for TaxProductResourceJurisdictionLevel { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductResourceJurisdictionLevel { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceJurisdictionLevel { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceJurisdictionLevel { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceJurisdictionLevel { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TaxProductResourceJurisdictionLevel") + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_line_item_tax_breakdown/mod.rs b/generated/stripe_misc/src/tax_product_resource_line_item_tax_breakdown/mod.rs new file mode 100644 index 000000000..6a59c2f05 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_line_item_tax_breakdown/mod.rs @@ -0,0 +1,184 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceLineItemTaxBreakdown { + /// The amount of tax, in integer cents. + pub amount: i64, + pub jurisdiction: stripe_misc::TaxProductResourceJurisdiction, + /// Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). + pub sourcing: TaxProductResourceLineItemTaxBreakdownSourcing, + /// Details regarding the rate for this tax. + /// + /// This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. + pub tax_rate_details: Option, + /// The reasoning behind this tax, for example, if the product is tax exempt. + /// + /// The possible values for this field may be extended as new tax rules are supported. + pub taxability_reason: TaxProductResourceLineItemTaxBreakdownTaxabilityReason, + /// The amount on which tax is calculated, in integer cents. + pub taxable_amount: i64, +} +/// Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceLineItemTaxBreakdownSourcing { + Destination, + Origin, +} +impl TaxProductResourceLineItemTaxBreakdownSourcing { + pub fn as_str(self) -> &'static str { + use TaxProductResourceLineItemTaxBreakdownSourcing::*; + match self { + Destination => "destination", + Origin => "origin", + } + } +} + +impl std::str::FromStr for TaxProductResourceLineItemTaxBreakdownSourcing { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceLineItemTaxBreakdownSourcing::*; + match s { + "destination" => Ok(Destination), + "origin" => Ok(Origin), + _ => Err(()), + } + } +} +impl AsRef for TaxProductResourceLineItemTaxBreakdownSourcing { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownSourcing { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceLineItemTaxBreakdownSourcing { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceLineItemTaxBreakdownSourcing { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceLineItemTaxBreakdownSourcing { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceLineItemTaxBreakdownSourcing", + ) + }) + } +} +/// The reasoning behind this tax, for example, if the product is tax exempt. +/// +/// The possible values for this field may be extended as new tax rules are supported. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + CustomerExempt, + NotCollecting, + NotSubjectToTax, + NotSupported, + PortionProductExempt, + PortionReducedRated, + PortionStandardRated, + ProductExempt, + ProductExemptHoliday, + ProportionallyRated, + ReducedRated, + ReverseCharge, + StandardRated, + TaxableBasisReduced, + ZeroRated, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + pub fn as_str(self) -> &'static str { + use TaxProductResourceLineItemTaxBreakdownTaxabilityReason::*; + match self { + CustomerExempt => "customer_exempt", + NotCollecting => "not_collecting", + NotSubjectToTax => "not_subject_to_tax", + NotSupported => "not_supported", + PortionProductExempt => "portion_product_exempt", + PortionReducedRated => "portion_reduced_rated", + PortionStandardRated => "portion_standard_rated", + ProductExempt => "product_exempt", + ProductExemptHoliday => "product_exempt_holiday", + ProportionallyRated => "proportionally_rated", + ReducedRated => "reduced_rated", + ReverseCharge => "reverse_charge", + StandardRated => "standard_rated", + TaxableBasisReduced => "taxable_basis_reduced", + ZeroRated => "zero_rated", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceLineItemTaxBreakdownTaxabilityReason::*; + match s { + "customer_exempt" => Ok(CustomerExempt), + "not_collecting" => Ok(NotCollecting), + "not_subject_to_tax" => Ok(NotSubjectToTax), + "not_supported" => Ok(NotSupported), + "portion_product_exempt" => Ok(PortionProductExempt), + "portion_reduced_rated" => Ok(PortionReducedRated), + "portion_standard_rated" => Ok(PortionStandardRated), + "product_exempt" => Ok(ProductExempt), + "product_exempt_holiday" => Ok(ProductExemptHoliday), + "proportionally_rated" => Ok(ProportionallyRated), + "reduced_rated" => Ok(ReducedRated), + "reverse_charge" => Ok(ReverseCharge), + "standard_rated" => Ok(StandardRated), + "taxable_basis_reduced" => Ok(TaxableBasisReduced), + "zero_rated" => Ok(ZeroRated), + _ => Err(()), + } + } +} +impl AsRef for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s) + .unwrap_or(TaxProductResourceLineItemTaxBreakdownTaxabilityReason::Unknown)) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_line_item_tax_rate_details/mod.rs b/generated/stripe_misc/src/tax_product_resource_line_item_tax_rate_details/mod.rs new file mode 100644 index 000000000..cc5942f0e --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_line_item_tax_rate_details/mod.rs @@ -0,0 +1,105 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceLineItemTaxRateDetails { + /// A localized display name for tax type, intended to be human-readable. + /// + /// For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". + pub display_name: String, + /// The tax rate percentage as a string. + /// + /// For example, 8.5% is represented as "8.5". + pub percentage_decimal: String, + /// The tax type, such as `vat` or `sales_tax`. + pub tax_type: TaxProductResourceLineItemTaxRateDetailsTaxType, +} +/// The tax type, such as `vat` or `sales_tax`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceLineItemTaxRateDetailsTaxType { + AmusementTax, + CommunicationsTax, + Gst, + Hst, + Igst, + Jct, + LeaseTax, + Pst, + Qst, + Rst, + SalesTax, + Vat, +} +impl TaxProductResourceLineItemTaxRateDetailsTaxType { + pub fn as_str(self) -> &'static str { + use TaxProductResourceLineItemTaxRateDetailsTaxType::*; + match self { + AmusementTax => "amusement_tax", + CommunicationsTax => "communications_tax", + Gst => "gst", + Hst => "hst", + Igst => "igst", + Jct => "jct", + LeaseTax => "lease_tax", + Pst => "pst", + Qst => "qst", + Rst => "rst", + SalesTax => "sales_tax", + Vat => "vat", + } + } +} + +impl std::str::FromStr for TaxProductResourceLineItemTaxRateDetailsTaxType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceLineItemTaxRateDetailsTaxType::*; + match s { + "amusement_tax" => Ok(AmusementTax), + "communications_tax" => Ok(CommunicationsTax), + "gst" => Ok(Gst), + "hst" => Ok(Hst), + "igst" => Ok(Igst), + "jct" => Ok(Jct), + "lease_tax" => Ok(LeaseTax), + "pst" => Ok(Pst), + "qst" => Ok(Qst), + "rst" => Ok(Rst), + "sales_tax" => Ok(SalesTax), + "vat" => Ok(Vat), + _ => Err(()), + } + } +} +impl AsRef for TaxProductResourceLineItemTaxRateDetailsTaxType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductResourceLineItemTaxRateDetailsTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceLineItemTaxRateDetailsTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceLineItemTaxRateDetailsTaxType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceLineItemTaxRateDetailsTaxType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceLineItemTaxRateDetailsTaxType", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_postal_address/mod.rs b/generated/stripe_misc/src/tax_product_resource_postal_address/mod.rs new file mode 100644 index 000000000..74549535f --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_postal_address/mod.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourcePostalAddress { + /// City, district, suburb, town, or village. + pub city: Option, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: String, + /// Address line 1 (e.g., street, PO Box, or company name). + pub line1: Option, + /// Address line 2 (e.g., apartment, suite, unit, or building). + pub line2: Option, + /// ZIP or postal code. + pub postal_code: Option, + /// State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. + /// + /// Example: "NY" or "TX". + pub state: Option, +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_breakdown/mod.rs b/generated/stripe_misc/src/tax_product_resource_tax_breakdown/mod.rs new file mode 100644 index 000000000..739c5083b --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_breakdown/mod.rs @@ -0,0 +1,117 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxBreakdown { + /// The amount of tax, in integer cents. + pub amount: i64, + /// Specifies whether the tax amount is included in the line item amount. + pub inclusive: bool, + pub tax_rate_details: stripe_misc::TaxProductResourceTaxRateDetails, + /// The reasoning behind this tax, for example, if the product is tax exempt. + /// + /// We might extend the possible values for this field to support new tax rules. + pub taxability_reason: TaxProductResourceTaxBreakdownTaxabilityReason, + /// The amount on which tax is calculated, in integer cents. + pub taxable_amount: i64, +} +/// The reasoning behind this tax, for example, if the product is tax exempt. +/// +/// We might extend the possible values for this field to support new tax rules. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum TaxProductResourceTaxBreakdownTaxabilityReason { + CustomerExempt, + NotCollecting, + NotSubjectToTax, + NotSupported, + PortionProductExempt, + PortionReducedRated, + PortionStandardRated, + ProductExempt, + ProductExemptHoliday, + ProportionallyRated, + ReducedRated, + ReverseCharge, + StandardRated, + TaxableBasisReduced, + ZeroRated, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl TaxProductResourceTaxBreakdownTaxabilityReason { + pub fn as_str(self) -> &'static str { + use TaxProductResourceTaxBreakdownTaxabilityReason::*; + match self { + CustomerExempt => "customer_exempt", + NotCollecting => "not_collecting", + NotSubjectToTax => "not_subject_to_tax", + NotSupported => "not_supported", + PortionProductExempt => "portion_product_exempt", + PortionReducedRated => "portion_reduced_rated", + PortionStandardRated => "portion_standard_rated", + ProductExempt => "product_exempt", + ProductExemptHoliday => "product_exempt_holiday", + ProportionallyRated => "proportionally_rated", + ReducedRated => "reduced_rated", + ReverseCharge => "reverse_charge", + StandardRated => "standard_rated", + TaxableBasisReduced => "taxable_basis_reduced", + ZeroRated => "zero_rated", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for TaxProductResourceTaxBreakdownTaxabilityReason { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceTaxBreakdownTaxabilityReason::*; + match s { + "customer_exempt" => Ok(CustomerExempt), + "not_collecting" => Ok(NotCollecting), + "not_subject_to_tax" => Ok(NotSubjectToTax), + "not_supported" => Ok(NotSupported), + "portion_product_exempt" => Ok(PortionProductExempt), + "portion_reduced_rated" => Ok(PortionReducedRated), + "portion_standard_rated" => Ok(PortionStandardRated), + "product_exempt" => Ok(ProductExempt), + "product_exempt_holiday" => Ok(ProductExemptHoliday), + "proportionally_rated" => Ok(ProportionallyRated), + "reduced_rated" => Ok(ReducedRated), + "reverse_charge" => Ok(ReverseCharge), + "standard_rated" => Ok(StandardRated), + "taxable_basis_reduced" => Ok(TaxableBasisReduced), + "zero_rated" => Ok(ZeroRated), + _ => Err(()), + } + } +} +impl AsRef for TaxProductResourceTaxBreakdownTaxabilityReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductResourceTaxBreakdownTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceTaxBreakdownTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceTaxBreakdownTaxabilityReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceTaxBreakdownTaxabilityReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(TaxProductResourceTaxBreakdownTaxabilityReason::Unknown)) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_calculation/mod.rs b/generated/stripe_misc/src/tax_product_resource_tax_calculation/mod.rs new file mode 100644 index 000000000..2a61026ac --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_calculation/mod.rs @@ -0,0 +1,46 @@ +/// A Tax Calculation allows you to calculate the tax to collect from your customer. +/// +/// Related guide: [Calculate tax in your custom payment flow](https://stripe.com/docs/tax/custom) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxCalculation { + /// Total after taxes. + pub amount_total: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource. + pub customer: Option, + pub customer_details: stripe_misc::TaxProductResourceCustomerDetails, + /// Timestamp of date at which the tax calculation will expire. + pub expires_at: Option, + /// Unique identifier for the calculation. + pub id: Option, + /// The list of items the customer is purchasing. + pub line_items: stripe_types::List, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The shipping cost details for the calculation. + pub shipping_cost: Option, + /// The amount of tax to be collected on top of the line item prices. + pub tax_amount_exclusive: i64, + /// The amount of tax already included in the line item prices. + pub tax_amount_inclusive: i64, + /// Breakdown of individual tax amounts that add up to the total. + pub tax_breakdown: Vec, + /// Timestamp of date at which the tax rules and rates in effect applies for the calculation. + pub tax_date: stripe_types::Timestamp, +} +impl stripe_types::Object for TaxProductResourceTaxCalculation { + type Id = Option; + fn id(&self) -> Option<&str> { + self.id.as_deref() + } +} +stripe_types::def_id!(TaxCalculationId); +#[cfg(feature = "tax_product_resource_tax_calculation")] +mod requests; +#[cfg(feature = "tax_product_resource_tax_calculation")] +pub use requests::*; diff --git a/generated/stripe_misc/src/tax_product_resource_tax_calculation/requests.rs b/generated/stripe_misc/src/tax_product_resource_tax_calculation/requests.rs new file mode 100644 index 000000000..89cdfe9e7 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_calculation/requests.rs @@ -0,0 +1,722 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductResourceTaxCalculation<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of an existing customer to use for this calculation. + /// + /// If provided, the customer's address and tax IDs are copied to `customer_details`. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Details about the customer, including address and tax IDs. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_details: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A list of items the customer is purchasing. + pub line_items: &'a [CreateTaxProductResourceTaxCalculationLineItems<'a>], + /// Shipping cost details to be used for the calculation. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_cost: Option>, + /// Timestamp of date at which the tax rules and rates in effect applies for the calculation. + /// + /// Measured in seconds since the Unix epoch. + /// Can be up to 48 hours in the past, and up to 48 hours in the future. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_date: Option, +} +impl<'a> CreateTaxProductResourceTaxCalculation<'a> { + pub fn new( + currency: stripe_types::Currency, + line_items: &'a [CreateTaxProductResourceTaxCalculationLineItems<'a>], + ) -> Self { + Self { + currency, + customer: Default::default(), + customer_details: Default::default(), + expand: Default::default(), + line_items, + shipping_cost: Default::default(), + tax_date: Default::default(), + } + } +} +/// Details about the customer, including address and tax IDs. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTaxProductResourceTaxCalculationCustomerDetails<'a> { + /// The customer's postal address (for example, home or business location). + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The type of customer address provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_source: Option, + /// The customer's IP address (IPv4 or IPv6). + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_address: Option<&'a str>, + /// The customer's tax IDs. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_ids: Option<&'a [CreateTaxProductResourceTaxCalculationCustomerDetailsTaxIds<'a>]>, + /// Overrides the tax calculation result to allow you to not collect tax from your customer. + /// + /// Use this if you've manually checked your customer's tax exemptions. + /// Prefer providing the customer's `tax_ids` where possible, which automatically determines whether `reverse_charge` applies. + #[serde(skip_serializing_if = "Option::is_none")] + pub taxability_override: + Option, +} +impl<'a> CreateTaxProductResourceTaxCalculationCustomerDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's postal address (for example, home or business location). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductResourceTaxCalculationCustomerDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: &'a str, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + /// + /// We recommend sending [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code value when possible. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateTaxProductResourceTaxCalculationCustomerDetailsAddress<'a> { + pub fn new(country: &'a str) -> Self { + Self { + city: Default::default(), + country, + line1: Default::default(), + line2: Default::default(), + postal_code: Default::default(), + state: Default::default(), + } + } +} +/// The type of customer address provided. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductResourceTaxCalculationCustomerDetailsAddressSource { + Billing, + Shipping, +} +impl CreateTaxProductResourceTaxCalculationCustomerDetailsAddressSource { + pub fn as_str(self) -> &'static str { + use CreateTaxProductResourceTaxCalculationCustomerDetailsAddressSource::*; + match self { + Billing => "billing", + Shipping => "shipping", + } + } +} + +impl std::str::FromStr for CreateTaxProductResourceTaxCalculationCustomerDetailsAddressSource { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductResourceTaxCalculationCustomerDetailsAddressSource::*; + match s { + "billing" => Ok(Billing), + "shipping" => Ok(Shipping), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductResourceTaxCalculationCustomerDetailsAddressSource { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductResourceTaxCalculationCustomerDetailsAddressSource { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductResourceTaxCalculationCustomerDetailsAddressSource { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductResourceTaxCalculationCustomerDetailsAddressSource { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's tax IDs. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductResourceTaxCalculationCustomerDetailsTaxIds<'a> { + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. + #[serde(rename = "type")] + pub type_: CreateTaxProductResourceTaxCalculationCustomerDetailsTaxIdsType, + /// Value of the tax ID. + pub value: &'a str, +} +impl<'a> CreateTaxProductResourceTaxCalculationCustomerDetailsTaxIds<'a> { + pub fn new( + type_: CreateTaxProductResourceTaxCalculationCustomerDetailsTaxIdsType, + value: &'a str, + ) -> Self { + Self { type_, value } + } +} +/// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateTaxProductResourceTaxCalculationCustomerDetailsTaxIdsType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateTaxProductResourceTaxCalculationCustomerDetailsTaxIdsType { + pub fn as_str(self) -> &'static str { + use CreateTaxProductResourceTaxCalculationCustomerDetailsTaxIdsType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateTaxProductResourceTaxCalculationCustomerDetailsTaxIdsType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductResourceTaxCalculationCustomerDetailsTaxIdsType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductResourceTaxCalculationCustomerDetailsTaxIdsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductResourceTaxCalculationCustomerDetailsTaxIdsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductResourceTaxCalculationCustomerDetailsTaxIdsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductResourceTaxCalculationCustomerDetailsTaxIdsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Overrides the tax calculation result to allow you to not collect tax from your customer. +/// +/// Use this if you've manually checked your customer's tax exemptions. +/// Prefer providing the customer's `tax_ids` where possible, which automatically determines whether `reverse_charge` applies. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductResourceTaxCalculationCustomerDetailsTaxabilityOverride { + CustomerExempt, + None, + ReverseCharge, +} +impl CreateTaxProductResourceTaxCalculationCustomerDetailsTaxabilityOverride { + pub fn as_str(self) -> &'static str { + use CreateTaxProductResourceTaxCalculationCustomerDetailsTaxabilityOverride::*; + match self { + CustomerExempt => "customer_exempt", + None => "none", + ReverseCharge => "reverse_charge", + } + } +} + +impl std::str::FromStr for CreateTaxProductResourceTaxCalculationCustomerDetailsTaxabilityOverride { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductResourceTaxCalculationCustomerDetailsTaxabilityOverride::*; + match s { + "customer_exempt" => Ok(CustomerExempt), + "none" => Ok(None), + "reverse_charge" => Ok(ReverseCharge), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductResourceTaxCalculationCustomerDetailsTaxabilityOverride { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductResourceTaxCalculationCustomerDetailsTaxabilityOverride { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductResourceTaxCalculationCustomerDetailsTaxabilityOverride { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductResourceTaxCalculationCustomerDetailsTaxabilityOverride { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A list of items the customer is purchasing. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxProductResourceTaxCalculationLineItems<'a> { + /// A positive integer in cents representing the line item's total price. + /// + /// If `tax_behavior=inclusive`, then this amount includes taxes. + /// Otherwise, taxes are calculated on top of this amount. + pub amount: i64, + /// If provided, the product's `tax_code` will be used as the line item's `tax_code`. + #[serde(skip_serializing_if = "Option::is_none")] + pub product: Option<&'a str>, + /// The number of units of the item being purchased. + /// + /// Used to calculate the per-unit price from the total `amount` for the line. + /// For example, if `amount=100` and `quantity=4`, the calculated unit price is 25. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A custom identifier for this line item, which must be unique across the line items in the calculation. + /// + /// The reference helps identify each line item in exported [tax reports](https://stripe.com/docs/tax/reports). + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// Specifies whether the `amount` includes taxes. + /// + /// Defaults to `exclusive`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID to use for this line item. + /// + /// If not provided, we will use the tax code from the provided `product` param. + /// If neither `tax_code` nor `product` is provided, we will use the default tax code from your Tax Settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, +} +impl<'a> CreateTaxProductResourceTaxCalculationLineItems<'a> { + pub fn new(amount: i64) -> Self { + Self { + amount, + product: Default::default(), + quantity: Default::default(), + reference: Default::default(), + tax_behavior: Default::default(), + tax_code: Default::default(), + } + } +} +/// Specifies whether the `amount` includes taxes. +/// +/// Defaults to `exclusive`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductResourceTaxCalculationLineItemsTaxBehavior { + Exclusive, + Inclusive, +} +impl CreateTaxProductResourceTaxCalculationLineItemsTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateTaxProductResourceTaxCalculationLineItemsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + } + } +} + +impl std::str::FromStr for CreateTaxProductResourceTaxCalculationLineItemsTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductResourceTaxCalculationLineItemsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductResourceTaxCalculationLineItemsTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductResourceTaxCalculationLineItemsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductResourceTaxCalculationLineItemsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductResourceTaxCalculationLineItemsTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Shipping cost details to be used for the calculation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTaxProductResourceTaxCalculationShippingCost<'a> { + /// A positive integer in cents representing the shipping charge. + /// + /// If `tax_behavior=inclusive`, then this amount includes taxes. + /// Otherwise, taxes are calculated on top of this amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// If provided, the [shipping rate](https://stripe.com/docs/api/shipping_rates/object)'s `amount`, `tax_code` and `tax_behavior` are used. + /// + /// If you provide a shipping rate, then you cannot pass the `amount`, `tax_code`, or `tax_behavior` parameters. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option<&'a str>, + /// Specifies whether the `amount` includes taxes. + /// + /// If `tax_behavior=inclusive`, then the amount includes taxes. + /// Defaults to `exclusive`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// The [tax code](https://stripe.com/docs/tax/tax-categories) used to calculate tax on shipping. + /// + /// If not provided, the default shipping tax code from your [Tax Settings](/settings/tax) is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, +} +impl<'a> CreateTaxProductResourceTaxCalculationShippingCost<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Specifies whether the `amount` includes taxes. +/// +/// If `tax_behavior=inclusive`, then the amount includes taxes. +/// Defaults to `exclusive`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxProductResourceTaxCalculationShippingCostTaxBehavior { + Exclusive, + Inclusive, +} +impl CreateTaxProductResourceTaxCalculationShippingCostTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateTaxProductResourceTaxCalculationShippingCostTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + } + } +} + +impl std::str::FromStr for CreateTaxProductResourceTaxCalculationShippingCostTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxProductResourceTaxCalculationShippingCostTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxProductResourceTaxCalculationShippingCostTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxProductResourceTaxCalculationShippingCostTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxProductResourceTaxCalculationShippingCostTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxProductResourceTaxCalculationShippingCostTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateTaxProductResourceTaxCalculation<'a> { + /// Calculates tax based on input and returns a Tax `Calculation` object. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/tax/calculations", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListLineItemsTaxProductResourceTaxCalculation<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListLineItemsTaxProductResourceTaxCalculation<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListLineItemsTaxProductResourceTaxCalculation<'a> { + /// Retrieves the line items of a persisted tax calculation as a collection. + pub fn send( + &self, + client: &stripe::Client, + calculation: &str, + ) -> stripe::Response> + { + client.get_query(&format!("/tax/calculations/{calculation}/line_items"), self) + } + pub fn paginate( + self, + calculation: &str, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params( + &format!("/tax/calculations/{calculation}/line_items"), + self, + ) + } +} +impl<'a> stripe::PaginationParams for ListLineItemsTaxProductResourceTaxCalculation<'a> {} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_calculation_line_item/mod.rs b/generated/stripe_misc/src/tax_product_resource_tax_calculation_line_item/mod.rs new file mode 100644 index 000000000..45596cc6a --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_calculation_line_item/mod.rs @@ -0,0 +1,101 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxCalculationLineItem { + /// The line item amount in integer cents. + /// + /// If `tax_behavior=inclusive`, then this amount includes taxes. + /// Otherwise, taxes were calculated on top of this amount. + pub amount: i64, + /// The amount of tax calculated for this line item, in integer cents. + pub amount_tax: i64, + /// Unique identifier for the object. + pub id: stripe_misc::tax_product_resource_tax_calculation_line_item::TaxCalculationLineItemId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The ID of an existing [Product](https://stripe.com/docs/api/products/object). + pub product: Option, + /// The number of units of the item being purchased. + /// + /// For reversals, this is the quantity reversed. + pub quantity: u64, + /// A custom identifier for this line item. + pub reference: Option, + /// Specifies whether the `amount` includes taxes. + /// + /// If `tax_behavior=inclusive`, then the amount includes taxes. + pub tax_behavior: TaxProductResourceTaxCalculationLineItemTaxBehavior, + /// Detailed account of taxes relevant to this line item. + pub tax_breakdown: Option>, + /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource. + pub tax_code: String, +} +/// Specifies whether the `amount` includes taxes. +/// +/// If `tax_behavior=inclusive`, then the amount includes taxes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceTaxCalculationLineItemTaxBehavior { + Exclusive, + Inclusive, +} +impl TaxProductResourceTaxCalculationLineItemTaxBehavior { + pub fn as_str(self) -> &'static str { + use TaxProductResourceTaxCalculationLineItemTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + } + } +} + +impl std::str::FromStr for TaxProductResourceTaxCalculationLineItemTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceTaxCalculationLineItemTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + _ => Err(()), + } + } +} +impl AsRef for TaxProductResourceTaxCalculationLineItemTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductResourceTaxCalculationLineItemTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceTaxCalculationLineItemTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceTaxCalculationLineItemTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceTaxCalculationLineItemTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceTaxCalculationLineItemTaxBehavior", + ) + }) + } +} +impl stripe_types::Object for TaxProductResourceTaxCalculationLineItem { + type Id = stripe_misc::tax_product_resource_tax_calculation_line_item::TaxCalculationLineItemId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TaxCalculationLineItemId); diff --git a/generated/stripe_misc/src/tax_product_resource_tax_calculation_shipping_cost/mod.rs b/generated/stripe_misc/src/tax_product_resource_tax_calculation_shipping_cost/mod.rs new file mode 100644 index 000000000..1e127f24b --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_calculation_shipping_cost/mod.rs @@ -0,0 +1,86 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxCalculationShippingCost { + /// The shipping amount in integer cents. + /// + /// If `tax_behavior=inclusive`, then this amount includes taxes. + /// Otherwise, taxes were calculated on top of this amount. + pub amount: i64, + /// The amount of tax calculated for shipping, in integer cents. + pub amount_tax: i64, + /// The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option, + /// Specifies whether the `amount` includes taxes. + /// + /// If `tax_behavior=inclusive`, then the amount includes taxes. + pub tax_behavior: TaxProductResourceTaxCalculationShippingCostTaxBehavior, + /// Detailed account of taxes relevant to shipping cost. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_breakdown: Option>, + /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for shipping. + pub tax_code: String, +} +/// Specifies whether the `amount` includes taxes. +/// +/// If `tax_behavior=inclusive`, then the amount includes taxes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceTaxCalculationShippingCostTaxBehavior { + Exclusive, + Inclusive, +} +impl TaxProductResourceTaxCalculationShippingCostTaxBehavior { + pub fn as_str(self) -> &'static str { + use TaxProductResourceTaxCalculationShippingCostTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + } + } +} + +impl std::str::FromStr for TaxProductResourceTaxCalculationShippingCostTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceTaxCalculationShippingCostTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + _ => Err(()), + } + } +} +impl AsRef for TaxProductResourceTaxCalculationShippingCostTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductResourceTaxCalculationShippingCostTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceTaxCalculationShippingCostTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceTaxCalculationShippingCostTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceTaxCalculationShippingCostTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceTaxCalculationShippingCostTaxBehavior", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_rate_details/mod.rs b/generated/stripe_misc/src/tax_product_resource_tax_rate_details/mod.rs new file mode 100644 index 000000000..722ca8e9a --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_rate_details/mod.rs @@ -0,0 +1,103 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxRateDetails { + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: Option, + /// The tax rate percentage as a string. + /// + /// For example, 8.5% is represented as `"8.5"`. + pub percentage_decimal: String, + /// State, county, province, or region. + pub state: Option, + /// The tax type, such as `vat` or `sales_tax`. + pub tax_type: Option, +} +/// The tax type, such as `vat` or `sales_tax`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceTaxRateDetailsTaxType { + AmusementTax, + CommunicationsTax, + Gst, + Hst, + Igst, + Jct, + LeaseTax, + Pst, + Qst, + Rst, + SalesTax, + Vat, +} +impl TaxProductResourceTaxRateDetailsTaxType { + pub fn as_str(self) -> &'static str { + use TaxProductResourceTaxRateDetailsTaxType::*; + match self { + AmusementTax => "amusement_tax", + CommunicationsTax => "communications_tax", + Gst => "gst", + Hst => "hst", + Igst => "igst", + Jct => "jct", + LeaseTax => "lease_tax", + Pst => "pst", + Qst => "qst", + Rst => "rst", + SalesTax => "sales_tax", + Vat => "vat", + } + } +} + +impl std::str::FromStr for TaxProductResourceTaxRateDetailsTaxType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceTaxRateDetailsTaxType::*; + match s { + "amusement_tax" => Ok(AmusementTax), + "communications_tax" => Ok(CommunicationsTax), + "gst" => Ok(Gst), + "hst" => Ok(Hst), + "igst" => Ok(Igst), + "jct" => Ok(Jct), + "lease_tax" => Ok(LeaseTax), + "pst" => Ok(Pst), + "qst" => Ok(Qst), + "rst" => Ok(Rst), + "sales_tax" => Ok(SalesTax), + "vat" => Ok(Vat), + _ => Err(()), + } + } +} +impl AsRef for TaxProductResourceTaxRateDetailsTaxType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductResourceTaxRateDetailsTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceTaxRateDetailsTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceTaxRateDetailsTaxType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceTaxRateDetailsTaxType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TaxProductResourceTaxRateDetailsTaxType") + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_settings/mod.rs b/generated/stripe_misc/src/tax_product_resource_tax_settings/mod.rs new file mode 100644 index 000000000..a1df4ff7f --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_settings/mod.rs @@ -0,0 +1,84 @@ +/// You can use Tax `Settings` to manage configurations used by Stripe Tax calculations. +/// +/// Related guide: [Using the Settings API](https://stripe.com/docs/tax/settings-api) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxSettings { + pub defaults: stripe_misc::TaxProductResourceTaxSettingsDefaults, + /// The place where your business is located. + pub head_office: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The `active` status indicates you have all required settings to calculate tax. + /// + /// A status can transition out of `active` when new required settings are introduced. + pub status: TaxProductResourceTaxSettingsStatus, + pub status_details: stripe_misc::TaxProductResourceTaxSettingsStatusDetails, +} +/// The `active` status indicates you have all required settings to calculate tax. +/// +/// A status can transition out of `active` when new required settings are introduced. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceTaxSettingsStatus { + Active, + Pending, +} +impl TaxProductResourceTaxSettingsStatus { + pub fn as_str(self) -> &'static str { + use TaxProductResourceTaxSettingsStatus::*; + match self { + Active => "active", + Pending => "pending", + } + } +} + +impl std::str::FromStr for TaxProductResourceTaxSettingsStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceTaxSettingsStatus::*; + match s { + "active" => Ok(Active), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for TaxProductResourceTaxSettingsStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductResourceTaxSettingsStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceTaxSettingsStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceTaxSettingsStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceTaxSettingsStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TaxProductResourceTaxSettingsStatus") + }) + } +} +#[cfg(feature = "tax_product_resource_tax_settings")] +mod requests; +#[cfg(feature = "tax_product_resource_tax_settings")] +pub use requests::*; diff --git a/generated/stripe_misc/src/tax_product_resource_tax_settings/requests.rs b/generated/stripe_misc/src/tax_product_resource_tax_settings/requests.rs new file mode 100644 index 000000000..fe64a21a0 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_settings/requests.rs @@ -0,0 +1,163 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveForMyAccountTaxProductResourceTaxSettings<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveForMyAccountTaxProductResourceTaxSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveForMyAccountTaxProductResourceTaxSettings<'a> { + /// Retrieves Tax `Settings` for a merchant. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.get_query("/tax/settings", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTaxProductResourceTaxSettings<'a> { + /// Default configuration to be used on Stripe Tax calculations. + #[serde(skip_serializing_if = "Option::is_none")] + pub defaults: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The place where your business is located. + #[serde(skip_serializing_if = "Option::is_none")] + pub head_office: Option>, +} +impl<'a> UpdateTaxProductResourceTaxSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Default configuration to be used on Stripe Tax calculations. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTaxProductResourceTaxSettingsDefaults<'a> { + /// Specifies the default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) to be used when the item's price has unspecified tax behavior. + /// + /// One of inclusive, exclusive, or inferred_by_currency. + /// Once specified, it cannot be changed back to null. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, +} +impl<'a> UpdateTaxProductResourceTaxSettingsDefaults<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Specifies the default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) to be used when the item's price has unspecified tax behavior. +/// +/// One of inclusive, exclusive, or inferred_by_currency. +/// Once specified, it cannot be changed back to null. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateTaxProductResourceTaxSettingsDefaultsTaxBehavior { + Exclusive, + Inclusive, + InferredByCurrency, +} +impl UpdateTaxProductResourceTaxSettingsDefaultsTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateTaxProductResourceTaxSettingsDefaultsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + InferredByCurrency => "inferred_by_currency", + } + } +} + +impl std::str::FromStr for UpdateTaxProductResourceTaxSettingsDefaultsTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateTaxProductResourceTaxSettingsDefaultsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "inferred_by_currency" => Ok(InferredByCurrency), + _ => Err(()), + } + } +} +impl AsRef for UpdateTaxProductResourceTaxSettingsDefaultsTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateTaxProductResourceTaxSettingsDefaultsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateTaxProductResourceTaxSettingsDefaultsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateTaxProductResourceTaxSettingsDefaultsTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The place where your business is located. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTaxProductResourceTaxSettingsHeadOffice<'a> { + /// The location of the business for tax purposes. + pub address: UpdateTaxProductResourceTaxSettingsHeadOfficeAddress<'a>, +} +impl<'a> UpdateTaxProductResourceTaxSettingsHeadOffice<'a> { + pub fn new(address: UpdateTaxProductResourceTaxSettingsHeadOfficeAddress<'a>) -> Self { + Self { address } + } +} +/// The location of the business for tax purposes. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTaxProductResourceTaxSettingsHeadOfficeAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. + /// + /// Example: "NY" or "TX". + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateTaxProductResourceTaxSettingsHeadOfficeAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateTaxProductResourceTaxSettings<'a> { + /// Updates Tax `Settings` parameters used in tax calculations. + /// + /// All parameters are editable but none can be removed once set. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/tax/settings", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_settings_defaults/mod.rs b/generated/stripe_misc/src/tax_product_resource_tax_settings_defaults/mod.rs new file mode 100644 index 000000000..5214647e9 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_settings_defaults/mod.rs @@ -0,0 +1,76 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxSettingsDefaults { + /// Default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) used to specify whether the price is considered inclusive of taxes or exclusive of taxes. + /// + /// If the item's price has a tax behavior set, it will take precedence over the default tax behavior. + pub tax_behavior: Option, + /// Default [tax code](https://stripe.com/docs/tax/tax-categories) used to classify your products and prices. + pub tax_code: Option, +} +/// Default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) used to specify whether the price is considered inclusive of taxes or exclusive of taxes. +/// +/// If the item's price has a tax behavior set, it will take precedence over the default tax behavior. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceTaxSettingsDefaultsTaxBehavior { + Exclusive, + Inclusive, + InferredByCurrency, +} +impl TaxProductResourceTaxSettingsDefaultsTaxBehavior { + pub fn as_str(self) -> &'static str { + use TaxProductResourceTaxSettingsDefaultsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + InferredByCurrency => "inferred_by_currency", + } + } +} + +impl std::str::FromStr for TaxProductResourceTaxSettingsDefaultsTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceTaxSettingsDefaultsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "inferred_by_currency" => Ok(InferredByCurrency), + _ => Err(()), + } + } +} +impl AsRef for TaxProductResourceTaxSettingsDefaultsTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductResourceTaxSettingsDefaultsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceTaxSettingsDefaultsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceTaxSettingsDefaultsTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceTaxSettingsDefaultsTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceTaxSettingsDefaultsTaxBehavior", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_settings_head_office/mod.rs b/generated/stripe_misc/src/tax_product_resource_tax_settings_head_office/mod.rs new file mode 100644 index 000000000..d5d81c955 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_settings_head_office/mod.rs @@ -0,0 +1,4 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxSettingsHeadOffice { + pub address: stripe_types::Address, +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details/mod.rs b/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details/mod.rs new file mode 100644 index 000000000..f31f4308f --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxSettingsStatusDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pending: Option, +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details_resource_active/mod.rs b/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details_resource_active/mod.rs new file mode 100644 index 000000000..f55dff9ac --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details_resource_active/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxSettingsStatusDetailsResourceActive {} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details_resource_pending/mod.rs b/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details_resource_pending/mod.rs new file mode 100644 index 000000000..84af5604a --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details_resource_pending/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxSettingsStatusDetailsResourcePending { + /// The list of missing fields that are required to perform calculations. + /// + /// It includes the entry `head_office` when the status is `pending`. + /// It is recommended to set the optional values even if they aren't listed as required for calculating taxes. + /// Calculations can fail if missing fields aren't explicitly provided on every call. + pub missing_fields: Option>, +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_transaction/mod.rs b/generated/stripe_misc/src/tax_product_resource_tax_transaction/mod.rs new file mode 100644 index 000000000..d296a80c4 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_transaction/mod.rs @@ -0,0 +1,111 @@ +/// A Tax Transaction records the tax collected from or refunded to your customer. +/// +/// Related guide: [Calculate tax in your custom payment flow](https://stripe.com/docs/tax/custom#tax-transaction) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxTransaction { + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource. + pub customer: Option, + pub customer_details: stripe_misc::TaxProductResourceCustomerDetails, + /// Unique identifier for the transaction. + pub id: stripe_misc::tax_product_resource_tax_transaction::TaxTransactionId, + /// The tax collected or refunded, by line item. + pub line_items: stripe_types::List, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// A custom unique identifier, such as 'myOrder_123'. + pub reference: String, + /// If `type=reversal`, contains information about what was reversed. + pub reversal: Option, + /// The shipping cost details for the transaction. + pub shipping_cost: Option, + /// Timestamp of date at which the tax rules and rates in effect applies for the calculation. + pub tax_date: stripe_types::Timestamp, + /// If `reversal`, this transaction reverses an earlier transaction. + #[serde(rename = "type")] + pub type_: TaxProductResourceTaxTransactionType, +} +/// If `reversal`, this transaction reverses an earlier transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceTaxTransactionType { + Reversal, + Transaction, +} +impl TaxProductResourceTaxTransactionType { + pub fn as_str(self) -> &'static str { + use TaxProductResourceTaxTransactionType::*; + match self { + Reversal => "reversal", + Transaction => "transaction", + } + } +} + +impl std::str::FromStr for TaxProductResourceTaxTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceTaxTransactionType::*; + match s { + "reversal" => Ok(Reversal), + "transaction" => Ok(Transaction), + _ => Err(()), + } + } +} +impl AsRef for TaxProductResourceTaxTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductResourceTaxTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceTaxTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceTaxTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceTaxTransactionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TaxProductResourceTaxTransactionType") + }) + } +} +impl stripe_types::Object for TaxProductResourceTaxTransaction { + type Id = stripe_misc::tax_product_resource_tax_transaction::TaxTransactionId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TaxTransactionId); +#[cfg(feature = "tax_product_resource_tax_transaction")] +mod requests; +#[cfg(feature = "tax_product_resource_tax_transaction")] +pub use requests::*; diff --git a/generated/stripe_misc/src/tax_product_resource_tax_transaction/requests.rs b/generated/stripe_misc/src/tax_product_resource_tax_transaction/requests.rs new file mode 100644 index 000000000..592b1914e --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_transaction/requests.rs @@ -0,0 +1,273 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTaxProductResourceTaxTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTaxProductResourceTaxTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTaxProductResourceTaxTransaction<'a> { + /// Retrieves a Tax `Transaction` object. + pub fn send( + &self, + client: &stripe::Client, + transaction: &str, + ) -> stripe::Response { + client.get_query(&format!("/tax/transactions/{transaction}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateReversalTaxProductResourceTaxTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A flat amount to reverse across the entire transaction, in negative integer cents. + /// + /// This value represents the total amount to refund from the transaction, including taxes. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount: Option, + /// The line item amounts to reverse. + #[serde(skip_serializing_if = "Option::is_none")] + pub line_items: Option<&'a [CreateReversalTaxProductResourceTaxTransactionLineItems<'a>]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If `partial`, the provided line item or shipping cost amounts are reversed. + /// + /// If `full`, the original transaction is fully reversed. + pub mode: CreateReversalTaxProductResourceTaxTransactionMode, + /// The ID of the Transaction to partially or fully reverse. + pub original_transaction: &'a str, + /// A custom identifier for this reversal, such as `myOrder_123-refund_1`, which must be unique across all transactions. + /// + /// The reference helps identify this reversal transaction in exported [tax reports](https://stripe.com/docs/tax/reports). + pub reference: &'a str, + /// The shipping cost to reverse. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_cost: Option, +} +impl<'a> CreateReversalTaxProductResourceTaxTransaction<'a> { + pub fn new( + mode: CreateReversalTaxProductResourceTaxTransactionMode, + original_transaction: &'a str, + reference: &'a str, + ) -> Self { + Self { + expand: Default::default(), + flat_amount: Default::default(), + line_items: Default::default(), + metadata: Default::default(), + mode, + original_transaction, + reference, + shipping_cost: Default::default(), + } + } +} +/// The line item amounts to reverse. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateReversalTaxProductResourceTaxTransactionLineItems<'a> { + /// The amount to reverse, in negative integer cents. + pub amount: i64, + /// The amount of tax to reverse, in negative integer cents. + pub amount_tax: i64, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The `id` of the line item to reverse in the original transaction. + pub original_line_item: &'a str, + /// The quantity reversed. + /// + /// Appears in [tax exports](https://stripe.com/docs/tax/reports), but does not affect the amount of tax reversed. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A custom identifier for this line item in the reversal transaction, such as 'L1-refund'. + pub reference: &'a str, +} +impl<'a> CreateReversalTaxProductResourceTaxTransactionLineItems<'a> { + pub fn new( + amount: i64, + amount_tax: i64, + original_line_item: &'a str, + reference: &'a str, + ) -> Self { + Self { + amount, + amount_tax, + metadata: Default::default(), + original_line_item, + quantity: Default::default(), + reference, + } + } +} +/// If `partial`, the provided line item or shipping cost amounts are reversed. +/// +/// If `full`, the original transaction is fully reversed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateReversalTaxProductResourceTaxTransactionMode { + Full, + Partial, +} +impl CreateReversalTaxProductResourceTaxTransactionMode { + pub fn as_str(self) -> &'static str { + use CreateReversalTaxProductResourceTaxTransactionMode::*; + match self { + Full => "full", + Partial => "partial", + } + } +} + +impl std::str::FromStr for CreateReversalTaxProductResourceTaxTransactionMode { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateReversalTaxProductResourceTaxTransactionMode::*; + match s { + "full" => Ok(Full), + "partial" => Ok(Partial), + _ => Err(()), + } + } +} +impl AsRef for CreateReversalTaxProductResourceTaxTransactionMode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateReversalTaxProductResourceTaxTransactionMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateReversalTaxProductResourceTaxTransactionMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateReversalTaxProductResourceTaxTransactionMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The shipping cost to reverse. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateReversalTaxProductResourceTaxTransactionShippingCost { + /// The amount to reverse, in negative integer cents. + pub amount: i64, + /// The amount of tax to reverse, in negative integer cents. + pub amount_tax: i64, +} +impl CreateReversalTaxProductResourceTaxTransactionShippingCost { + pub fn new(amount: i64, amount_tax: i64) -> Self { + Self { amount, amount_tax } + } +} +impl<'a> CreateReversalTaxProductResourceTaxTransaction<'a> { + /// Partially or fully reverses a previously created `Transaction`. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/tax/transactions/create_reversal", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateFromCalculationTaxProductResourceTaxTransaction<'a> { + /// Tax Calculation ID to be used as input when creating the transaction. + pub calculation: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A custom order or sale identifier, such as 'myOrder_123'. + /// + /// Must be unique across all transactions, including reversals. + pub reference: &'a str, +} +impl<'a> CreateFromCalculationTaxProductResourceTaxTransaction<'a> { + pub fn new(calculation: &'a str, reference: &'a str) -> Self { + Self { calculation, expand: Default::default(), metadata: Default::default(), reference } + } +} +impl<'a> CreateFromCalculationTaxProductResourceTaxTransaction<'a> { + /// Creates a Tax `Transaction` from a calculation. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form( + "/tax/transactions/create_from_calculation", + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListLineItemsTaxProductResourceTaxTransaction<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListLineItemsTaxProductResourceTaxTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListLineItemsTaxProductResourceTaxTransaction<'a> { + /// Retrieves the line items of a committed standalone transaction as a collection. + pub fn send( + &self, + client: &stripe::Client, + transaction: &str, + ) -> stripe::Response> + { + client.get_query(&format!("/tax/transactions/{transaction}/line_items"), self) + } + pub fn paginate( + self, + transaction: &str, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params( + &format!("/tax/transactions/{transaction}/line_items"), + self, + ) + } +} +impl<'a> stripe::PaginationParams for ListLineItemsTaxProductResourceTaxTransaction<'a> {} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_transaction_line_item/mod.rs b/generated/stripe_misc/src/tax_product_resource_tax_transaction_line_item/mod.rs new file mode 100644 index 000000000..0ce82e7c2 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_transaction_line_item/mod.rs @@ -0,0 +1,170 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxTransactionLineItem { + /// The line item amount in integer cents. + /// + /// If `tax_behavior=inclusive`, then this amount includes taxes. + /// Otherwise, taxes were calculated on top of this amount. + pub amount: i64, + /// The amount of tax calculated for this line item, in integer cents. + pub amount_tax: i64, + /// Unique identifier for the object. + pub id: stripe_misc::tax_product_resource_tax_transaction_line_item::TaxTransactionLineItemId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// The ID of an existing [Product](https://stripe.com/docs/api/products/object). + pub product: Option, + /// The number of units of the item being purchased. + /// + /// For reversals, this is the quantity reversed. + pub quantity: u64, + /// A custom identifier for this line item in the transaction. + pub reference: String, + /// If `type=reversal`, contains information about what was reversed. + pub reversal: Option, + /// Specifies whether the `amount` includes taxes. + /// + /// If `tax_behavior=inclusive`, then the amount includes taxes. + pub tax_behavior: TaxProductResourceTaxTransactionLineItemTaxBehavior, + /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource. + pub tax_code: String, + /// If `reversal`, this line item reverses an earlier transaction. + #[serde(rename = "type")] + pub type_: TaxProductResourceTaxTransactionLineItemType, +} +/// Specifies whether the `amount` includes taxes. +/// +/// If `tax_behavior=inclusive`, then the amount includes taxes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceTaxTransactionLineItemTaxBehavior { + Exclusive, + Inclusive, +} +impl TaxProductResourceTaxTransactionLineItemTaxBehavior { + pub fn as_str(self) -> &'static str { + use TaxProductResourceTaxTransactionLineItemTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + } + } +} + +impl std::str::FromStr for TaxProductResourceTaxTransactionLineItemTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceTaxTransactionLineItemTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + _ => Err(()), + } + } +} +impl AsRef for TaxProductResourceTaxTransactionLineItemTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductResourceTaxTransactionLineItemTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceTaxTransactionLineItemTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceTaxTransactionLineItemTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceTaxTransactionLineItemTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceTaxTransactionLineItemTaxBehavior", + ) + }) + } +} +/// If `reversal`, this line item reverses an earlier transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceTaxTransactionLineItemType { + Reversal, + Transaction, +} +impl TaxProductResourceTaxTransactionLineItemType { + pub fn as_str(self) -> &'static str { + use TaxProductResourceTaxTransactionLineItemType::*; + match self { + Reversal => "reversal", + Transaction => "transaction", + } + } +} + +impl std::str::FromStr for TaxProductResourceTaxTransactionLineItemType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceTaxTransactionLineItemType::*; + match s { + "reversal" => Ok(Reversal), + "transaction" => Ok(Transaction), + _ => Err(()), + } + } +} +impl AsRef for TaxProductResourceTaxTransactionLineItemType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductResourceTaxTransactionLineItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceTaxTransactionLineItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceTaxTransactionLineItemType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceTaxTransactionLineItemType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceTaxTransactionLineItemType", + ) + }) + } +} +impl stripe_types::Object for TaxProductResourceTaxTransactionLineItem { + type Id = stripe_misc::tax_product_resource_tax_transaction_line_item::TaxTransactionLineItemId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TaxTransactionLineItemId); diff --git a/generated/stripe_misc/src/tax_product_resource_tax_transaction_line_item_resource_reversal/mod.rs b/generated/stripe_misc/src/tax_product_resource_tax_transaction_line_item_resource_reversal/mod.rs new file mode 100644 index 000000000..076e5937d --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_transaction_line_item_resource_reversal/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxTransactionLineItemResourceReversal { + /// The `id` of the line item to reverse in the original transaction. + pub original_line_item: String, +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_transaction_resource_reversal/mod.rs b/generated/stripe_misc/src/tax_product_resource_tax_transaction_resource_reversal/mod.rs new file mode 100644 index 000000000..fee5e9769 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_transaction_resource_reversal/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxTransactionResourceReversal { + /// The `id` of the reversed `Transaction` object. + pub original_transaction: Option, +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_transaction_shipping_cost/mod.rs b/generated/stripe_misc/src/tax_product_resource_tax_transaction_shipping_cost/mod.rs new file mode 100644 index 000000000..575bb5f1e --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_transaction_shipping_cost/mod.rs @@ -0,0 +1,88 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxTransactionShippingCost { + /// The shipping amount in integer cents. + /// + /// If `tax_behavior=inclusive`, then this amount includes taxes. + /// Otherwise, taxes were calculated on top of this amount. + pub amount: i64, + /// The amount of tax calculated for shipping, in integer cents. + pub amount_tax: i64, + /// The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option, + /// Specifies whether the `amount` includes taxes. + /// + /// If `tax_behavior=inclusive`, then the amount includes taxes. + pub tax_behavior: TaxProductResourceTaxTransactionShippingCostTaxBehavior, + /// Detailed account of taxes relevant to shipping cost. + /// + /// (It is not populated for the transaction resource object and will be removed in the next API version.). + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_breakdown: Option>, + /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for shipping. + pub tax_code: String, +} +/// Specifies whether the `amount` includes taxes. +/// +/// If `tax_behavior=inclusive`, then the amount includes taxes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceTaxTransactionShippingCostTaxBehavior { + Exclusive, + Inclusive, +} +impl TaxProductResourceTaxTransactionShippingCostTaxBehavior { + pub fn as_str(self) -> &'static str { + use TaxProductResourceTaxTransactionShippingCostTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + } + } +} + +impl std::str::FromStr for TaxProductResourceTaxTransactionShippingCostTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceTaxTransactionShippingCostTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + _ => Err(()), + } + } +} +impl AsRef for TaxProductResourceTaxTransactionShippingCostTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxProductResourceTaxTransactionShippingCostTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceTaxTransactionShippingCostTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceTaxTransactionShippingCostTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceTaxTransactionShippingCostTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceTaxTransactionShippingCostTaxBehavior", + ) + }) + } +} diff --git a/generated/stripe_misc/src/verification_session_redaction/mod.rs b/generated/stripe_misc/src/verification_session_redaction/mod.rs new file mode 100644 index 000000000..431166389 --- /dev/null +++ b/generated/stripe_misc/src/verification_session_redaction/mod.rs @@ -0,0 +1,65 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct VerificationSessionRedaction { + /// Indicates whether this object and its related objects have been redacted or not. + pub status: VerificationSessionRedactionStatus, +} +/// Indicates whether this object and its related objects have been redacted or not. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum VerificationSessionRedactionStatus { + Processing, + Redacted, +} +impl VerificationSessionRedactionStatus { + pub fn as_str(self) -> &'static str { + use VerificationSessionRedactionStatus::*; + match self { + Processing => "processing", + Redacted => "redacted", + } + } +} + +impl std::str::FromStr for VerificationSessionRedactionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use VerificationSessionRedactionStatus::*; + match s { + "processing" => Ok(Processing), + "redacted" => Ok(Redacted), + _ => Err(()), + } + } +} +impl AsRef for VerificationSessionRedactionStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for VerificationSessionRedactionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for VerificationSessionRedactionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for VerificationSessionRedactionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for VerificationSessionRedactionStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for VerificationSessionRedactionStatus") + }) + } +} diff --git a/generated/stripe_payment/Cargo.toml b/generated/stripe_payment/Cargo.toml new file mode 100644 index 000000000..290b28218 --- /dev/null +++ b/generated/stripe_payment/Cargo.toml @@ -0,0 +1,53 @@ +[package] +name = "stripe_payment" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + +[dependencies] +serde.workspace = true +http-types.workspace = true +smol_str.workspace = true +serde_json.workspace = true +async-stripe = {path = "../../async-stripe"} + +stripe_types = {path = "../../stripe_types"} + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +bank_account = [] +card = [] +payment_link = [] +payment_method = [] +payment_method_config_resource_payment_method_configuration = [] +payment_method_domain_resource_payment_method_domain = [] +source = [] + +full = ["bank_account", +"card", +"payment_link", +"payment_method", +"payment_method_config_resource_payment_method_configuration", +"payment_method_domain_resource_payment_method_domain", +"source"] + diff --git a/generated/stripe_payment/src/bank_account/mod.rs b/generated/stripe_payment/src/bank_account/mod.rs new file mode 100644 index 000000000..d8b0896c8 --- /dev/null +++ b/generated/stripe_payment/src/bank_account/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::bank_account::*; +#[cfg(feature = "bank_account")] +mod requests; +#[cfg(feature = "bank_account")] +pub use requests::*; diff --git a/generated/stripe_payment/src/bank_account/requests.rs b/generated/stripe_payment/src/bank_account/requests.rs new file mode 100644 index 000000000..7bef1a23a --- /dev/null +++ b/generated/stripe_payment/src/bank_account/requests.rs @@ -0,0 +1,487 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerBankAccount<'a> { + /// The name of the person or business that owns the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_name: Option<&'a str>, + /// The type of entity that holds the account. + /// + /// This can be either `individual` or `company`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// City/District/Suburb/Town/Village. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_city: Option<&'a str>, + /// Billing address country, if provided when creating card. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_country: Option<&'a str>, + /// Address line 1 (Street address/PO Box/Company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1: Option<&'a str>, + /// Address line 2 (Apartment/Suite/Unit/Building). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line2: Option<&'a str>, + /// State/County/Province/Region. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_state: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_zip: Option<&'a str>, + /// Two digit number representing the card’s expiration month. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option<&'a str>, + /// Four digit number representing the card’s expiration year. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Cardholder name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option>, +} +impl<'a> UpdateCustomerBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of entity that holds the account. +/// +/// This can be either `individual` or `company`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateCustomerBankAccountAccountHolderType { + Company, + Individual, +} +impl UpdateCustomerBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdateCustomerBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdateCustomerBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateCustomerBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for UpdateCustomerBankAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateCustomerBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateCustomerBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateCustomerBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerBankAccountOwner<'a> { + /// Owner's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Owner's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Owner's full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Owner's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> UpdateCustomerBankAccountOwner<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Owner's address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerBankAccountOwnerAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateCustomerBankAccountOwnerAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateCustomerBankAccount<'a> { + /// Update a specified source for a given customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/sources/{id}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum UpdateCustomerReturned { + #[serde(rename = "card")] + Card(stripe_types::Card), + #[serde(rename = "bank_account")] + BankAccount(stripe_types::BankAccount), + #[serde(rename = "source")] + Source(stripe_types::Source), +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteCustomerBankAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> DeleteCustomerBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> DeleteCustomerBankAccount<'a> { + /// Delete a specified source for a given customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/sources/{id}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(untagged)] +pub enum DeleteCustomerReturned { + PaymentSource(stripe_types::PaymentSource), + DeletedPaymentSource(stripe_types::DeletedPaymentSource), +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct VerifyBankAccount<'a> { + /// Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub amounts: Option<&'a [i64]>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> VerifyBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> VerifyBankAccount<'a> { + /// Verify a specified bank account for a given customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/sources/{id}/verify"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountBankAccount<'a> { + /// The name of the person or business that owns the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_name: Option<&'a str>, + /// The type of entity that holds the account. + /// + /// This can be either `individual` or `company`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The bank account type. + /// + /// This can only be `checking` or `savings` in most countries. + /// In Japan, this can only be `futsu` or `toza`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// City/District/Suburb/Town/Village. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_city: Option<&'a str>, + /// Billing address country, if provided when creating card. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_country: Option<&'a str>, + /// Address line 1 (Street address/PO Box/Company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1: Option<&'a str>, + /// Address line 2 (Apartment/Suite/Unit/Building). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line2: Option<&'a str>, + /// State/County/Province/Region. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_state: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_zip: Option<&'a str>, + /// When set to true, this becomes the default external account for its currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for_currency: Option, + /// Documents that may be submitted to satisfy various informational requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub documents: Option>, + /// Two digit number representing the card’s expiration month. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option<&'a str>, + /// Four digit number representing the card’s expiration year. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Cardholder name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, +} +impl<'a> UpdateAccountBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of entity that holds the account. +/// +/// This can be either `individual` or `company`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateAccountBankAccountAccountHolderType { + Company, + Individual, +} +impl UpdateAccountBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdateAccountBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdateAccountBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateAccountBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for UpdateAccountBankAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateAccountBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateAccountBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateAccountBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The bank account type. +/// +/// This can only be `checking` or `savings` in most countries. +/// In Japan, this can only be `futsu` or `toza`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateAccountBankAccountAccountType { + Checking, + Futsu, + Savings, + Toza, +} +impl UpdateAccountBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use UpdateAccountBankAccountAccountType::*; + match self { + Checking => "checking", + Futsu => "futsu", + Savings => "savings", + Toza => "toza", + } + } +} + +impl std::str::FromStr for UpdateAccountBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateAccountBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "futsu" => Ok(Futsu), + "savings" => Ok(Savings), + "toza" => Ok(Toza), + _ => Err(()), + } + } +} +impl AsRef for UpdateAccountBankAccountAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateAccountBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateAccountBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateAccountBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Documents that may be submitted to satisfy various informational requests. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountBankAccountDocuments<'a> { + /// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. + /// + /// Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_account_ownership_verification: + Option>, +} +impl<'a> UpdateAccountBankAccountDocuments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. +/// +/// Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountBankAccountDocumentsBankAccountOwnershipVerification<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> UpdateAccountBankAccountDocumentsBankAccountOwnershipVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateAccountBankAccount<'a> { + /// Updates the metadata, account holder name, account holder type of a bank account belonging to a [Custom account](https://stripe.com/docs/connect/custom-accounts), and optionally sets it as the default for its currency. + /// + /// Other bank account details are not editable by design. You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/external_accounts/{id}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteAccountBankAccount {} +impl DeleteAccountBankAccount { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteAccountBankAccount { + /// Delete a specified external account for a given account. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/external_accounts/{id}"), + self, + http_types::Method::Delete, + ) + } +} diff --git a/generated/stripe_payment/src/card/mod.rs b/generated/stripe_payment/src/card/mod.rs new file mode 100644 index 000000000..c416b0189 --- /dev/null +++ b/generated/stripe_payment/src/card/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::card::*; +#[cfg(feature = "card")] +mod requests; +#[cfg(feature = "card")] +pub use requests::*; diff --git a/generated/stripe_payment/src/card/requests.rs b/generated/stripe_payment/src/card/requests.rs new file mode 100644 index 000000000..6ac88c8a7 --- /dev/null +++ b/generated/stripe_payment/src/card/requests.rs @@ -0,0 +1,458 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerCard<'a> { + /// The name of the person or business that owns the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_name: Option<&'a str>, + /// The type of entity that holds the account. + /// + /// This can be either `individual` or `company`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// City/District/Suburb/Town/Village. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_city: Option<&'a str>, + /// Billing address country, if provided when creating card. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_country: Option<&'a str>, + /// Address line 1 (Street address/PO Box/Company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1: Option<&'a str>, + /// Address line 2 (Apartment/Suite/Unit/Building). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line2: Option<&'a str>, + /// State/County/Province/Region. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_state: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_zip: Option<&'a str>, + /// Two digit number representing the card’s expiration month. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option<&'a str>, + /// Four digit number representing the card’s expiration year. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Cardholder name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option>, +} +impl<'a> UpdateCustomerCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of entity that holds the account. +/// +/// This can be either `individual` or `company`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateCustomerCardAccountHolderType { + Company, + Individual, +} +impl UpdateCustomerCardAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdateCustomerCardAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdateCustomerCardAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateCustomerCardAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for UpdateCustomerCardAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateCustomerCardAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateCustomerCardAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateCustomerCardAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerCardOwner<'a> { + /// Owner's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Owner's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Owner's full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Owner's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> UpdateCustomerCardOwner<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Owner's address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerCardOwnerAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateCustomerCardOwnerAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateCustomerCard<'a> { + /// Update a specified source for a given customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/sources/{id}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum UpdateCustomerReturned { + #[serde(rename = "card")] + Card(stripe_types::Card), + #[serde(rename = "bank_account")] + BankAccount(stripe_types::BankAccount), + #[serde(rename = "source")] + Source(stripe_types::Source), +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteCustomerCard<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> DeleteCustomerCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> DeleteCustomerCard<'a> { + /// Delete a specified source for a given customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/sources/{id}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(untagged)] +pub enum DeleteCustomerReturned { + PaymentSource(stripe_types::PaymentSource), + DeletedPaymentSource(stripe_types::DeletedPaymentSource), +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCard<'a> { + /// The name of the person or business that owns the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_name: Option<&'a str>, + /// The type of entity that holds the account. + /// + /// This can be either `individual` or `company`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The bank account type. + /// + /// This can only be `checking` or `savings` in most countries. + /// In Japan, this can only be `futsu` or `toza`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// City/District/Suburb/Town/Village. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_city: Option<&'a str>, + /// Billing address country, if provided when creating card. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_country: Option<&'a str>, + /// Address line 1 (Street address/PO Box/Company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1: Option<&'a str>, + /// Address line 2 (Apartment/Suite/Unit/Building). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line2: Option<&'a str>, + /// State/County/Province/Region. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_state: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_zip: Option<&'a str>, + /// When set to true, this becomes the default external account for its currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for_currency: Option, + /// Documents that may be submitted to satisfy various informational requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub documents: Option>, + /// Two digit number representing the card’s expiration month. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option<&'a str>, + /// Four digit number representing the card’s expiration year. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Cardholder name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, +} +impl<'a> UpdateAccountCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of entity that holds the account. +/// +/// This can be either `individual` or `company`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateAccountCardAccountHolderType { + Company, + Individual, +} +impl UpdateAccountCardAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdateAccountCardAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdateAccountCardAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateAccountCardAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for UpdateAccountCardAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateAccountCardAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateAccountCardAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateAccountCardAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The bank account type. +/// +/// This can only be `checking` or `savings` in most countries. +/// In Japan, this can only be `futsu` or `toza`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateAccountCardAccountType { + Checking, + Futsu, + Savings, + Toza, +} +impl UpdateAccountCardAccountType { + pub fn as_str(self) -> &'static str { + use UpdateAccountCardAccountType::*; + match self { + Checking => "checking", + Futsu => "futsu", + Savings => "savings", + Toza => "toza", + } + } +} + +impl std::str::FromStr for UpdateAccountCardAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateAccountCardAccountType::*; + match s { + "checking" => Ok(Checking), + "futsu" => Ok(Futsu), + "savings" => Ok(Savings), + "toza" => Ok(Toza), + _ => Err(()), + } + } +} +impl AsRef for UpdateAccountCardAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateAccountCardAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateAccountCardAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateAccountCardAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Documents that may be submitted to satisfy various informational requests. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCardDocuments<'a> { + /// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. + /// + /// Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_account_ownership_verification: + Option>, +} +impl<'a> UpdateAccountCardDocuments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. +/// +/// Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCardDocumentsBankAccountOwnershipVerification<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> UpdateAccountCardDocumentsBankAccountOwnershipVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateAccountCard<'a> { + /// Updates the metadata, account holder name, account holder type of a bank account belonging to a [Custom account](https://stripe.com/docs/connect/custom-accounts), and optionally sets it as the default for its currency. + /// + /// Other bank account details are not editable by design. You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/external_accounts/{id}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteAccountCard {} +impl DeleteAccountCard { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteAccountCard { + /// Delete a specified external account for a given account. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_types::account::AccountId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/external_accounts/{id}"), + self, + http_types::Method::Delete, + ) + } +} diff --git a/generated/stripe_payment/src/card_issuing_account_terms_of_service/mod.rs b/generated/stripe_payment/src/card_issuing_account_terms_of_service/mod.rs new file mode 100644 index 000000000..085beb7cd --- /dev/null +++ b/generated/stripe_payment/src/card_issuing_account_terms_of_service/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::card_issuing_account_terms_of_service::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/card_mandate_payment_method_details/mod.rs b/generated/stripe_payment/src/card_mandate_payment_method_details/mod.rs new file mode 100644 index 000000000..5d0c8af4b --- /dev/null +++ b/generated/stripe_payment/src/card_mandate_payment_method_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::card_mandate_payment_method_details::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/deleted_bank_account/mod.rs b/generated/stripe_payment/src/deleted_bank_account/mod.rs new file mode 100644 index 000000000..708ea5480 --- /dev/null +++ b/generated/stripe_payment/src/deleted_bank_account/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::deleted_bank_account::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/deleted_card/mod.rs b/generated/stripe_payment/src/deleted_card/mod.rs new file mode 100644 index 000000000..155f374e3 --- /dev/null +++ b/generated/stripe_payment/src/deleted_card/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::deleted_card::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/deleted_external_account/mod.rs b/generated/stripe_payment/src/deleted_external_account/mod.rs new file mode 100644 index 000000000..fc520e9b8 --- /dev/null +++ b/generated/stripe_payment/src/deleted_external_account/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::deleted_external_account::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/deleted_payment_source/mod.rs b/generated/stripe_payment/src/deleted_payment_source/mod.rs new file mode 100644 index 000000000..e23fb4123 --- /dev/null +++ b/generated/stripe_payment/src/deleted_payment_source/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::deleted_payment_source::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/external_account_requirements/mod.rs b/generated/stripe_payment/src/external_account_requirements/mod.rs new file mode 100644 index 000000000..7724a5efa --- /dev/null +++ b/generated/stripe_payment/src/external_account_requirements/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::external_account_requirements::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/mod.rs b/generated/stripe_payment/src/mod.rs new file mode 100644 index 000000000..88898f919 --- /dev/null +++ b/generated/stripe_payment/src/mod.rs @@ -0,0 +1,231 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::invalid_html_tags)] +extern crate self as stripe_payment; +pub use stripe_types::BankAccount; +pub mod bank_account; +pub use stripe_types::Card; +pub mod card; +pub use stripe_types::CardIssuingAccountTermsOfService; +pub use stripe_types::CardMandatePaymentMethodDetails; +pub use stripe_types::DeletedBankAccount; +pub use stripe_types::DeletedCard; +pub use stripe_types::DeletedExternalAccount; +pub use stripe_types::DeletedPaymentSource; +pub use stripe_types::ExternalAccountRequirements; +pub use stripe_types::Networks; +pub use stripe_types::PaymentFlowsPrivatePaymentMethodsAlipay; +pub use stripe_types::PaymentFlowsPrivatePaymentMethodsAlipayDetails; +pub use stripe_types::PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorization; +pub use stripe_types::PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorization; +pub use stripe_types::PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercapture; +pub use stripe_types::PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticapture; +pub use stripe_types::PaymentFlowsPrivatePaymentMethodsKlarnaDob; +pub use stripe_types::PaymentLink; +pub mod payment_link; +pub use stripe_types::PaymentLinksResourceAfterCompletion; +pub use stripe_types::PaymentLinksResourceAutomaticTax; +pub use stripe_types::PaymentLinksResourceCompletionBehaviorConfirmationPage; +pub use stripe_types::PaymentLinksResourceCompletionBehaviorRedirect; +pub use stripe_types::PaymentLinksResourceConsentCollection; +pub use stripe_types::PaymentLinksResourceCustomFields; +pub use stripe_types::PaymentLinksResourceCustomFieldsDropdown; +pub use stripe_types::PaymentLinksResourceCustomFieldsDropdownOption; +pub use stripe_types::PaymentLinksResourceCustomFieldsLabel; +pub use stripe_types::PaymentLinksResourceCustomFieldsNumeric; +pub use stripe_types::PaymentLinksResourceCustomFieldsText; +pub use stripe_types::PaymentLinksResourceCustomText; +pub use stripe_types::PaymentLinksResourceCustomTextPosition; +pub use stripe_types::PaymentLinksResourceInvoiceCreation; +pub use stripe_types::PaymentLinksResourceInvoiceSettings; +pub use stripe_types::PaymentLinksResourcePaymentIntentData; +pub use stripe_types::PaymentLinksResourcePhoneNumberCollection; +pub use stripe_types::PaymentLinksResourceShippingAddressCollection; +pub use stripe_types::PaymentLinksResourceShippingOption; +pub use stripe_types::PaymentLinksResourceSubscriptionData; +pub use stripe_types::PaymentLinksResourceTaxIdCollection; +pub use stripe_types::PaymentLinksResourceTransferData; +pub use stripe_types::PaymentMethod; +pub mod payment_method; +pub use stripe_types::PaymentMethodAcssDebit; +pub use stripe_types::PaymentMethodAffirm; +pub use stripe_types::PaymentMethodAfterpayClearpay; +pub use stripe_types::PaymentMethodAuBecsDebit; +pub use stripe_types::PaymentMethodBacsDebit; +pub use stripe_types::PaymentMethodBancontact; +pub use stripe_types::PaymentMethodBlik; +pub use stripe_types::PaymentMethodBoleto; +pub use stripe_types::PaymentMethodCard; +pub use stripe_types::PaymentMethodCardChecks; +pub use stripe_types::PaymentMethodCardPresent; +pub use stripe_types::PaymentMethodCardPresentNetworks; +pub use stripe_types::PaymentMethodCardWallet; +pub use stripe_types::PaymentMethodCardWalletAmexExpressCheckout; +pub use stripe_types::PaymentMethodCardWalletApplePay; +pub use stripe_types::PaymentMethodCardWalletGooglePay; +pub use stripe_types::PaymentMethodCardWalletLink; +pub use stripe_types::PaymentMethodCardWalletMasterpass; +pub use stripe_types::PaymentMethodCardWalletSamsungPay; +pub use stripe_types::PaymentMethodCardWalletVisaCheckout; +pub use stripe_types::PaymentMethodCashapp; +pub use stripe_types::PaymentMethodConfigBizPaymentMethodConfigurationDetails; +pub mod payment_method_config_resource_display_preference; +pub use payment_method_config_resource_display_preference::PaymentMethodConfigResourceDisplayPreference; +pub mod payment_method_config_resource_payment_method_properties; +pub use payment_method_config_resource_payment_method_properties::PaymentMethodConfigResourcePaymentMethodProperties; +pub mod payment_method_config_resource_payment_method_configuration; +pub use payment_method_config_resource_payment_method_configuration::PaymentMethodConfigResourcePaymentMethodConfiguration; +pub use stripe_types::PaymentMethodCustomerBalance; +pub use stripe_types::PaymentMethodDetails; +pub use stripe_types::PaymentMethodDetailsAchCreditTransfer; +pub use stripe_types::PaymentMethodDetailsAchDebit; +pub use stripe_types::PaymentMethodDetailsAcssDebit; +pub use stripe_types::PaymentMethodDetailsAffirm; +pub use stripe_types::PaymentMethodDetailsAfterpayClearpay; +pub use stripe_types::PaymentMethodDetailsAuBecsDebit; +pub use stripe_types::PaymentMethodDetailsBacsDebit; +pub use stripe_types::PaymentMethodDetailsBancontact; +pub use stripe_types::PaymentMethodDetailsBlik; +pub use stripe_types::PaymentMethodDetailsBoleto; +pub use stripe_types::PaymentMethodDetailsCard; +pub use stripe_types::PaymentMethodDetailsCardChecks; +pub use stripe_types::PaymentMethodDetailsCardInstallments; +pub use stripe_types::PaymentMethodDetailsCardInstallmentsPlan; +pub use stripe_types::PaymentMethodDetailsCardNetworkToken; +pub use stripe_types::PaymentMethodDetailsCardPresent; +pub use stripe_types::PaymentMethodDetailsCardPresentOffline; +pub use stripe_types::PaymentMethodDetailsCardPresentReceipt; +pub use stripe_types::PaymentMethodDetailsCardWallet; +pub use stripe_types::PaymentMethodDetailsCardWalletAmexExpressCheckout; +pub use stripe_types::PaymentMethodDetailsCardWalletApplePay; +pub use stripe_types::PaymentMethodDetailsCardWalletGooglePay; +pub use stripe_types::PaymentMethodDetailsCardWalletLink; +pub use stripe_types::PaymentMethodDetailsCardWalletMasterpass; +pub use stripe_types::PaymentMethodDetailsCardWalletSamsungPay; +pub use stripe_types::PaymentMethodDetailsCardWalletVisaCheckout; +pub use stripe_types::PaymentMethodDetailsCashapp; +pub use stripe_types::PaymentMethodDetailsCustomerBalance; +pub use stripe_types::PaymentMethodDetailsEps; +pub use stripe_types::PaymentMethodDetailsFpx; +pub use stripe_types::PaymentMethodDetailsGiropay; +pub use stripe_types::PaymentMethodDetailsGrabpay; +pub use stripe_types::PaymentMethodDetailsIdeal; +pub use stripe_types::PaymentMethodDetailsInteracPresent; +pub use stripe_types::PaymentMethodDetailsInteracPresentReceipt; +pub use stripe_types::PaymentMethodDetailsKlarna; +pub use stripe_types::PaymentMethodDetailsKonbini; +pub use stripe_types::PaymentMethodDetailsKonbiniStore; +pub use stripe_types::PaymentMethodDetailsLink; +pub use stripe_types::PaymentMethodDetailsMultibanco; +pub use stripe_types::PaymentMethodDetailsOxxo; +pub use stripe_types::PaymentMethodDetailsP24; +pub use stripe_types::PaymentMethodDetailsPaynow; +pub use stripe_types::PaymentMethodDetailsPaypal; +pub use stripe_types::PaymentMethodDetailsPix; +pub use stripe_types::PaymentMethodDetailsPromptpay; +pub use stripe_types::PaymentMethodDetailsRevolutPay; +pub use stripe_types::PaymentMethodDetailsSepaCreditTransfer; +pub use stripe_types::PaymentMethodDetailsSepaDebit; +pub use stripe_types::PaymentMethodDetailsSofort; +pub use stripe_types::PaymentMethodDetailsStripeAccount; +pub use stripe_types::PaymentMethodDetailsUsBankAccount; +pub use stripe_types::PaymentMethodDetailsWechat; +pub use stripe_types::PaymentMethodDetailsWechatPay; +pub use stripe_types::PaymentMethodDetailsZip; +pub mod payment_method_domain_resource_payment_method_domain; +pub use payment_method_domain_resource_payment_method_domain::PaymentMethodDomainResourcePaymentMethodDomain; +pub mod payment_method_domain_resource_payment_method_status; +pub use payment_method_domain_resource_payment_method_status::PaymentMethodDomainResourcePaymentMethodStatus; +pub mod payment_method_domain_resource_payment_method_status_details; +pub use payment_method_domain_resource_payment_method_status_details::PaymentMethodDomainResourcePaymentMethodStatusDetails; +pub use stripe_types::PaymentMethodEps; +pub use stripe_types::PaymentMethodFpx; +pub use stripe_types::PaymentMethodGiropay; +pub use stripe_types::PaymentMethodGrabpay; +pub use stripe_types::PaymentMethodIdeal; +pub use stripe_types::PaymentMethodInteracPresent; +pub use stripe_types::PaymentMethodKlarna; +pub use stripe_types::PaymentMethodKonbini; +pub use stripe_types::PaymentMethodLink; +pub use stripe_types::PaymentMethodOptionsAffirm; +pub use stripe_types::PaymentMethodOptionsAfterpayClearpay; +pub use stripe_types::PaymentMethodOptionsAlipay; +pub use stripe_types::PaymentMethodOptionsBacsDebit; +pub use stripe_types::PaymentMethodOptionsBancontact; +pub use stripe_types::PaymentMethodOptionsBoleto; +pub use stripe_types::PaymentMethodOptionsCardInstallments; +pub use stripe_types::PaymentMethodOptionsCardMandateOptions; +pub use stripe_types::PaymentMethodOptionsCardPresent; +pub use stripe_types::PaymentMethodOptionsCashapp; +pub use stripe_types::PaymentMethodOptionsCustomerBalance; +pub use stripe_types::PaymentMethodOptionsCustomerBalanceBankTransfer; +pub use stripe_types::PaymentMethodOptionsCustomerBalanceEuBankAccount; +pub use stripe_types::PaymentMethodOptionsFpx; +pub use stripe_types::PaymentMethodOptionsGiropay; +pub use stripe_types::PaymentMethodOptionsGrabpay; +pub use stripe_types::PaymentMethodOptionsIdeal; +pub use stripe_types::PaymentMethodOptionsInteracPresent; +pub use stripe_types::PaymentMethodOptionsKlarna; +pub use stripe_types::PaymentMethodOptionsKonbini; +pub use stripe_types::PaymentMethodOptionsOxxo; +pub use stripe_types::PaymentMethodOptionsP24; +pub use stripe_types::PaymentMethodOptionsPaynow; +pub use stripe_types::PaymentMethodOptionsPaypal; +pub use stripe_types::PaymentMethodOptionsPix; +pub use stripe_types::PaymentMethodOptionsPromptpay; +pub use stripe_types::PaymentMethodOptionsRevolutPay; +pub use stripe_types::PaymentMethodOptionsSofort; +pub use stripe_types::PaymentMethodOptionsWechatPay; +pub use stripe_types::PaymentMethodOptionsZip; +pub use stripe_types::PaymentMethodOxxo; +pub use stripe_types::PaymentMethodP24; +pub use stripe_types::PaymentMethodPaynow; +pub use stripe_types::PaymentMethodPaypal; +pub use stripe_types::PaymentMethodPix; +pub use stripe_types::PaymentMethodPromptpay; +pub use stripe_types::PaymentMethodRevolutPay; +pub use stripe_types::PaymentMethodSepaDebit; +pub use stripe_types::PaymentMethodSofort; +pub use stripe_types::PaymentMethodUsBankAccount; +pub use stripe_types::PaymentMethodUsBankAccountBlocked; +pub use stripe_types::PaymentMethodUsBankAccountStatusDetails; +pub use stripe_types::PaymentMethodWechatPay; +pub use stripe_types::PaymentMethodZip; +pub use stripe_types::PaypalSellerProtection; +pub use stripe_types::SepaDebitGeneratedFrom; +pub use stripe_types::Source; +pub mod source; +pub use stripe_types::SourceCodeVerificationFlow; +pub use stripe_types::SourceOrder; +pub use stripe_types::SourceOrderItem; +pub use stripe_types::SourceOwner; +pub use stripe_types::SourceReceiverFlow; +pub use stripe_types::SourceRedirectFlow; +pub use stripe_types::SourceTransaction; +pub use stripe_types::SourceTransactionAchCreditTransferData; +pub use stripe_types::SourceTransactionChfCreditTransferData; +pub use stripe_types::SourceTransactionGbpCreditTransferData; +pub use stripe_types::SourceTransactionPaperCheckData; +pub use stripe_types::SourceTransactionSepaCreditTransferData; +pub use stripe_types::SourceTypeAchCreditTransfer; +pub use stripe_types::SourceTypeAchDebit; +pub use stripe_types::SourceTypeAcssDebit; +pub use stripe_types::SourceTypeAlipay; +pub use stripe_types::SourceTypeAuBecsDebit; +pub use stripe_types::SourceTypeBancontact; +pub use stripe_types::SourceTypeCard; +pub use stripe_types::SourceTypeCardPresent; +pub use stripe_types::SourceTypeEps; +pub use stripe_types::SourceTypeGiropay; +pub use stripe_types::SourceTypeIdeal; +pub use stripe_types::SourceTypeKlarna; +pub use stripe_types::SourceTypeMultibanco; +pub use stripe_types::SourceTypeP24; +pub use stripe_types::SourceTypeSepaCreditTransfer; +pub use stripe_types::SourceTypeSepaDebit; +pub use stripe_types::SourceTypeSofort; +pub use stripe_types::SourceTypeThreeDSecure; +pub use stripe_types::SourceTypeWechat; +pub use stripe_types::ThreeDSecureDetailsCharge; +pub use stripe_types::ThreeDSecureUsage; +pub use stripe_types::UsBankAccountNetworks; diff --git a/generated/stripe_payment/src/networks/mod.rs b/generated/stripe_payment/src/networks/mod.rs new file mode 100644 index 000000000..6f7a318f5 --- /dev/null +++ b/generated/stripe_payment/src/networks/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::networks::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_flows_private_payment_methods_alipay/mod.rs b/generated/stripe_payment/src/payment_flows_private_payment_methods_alipay/mod.rs new file mode 100644 index 000000000..35e68b6cd --- /dev/null +++ b/generated/stripe_payment/src/payment_flows_private_payment_methods_alipay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_flows_private_payment_methods_alipay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_flows_private_payment_methods_alipay_details/mod.rs b/generated/stripe_payment/src/payment_flows_private_payment_methods_alipay_details/mod.rs new file mode 100644 index 000000000..d2276bb78 --- /dev/null +++ b/generated/stripe_payment/src/payment_flows_private_payment_methods_alipay_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_flows_private_payment_methods_alipay_details::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization/mod.rs b/generated/stripe_payment/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization/mod.rs new file mode 100644 index 000000000..19cd18fe0 --- /dev/null +++ b/generated/stripe_payment/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization/mod.rs b/generated/stripe_payment/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization/mod.rs new file mode 100644 index 000000000..eb48c0b09 --- /dev/null +++ b/generated/stripe_payment/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture/mod.rs b/generated/stripe_payment/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture/mod.rs new file mode 100644 index 000000000..6df8928f2 --- /dev/null +++ b/generated/stripe_payment/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_flows_private_payment_methods_card_details_api_resource_multicapture/mod.rs b/generated/stripe_payment/src/payment_flows_private_payment_methods_card_details_api_resource_multicapture/mod.rs new file mode 100644 index 000000000..d375ccb43 --- /dev/null +++ b/generated/stripe_payment/src/payment_flows_private_payment_methods_card_details_api_resource_multicapture/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_flows_private_payment_methods_card_details_api_resource_multicapture::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_flows_private_payment_methods_klarna_dob/mod.rs b/generated/stripe_payment/src/payment_flows_private_payment_methods_klarna_dob/mod.rs new file mode 100644 index 000000000..781f657b8 --- /dev/null +++ b/generated/stripe_payment/src/payment_flows_private_payment_methods_klarna_dob/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_flows_private_payment_methods_klarna_dob::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_link/mod.rs b/generated/stripe_payment/src/payment_link/mod.rs new file mode 100644 index 000000000..ac7bd531f --- /dev/null +++ b/generated/stripe_payment/src/payment_link/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::payment_link::*; +#[cfg(feature = "payment_link")] +mod requests; +#[cfg(feature = "payment_link")] +pub use requests::*; diff --git a/generated/stripe_payment/src/payment_link/requests.rs b/generated/stripe_payment/src/payment_link/requests.rs new file mode 100644 index 000000000..e8d96fb7a --- /dev/null +++ b/generated/stripe_payment/src/payment_link/requests.rs @@ -0,0 +1,4107 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPaymentLink<'a> { + /// Only return payment links that are active or inactive (e.g., pass `false` to list all inactive payment links). + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListPaymentLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPaymentLink<'a> { + /// Returns a list of your payment links. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/payment_links", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/payment_links", self) + } +} +impl<'a> stripe::PaginationParams for ListPaymentLink<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePaymentLink<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePaymentLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePaymentLink<'a> { + /// Retrieve a payment link. + pub fn send( + &self, + client: &stripe::Client, + payment_link: &stripe_types::payment_link::PaymentLinkId, + ) -> stripe::Response { + client.get_query(&format!("/payment_links/{payment_link}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListLineItemsPaymentLink<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListLineItemsPaymentLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListLineItemsPaymentLink<'a> { + /// When retrieving a payment link, there is an includable **line_items** property containing the first handful of those items. + /// + /// There is also a URL where you can retrieve the full (paginated) list of line items. + pub fn send( + &self, + client: &stripe::Client, + payment_link: &stripe_types::payment_link::PaymentLinkId, + ) -> stripe::Response> { + client.get_query(&format!("/payment_links/{payment_link}/line_items"), self) + } + pub fn paginate( + self, + payment_link: &stripe_types::payment_link::PaymentLinkId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params( + &format!("/payment_links/{payment_link}/line_items"), + self, + ) + } +} +impl<'a> stripe::PaginationParams for ListLineItemsPaymentLink<'a> {} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLink<'a> { + /// Behavior after the purchase is complete. + #[serde(skip_serializing_if = "Option::is_none")] + pub after_completion: Option>, + /// Enables user redeemable promotion codes. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_promotion_codes: Option, + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// + /// Can only be applied when there are no line items with recurring prices. + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// There must be at least 1 line item with a recurring price to use this field. + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Configuration for automatic tax collection. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// Configuration for collecting the customer's billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_address_collection: Option, + /// Configure fields to gather active consent from customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub consent_collection: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies) and supported by each line item's price. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Collect additional information from your customer using custom fields. + /// + /// Up to 2 fields are supported. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [CreatePaymentLinkCustomFields<'a>]>, + /// Display additional text for your customers using custom text. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_text: Option>, + /// Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_creation: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Generate a post-purchase Invoice for one-time payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_creation: Option>, + /// The line items representing what is being sold. + /// + /// Each line item represents an item being sold. + /// Up to 20 line items are supported. + pub line_items: &'a [CreatePaymentLinkLineItems<'a>], + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + /// Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The account on behalf of which to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent_data: Option>, + /// Specify whether Checkout should collect a payment method. + /// + /// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_collection: Option, + /// The list of payment method types that customers can use. + /// + /// If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [CreatePaymentLinkPaymentMethodTypes]>, + /// Controls phone number collection settings during checkout. + /// + /// We recommend that you review your privacy policy and check with your legal contacts. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_number_collection: Option, + /// Configuration for collecting the customer's shipping address. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_address_collection: Option>, + /// The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_options: Option<&'a [CreatePaymentLinkShippingOptions<'a>]>, + /// Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. + /// + /// Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). + #[serde(skip_serializing_if = "Option::is_none")] + pub submit_type: Option, + /// When creating a subscription, the specified configuration data will be used. + /// + /// There must be at least one line item with a recurring price to use `subscription_data`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_data: Option>, + /// Controls tax ID collection during checkout. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_collection: Option, + /// The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, +} +impl<'a> CreatePaymentLink<'a> { + pub fn new(line_items: &'a [CreatePaymentLinkLineItems<'a>]) -> Self { + Self { + after_completion: Default::default(), + allow_promotion_codes: Default::default(), + application_fee_amount: Default::default(), + application_fee_percent: Default::default(), + automatic_tax: Default::default(), + billing_address_collection: Default::default(), + consent_collection: Default::default(), + currency: Default::default(), + custom_fields: Default::default(), + custom_text: Default::default(), + customer_creation: Default::default(), + expand: Default::default(), + invoice_creation: Default::default(), + line_items, + metadata: Default::default(), + on_behalf_of: Default::default(), + payment_intent_data: Default::default(), + payment_method_collection: Default::default(), + payment_method_types: Default::default(), + phone_number_collection: Default::default(), + shipping_address_collection: Default::default(), + shipping_options: Default::default(), + submit_type: Default::default(), + subscription_data: Default::default(), + tax_id_collection: Default::default(), + transfer_data: Default::default(), + } + } +} +/// Behavior after the purchase is complete. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkAfterCompletion<'a> { + /// Configuration when `type=hosted_confirmation`. + #[serde(skip_serializing_if = "Option::is_none")] + pub hosted_confirmation: Option>, + /// Configuration when `type=redirect`. + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect: Option>, + /// The specified behavior after the purchase is complete. + /// + /// Either `redirect` or `hosted_confirmation`. + #[serde(rename = "type")] + pub type_: CreatePaymentLinkAfterCompletionType, +} +impl<'a> CreatePaymentLinkAfterCompletion<'a> { + pub fn new(type_: CreatePaymentLinkAfterCompletionType) -> Self { + Self { hosted_confirmation: Default::default(), redirect: Default::default(), type_ } + } +} +/// Configuration when `type=hosted_confirmation`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkAfterCompletionHostedConfirmation<'a> { + /// A custom message to display to the customer after the purchase is complete. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_message: Option<&'a str>, +} +impl<'a> CreatePaymentLinkAfterCompletionHostedConfirmation<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration when `type=redirect`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkAfterCompletionRedirect<'a> { + /// The URL the customer will be redirected to after the purchase is complete. + /// + /// You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included. + pub url: &'a str, +} +impl<'a> CreatePaymentLinkAfterCompletionRedirect<'a> { + pub fn new(url: &'a str) -> Self { + Self { url } + } +} +/// The specified behavior after the purchase is complete. +/// +/// Either `redirect` or `hosted_confirmation`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkAfterCompletionType { + HostedConfirmation, + Redirect, +} +impl CreatePaymentLinkAfterCompletionType { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkAfterCompletionType::*; + match self { + HostedConfirmation => "hosted_confirmation", + Redirect => "redirect", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkAfterCompletionType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkAfterCompletionType::*; + match s { + "hosted_confirmation" => Ok(HostedConfirmation), + "redirect" => Ok(Redirect), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentLinkAfterCompletionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentLinkAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkAfterCompletionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for automatic tax collection. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkAutomaticTax { + /// If `true`, tax will be calculated automatically using the customer's location. + pub enabled: bool, +} +impl CreatePaymentLinkAutomaticTax { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Configuration for collecting the customer's billing address. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkBillingAddressCollection { + Auto, + Required, +} +impl CreatePaymentLinkBillingAddressCollection { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkBillingAddressCollection::*; + match self { + Auto => "auto", + Required => "required", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkBillingAddressCollection { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkBillingAddressCollection::*; + match s { + "auto" => Ok(Auto), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentLinkBillingAddressCollection { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentLinkBillingAddressCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkBillingAddressCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkBillingAddressCollection { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configure fields to gather active consent from customers. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkConsentCollection { + /// If set to `auto`, enables the collection of customer consent for promotional communications. + /// + /// The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. + /// Only available to US merchants. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotions: Option, + /// If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. + /// There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). + #[serde(skip_serializing_if = "Option::is_none")] + pub terms_of_service: Option, +} +impl CreatePaymentLinkConsentCollection { + pub fn new() -> Self { + Self::default() + } +} +/// If set to `auto`, enables the collection of customer consent for promotional communications. +/// +/// The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. +/// Only available to US merchants. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkConsentCollectionPromotions { + Auto, + None, +} +impl CreatePaymentLinkConsentCollectionPromotions { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkConsentCollectionPromotions::*; + match self { + Auto => "auto", + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkConsentCollectionPromotions { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkConsentCollectionPromotions::*; + match s { + "auto" => Ok(Auto), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentLinkConsentCollectionPromotions { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentLinkConsentCollectionPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkConsentCollectionPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkConsentCollectionPromotions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. +/// There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkConsentCollectionTermsOfService { + None, + Required, +} +impl CreatePaymentLinkConsentCollectionTermsOfService { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkConsentCollectionTermsOfService::*; + match self { + None => "none", + Required => "required", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkConsentCollectionTermsOfService { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkConsentCollectionTermsOfService::*; + match s { + "none" => Ok(None), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentLinkConsentCollectionTermsOfService { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentLinkConsentCollectionTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkConsentCollectionTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkConsentCollectionTermsOfService { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Collect additional information from your customer using custom fields. +/// +/// Up to 2 fields are supported. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkCustomFields<'a> { + /// Configuration for `type=dropdown` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub dropdown: Option>, + /// String of your choice that your integration can use to reconcile this field. + /// + /// Must be unique to this field, alphanumeric, and up to 200 characters. + pub key: &'a str, + /// The label for the field, displayed to the customer. + pub label: CreatePaymentLinkCustomFieldsLabel<'a>, + /// Configuration for `type=numeric` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub numeric: Option, + /// Whether the customer is required to complete the field before completing the Checkout Session. + /// + /// Defaults to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub optional: Option, + /// Configuration for `type=text` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub text: Option, + /// The type of the field. + #[serde(rename = "type")] + pub type_: CreatePaymentLinkCustomFieldsType, +} +impl<'a> CreatePaymentLinkCustomFields<'a> { + pub fn new( + key: &'a str, + label: CreatePaymentLinkCustomFieldsLabel<'a>, + type_: CreatePaymentLinkCustomFieldsType, + ) -> Self { + Self { + dropdown: Default::default(), + key, + label, + numeric: Default::default(), + optional: Default::default(), + text: Default::default(), + type_, + } + } +} +/// Configuration for `type=dropdown` fields. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkCustomFieldsDropdown<'a> { + /// The options available for the customer to select. + /// + /// Up to 200 options allowed. + pub options: &'a [CreatePaymentLinkCustomFieldsDropdownOptions<'a>], +} +impl<'a> CreatePaymentLinkCustomFieldsDropdown<'a> { + pub fn new(options: &'a [CreatePaymentLinkCustomFieldsDropdownOptions<'a>]) -> Self { + Self { options } + } +} +/// The options available for the customer to select. +/// +/// Up to 200 options allowed. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkCustomFieldsDropdownOptions<'a> { + /// The label for the option, displayed to the customer. + /// + /// Up to 100 characters. + pub label: &'a str, + /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. + /// + /// Must be unique to this option, alphanumeric, and up to 100 characters. + pub value: &'a str, +} +impl<'a> CreatePaymentLinkCustomFieldsDropdownOptions<'a> { + pub fn new(label: &'a str, value: &'a str) -> Self { + Self { label, value } + } +} +/// The label for the field, displayed to the customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkCustomFieldsLabel<'a> { + /// Custom text for the label, displayed to the customer. + /// + /// Up to 50 characters. + pub custom: &'a str, + /// The type of the label. + #[serde(rename = "type")] + pub type_: CreatePaymentLinkCustomFieldsLabelType, +} +impl<'a> CreatePaymentLinkCustomFieldsLabel<'a> { + pub fn new(custom: &'a str, type_: CreatePaymentLinkCustomFieldsLabelType) -> Self { + Self { custom, type_ } + } +} +/// The type of the label. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkCustomFieldsLabelType { + Custom, +} +impl CreatePaymentLinkCustomFieldsLabelType { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkCustomFieldsLabelType::*; + match self { + Custom => "custom", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkCustomFieldsLabelType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkCustomFieldsLabelType::*; + match s { + "custom" => Ok(Custom), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentLinkCustomFieldsLabelType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentLinkCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkCustomFieldsLabelType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for `type=numeric` fields. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkCustomFieldsNumeric { + /// The maximum character length constraint for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_length: Option, +} +impl CreatePaymentLinkCustomFieldsNumeric { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for `type=text` fields. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkCustomFieldsText { + /// The maximum character length constraint for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_length: Option, +} +impl CreatePaymentLinkCustomFieldsText { + pub fn new() -> Self { + Self::default() + } +} +/// The type of the field. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkCustomFieldsType { + Dropdown, + Numeric, + Text, +} +impl CreatePaymentLinkCustomFieldsType { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkCustomFieldsType::*; + match self { + Dropdown => "dropdown", + Numeric => "numeric", + Text => "text", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkCustomFieldsType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkCustomFieldsType::*; + match s { + "dropdown" => Ok(Dropdown), + "numeric" => Ok(Numeric), + "text" => Ok(Text), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentLinkCustomFieldsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentLinkCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkCustomFieldsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Display additional text for your customers using custom text. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkCustomText<'a> { + /// Custom text that should be displayed alongside shipping address collection. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_address: Option>, + /// Custom text that should be displayed alongside the payment confirmation button. + #[serde(skip_serializing_if = "Option::is_none")] + pub submit: Option>, + /// Custom text that should be displayed in place of the default terms of service agreement text. + #[serde(skip_serializing_if = "Option::is_none")] + pub terms_of_service_acceptance: + Option>, +} +impl<'a> CreatePaymentLinkCustomText<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Custom text that should be displayed alongside shipping address collection. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkCustomTextShippingAddress<'a> { + /// Text may be up to 1200 characters in length. + pub message: &'a str, +} +impl<'a> CreatePaymentLinkCustomTextShippingAddress<'a> { + pub fn new(message: &'a str) -> Self { + Self { message } + } +} +/// Custom text that should be displayed alongside the payment confirmation button. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkCustomTextSubmit<'a> { + /// Text may be up to 1200 characters in length. + pub message: &'a str, +} +impl<'a> CreatePaymentLinkCustomTextSubmit<'a> { + pub fn new(message: &'a str) -> Self { + Self { message } + } +} +/// Custom text that should be displayed in place of the default terms of service agreement text. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkCustomTextTermsOfServiceAcceptance<'a> { + /// Text may be up to 1200 characters in length. + pub message: &'a str, +} +impl<'a> CreatePaymentLinkCustomTextTermsOfServiceAcceptance<'a> { + pub fn new(message: &'a str) -> Self { + Self { message } + } +} +/// Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkCustomerCreation { + Always, + IfRequired, +} +impl CreatePaymentLinkCustomerCreation { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkCustomerCreation::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkCustomerCreation { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkCustomerCreation::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentLinkCustomerCreation { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentLinkCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkCustomerCreation { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Generate a post-purchase Invoice for one-time payments. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkInvoiceCreation<'a> { + /// Whether the feature is enabled. + pub enabled: bool, + /// Invoice PDF configuration. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_data: Option>, +} +impl<'a> CreatePaymentLinkInvoiceCreation<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, invoice_data: Default::default() } + } +} +/// Invoice PDF configuration. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkInvoiceCreationInvoiceData<'a> { + /// The account tax IDs associated with the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option<&'a [&'a str]>, + /// Default custom fields to be displayed on invoices for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [CreatePaymentLinkInvoiceCreationInvoiceDataCustomFields<'a>]>, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Default footer to be displayed on invoices for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Default options for invoice PDF rendering for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering_options: Option, +} +impl<'a> CreatePaymentLinkInvoiceCreationInvoiceData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Default custom fields to be displayed on invoices for this customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkInvoiceCreationInvoiceDataCustomFields<'a> { + /// The name of the custom field. + /// + /// This may be up to 30 characters. + pub name: &'a str, + /// The value of the custom field. + /// + /// This may be up to 30 characters. + pub value: &'a str, +} +impl<'a> CreatePaymentLinkInvoiceCreationInvoiceDataCustomFields<'a> { + pub fn new(name: &'a str, value: &'a str) -> Self { + Self { name, value } + } +} +/// Default options for invoice PDF rendering for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: + Option, +} +impl CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr + for CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The line items representing what is being sold. +/// +/// Each line item represents an item being sold. +/// Up to 20 line items are supported. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkLineItems<'a> { + /// When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout. + #[serde(skip_serializing_if = "Option::is_none")] + pub adjustable_quantity: Option, + /// The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. + pub price: &'a str, + /// The quantity of the line item being purchased. + pub quantity: u64, +} +impl<'a> CreatePaymentLinkLineItems<'a> { + pub fn new(price: &'a str, quantity: u64) -> Self { + Self { adjustable_quantity: Default::default(), price, quantity } + } +} +/// When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkLineItemsAdjustableQuantity { + /// Set to true if the quantity can be adjusted to any non-negative Integer. + pub enabled: bool, + /// The maximum quantity the customer can purchase. + /// + /// By default this value is 99. + /// You can specify a value up to 999. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option, + /// The minimum quantity the customer can purchase. + /// + /// By default this value is 0. + /// If there is only one item in the cart then that item's quantity cannot go down to 0. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option, +} +impl CreatePaymentLinkLineItemsAdjustableQuantity { + pub fn new(enabled: bool) -> Self { + Self { enabled, maximum: Default::default(), minimum: Default::default() } + } +} +/// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkPaymentIntentData<'a> { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. + /// + /// Unlike object-level metadata, this field is declarative. + /// Updates will clear prior values. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. + /// + /// When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. + /// + /// When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. + /// + /// If a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer. + /// + /// If Checkout does not create a Customer, the payment method is not attached to a Customer. + /// + /// To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Extra information about the payment. + /// + /// This will appear on your customer's statement when this payment succeeds in creating a charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// Provides information about the charge that customers see on their statements. + /// + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. + /// Maximum 22 characters for the concatenated descriptor. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix: Option<&'a str>, +} +impl<'a> CreatePaymentLinkPaymentIntentData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkPaymentIntentDataCaptureMethod { + Automatic, + AutomaticAsync, + Manual, +} +impl CreatePaymentLinkPaymentIntentDataCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkPaymentIntentDataCaptureMethod::*; + match self { + Automatic => "automatic", + AutomaticAsync => "automatic_async", + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkPaymentIntentDataCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkPaymentIntentDataCaptureMethod::*; + match s { + "automatic" => Ok(Automatic), + "automatic_async" => Ok(AutomaticAsync), + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentLinkPaymentIntentDataCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentLinkPaymentIntentDataCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkPaymentIntentDataCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkPaymentIntentDataCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. +/// +/// When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. +/// +/// When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. +/// +/// If a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer. +/// +/// If Checkout does not create a Customer, the payment method is not attached to a Customer. +/// +/// To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkPaymentIntentDataSetupFutureUsage { + OffSession, + OnSession, +} +impl CreatePaymentLinkPaymentIntentDataSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkPaymentIntentDataSetupFutureUsage::*; + match self { + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkPaymentIntentDataSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkPaymentIntentDataSetupFutureUsage::*; + match s { + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentLinkPaymentIntentDataSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentLinkPaymentIntentDataSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkPaymentIntentDataSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkPaymentIntentDataSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specify whether Checkout should collect a payment method. +/// +/// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkPaymentMethodCollection { + Always, + IfRequired, +} +impl CreatePaymentLinkPaymentMethodCollection { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkPaymentMethodCollection::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkPaymentMethodCollection { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkPaymentMethodCollection::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentLinkPaymentMethodCollection { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentLinkPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkPaymentMethodCollection { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of payment method types that customers can use. +/// +/// If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)). +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentLinkPaymentMethodTypes { + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Card, + Cashapp, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentLinkPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkPaymentMethodTypes::*; + match self { + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkPaymentMethodTypes::*; + match s { + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentLinkPaymentMethodTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentLinkPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Controls phone number collection settings during checkout. +/// +/// We recommend that you review your privacy policy and check with your legal contacts. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkPhoneNumberCollection { + /// Set to `true` to enable phone number collection. + pub enabled: bool, +} +impl CreatePaymentLinkPhoneNumberCollection { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Configuration for collecting the customer's shipping address. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkShippingAddressCollection<'a> { + /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for + /// shipping locations. + /// + /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + pub allowed_countries: &'a [CreatePaymentLinkShippingAddressCollectionAllowedCountries], +} +impl<'a> CreatePaymentLinkShippingAddressCollection<'a> { + pub fn new( + allowed_countries: &'a [CreatePaymentLinkShippingAddressCollectionAllowedCountries], + ) -> Self { + Self { allowed_countries } + } +} +/// An array of two-letter ISO country codes representing which countries Checkout should provide as options for +/// shipping locations. +/// +/// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentLinkShippingAddressCollectionAllowedCountries { + Ac, + Ad, + Ae, + Af, + Ag, + Ai, + Al, + Am, + Ao, + Aq, + Ar, + At, + Au, + Aw, + Ax, + Az, + Ba, + Bb, + Bd, + Be, + Bf, + Bg, + Bh, + Bi, + Bj, + Bl, + Bm, + Bn, + Bo, + Bq, + Br, + Bs, + Bt, + Bv, + Bw, + By, + Bz, + Ca, + Cd, + Cf, + Cg, + Ch, + Ci, + Ck, + Cl, + Cm, + Cn, + Co, + Cr, + Cv, + Cw, + Cy, + Cz, + De, + Dj, + Dk, + Dm, + Do, + Dz, + Ec, + Ee, + Eg, + Eh, + Er, + Es, + Et, + Fi, + Fj, + Fk, + Fo, + Fr, + Ga, + Gb, + Gd, + Ge, + Gf, + Gg, + Gh, + Gi, + Gl, + Gm, + Gn, + Gp, + Gq, + Gr, + Gs, + Gt, + Gu, + Gw, + Gy, + Hk, + Hn, + Hr, + Ht, + Hu, + Id, + Ie, + Il, + Im, + In, + Io, + Iq, + Is, + It, + Je, + Jm, + Jo, + Jp, + Ke, + Kg, + Kh, + Ki, + Km, + Kn, + Kr, + Kw, + Ky, + Kz, + La, + Lb, + Lc, + Li, + Lk, + Lr, + Ls, + Lt, + Lu, + Lv, + Ly, + Ma, + Mc, + Md, + Me, + Mf, + Mg, + Mk, + Ml, + Mm, + Mn, + Mo, + Mq, + Mr, + Ms, + Mt, + Mu, + Mv, + Mw, + Mx, + My, + Mz, + Na, + Nc, + Ne, + Ng, + Ni, + Nl, + No, + Np, + Nr, + Nu, + Nz, + Om, + Pa, + Pe, + Pf, + Pg, + Ph, + Pk, + Pl, + Pm, + Pn, + Pr, + Ps, + Pt, + Py, + Qa, + Re, + Ro, + Rs, + Ru, + Rw, + Sa, + Sb, + Sc, + Se, + Sg, + Sh, + Si, + Sj, + Sk, + Sl, + Sm, + Sn, + So, + Sr, + Ss, + St, + Sv, + Sx, + Sz, + Ta, + Tc, + Td, + Tf, + Tg, + Th, + Tj, + Tk, + Tl, + Tm, + Tn, + To, + Tr, + Tt, + Tv, + Tw, + Tz, + Ua, + Ug, + Us, + Uy, + Uz, + Va, + Vc, + Ve, + Vg, + Vn, + Vu, + Wf, + Ws, + Xk, + Ye, + Yt, + Za, + Zm, + Zw, + Zz, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentLinkShippingAddressCollectionAllowedCountries { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkShippingAddressCollectionAllowedCountries::*; + match self { + Ac => "AC", + Ad => "AD", + Ae => "AE", + Af => "AF", + Ag => "AG", + Ai => "AI", + Al => "AL", + Am => "AM", + Ao => "AO", + Aq => "AQ", + Ar => "AR", + At => "AT", + Au => "AU", + Aw => "AW", + Ax => "AX", + Az => "AZ", + Ba => "BA", + Bb => "BB", + Bd => "BD", + Be => "BE", + Bf => "BF", + Bg => "BG", + Bh => "BH", + Bi => "BI", + Bj => "BJ", + Bl => "BL", + Bm => "BM", + Bn => "BN", + Bo => "BO", + Bq => "BQ", + Br => "BR", + Bs => "BS", + Bt => "BT", + Bv => "BV", + Bw => "BW", + By => "BY", + Bz => "BZ", + Ca => "CA", + Cd => "CD", + Cf => "CF", + Cg => "CG", + Ch => "CH", + Ci => "CI", + Ck => "CK", + Cl => "CL", + Cm => "CM", + Cn => "CN", + Co => "CO", + Cr => "CR", + Cv => "CV", + Cw => "CW", + Cy => "CY", + Cz => "CZ", + De => "DE", + Dj => "DJ", + Dk => "DK", + Dm => "DM", + Do => "DO", + Dz => "DZ", + Ec => "EC", + Ee => "EE", + Eg => "EG", + Eh => "EH", + Er => "ER", + Es => "ES", + Et => "ET", + Fi => "FI", + Fj => "FJ", + Fk => "FK", + Fo => "FO", + Fr => "FR", + Ga => "GA", + Gb => "GB", + Gd => "GD", + Ge => "GE", + Gf => "GF", + Gg => "GG", + Gh => "GH", + Gi => "GI", + Gl => "GL", + Gm => "GM", + Gn => "GN", + Gp => "GP", + Gq => "GQ", + Gr => "GR", + Gs => "GS", + Gt => "GT", + Gu => "GU", + Gw => "GW", + Gy => "GY", + Hk => "HK", + Hn => "HN", + Hr => "HR", + Ht => "HT", + Hu => "HU", + Id => "ID", + Ie => "IE", + Il => "IL", + Im => "IM", + In => "IN", + Io => "IO", + Iq => "IQ", + Is => "IS", + It => "IT", + Je => "JE", + Jm => "JM", + Jo => "JO", + Jp => "JP", + Ke => "KE", + Kg => "KG", + Kh => "KH", + Ki => "KI", + Km => "KM", + Kn => "KN", + Kr => "KR", + Kw => "KW", + Ky => "KY", + Kz => "KZ", + La => "LA", + Lb => "LB", + Lc => "LC", + Li => "LI", + Lk => "LK", + Lr => "LR", + Ls => "LS", + Lt => "LT", + Lu => "LU", + Lv => "LV", + Ly => "LY", + Ma => "MA", + Mc => "MC", + Md => "MD", + Me => "ME", + Mf => "MF", + Mg => "MG", + Mk => "MK", + Ml => "ML", + Mm => "MM", + Mn => "MN", + Mo => "MO", + Mq => "MQ", + Mr => "MR", + Ms => "MS", + Mt => "MT", + Mu => "MU", + Mv => "MV", + Mw => "MW", + Mx => "MX", + My => "MY", + Mz => "MZ", + Na => "NA", + Nc => "NC", + Ne => "NE", + Ng => "NG", + Ni => "NI", + Nl => "NL", + No => "NO", + Np => "NP", + Nr => "NR", + Nu => "NU", + Nz => "NZ", + Om => "OM", + Pa => "PA", + Pe => "PE", + Pf => "PF", + Pg => "PG", + Ph => "PH", + Pk => "PK", + Pl => "PL", + Pm => "PM", + Pn => "PN", + Pr => "PR", + Ps => "PS", + Pt => "PT", + Py => "PY", + Qa => "QA", + Re => "RE", + Ro => "RO", + Rs => "RS", + Ru => "RU", + Rw => "RW", + Sa => "SA", + Sb => "SB", + Sc => "SC", + Se => "SE", + Sg => "SG", + Sh => "SH", + Si => "SI", + Sj => "SJ", + Sk => "SK", + Sl => "SL", + Sm => "SM", + Sn => "SN", + So => "SO", + Sr => "SR", + Ss => "SS", + St => "ST", + Sv => "SV", + Sx => "SX", + Sz => "SZ", + Ta => "TA", + Tc => "TC", + Td => "TD", + Tf => "TF", + Tg => "TG", + Th => "TH", + Tj => "TJ", + Tk => "TK", + Tl => "TL", + Tm => "TM", + Tn => "TN", + To => "TO", + Tr => "TR", + Tt => "TT", + Tv => "TV", + Tw => "TW", + Tz => "TZ", + Ua => "UA", + Ug => "UG", + Us => "US", + Uy => "UY", + Uz => "UZ", + Va => "VA", + Vc => "VC", + Ve => "VE", + Vg => "VG", + Vn => "VN", + Vu => "VU", + Wf => "WF", + Ws => "WS", + Xk => "XK", + Ye => "YE", + Yt => "YT", + Za => "ZA", + Zm => "ZM", + Zw => "ZW", + Zz => "ZZ", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkShippingAddressCollectionAllowedCountries { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkShippingAddressCollectionAllowedCountries::*; + match s { + "AC" => Ok(Ac), + "AD" => Ok(Ad), + "AE" => Ok(Ae), + "AF" => Ok(Af), + "AG" => Ok(Ag), + "AI" => Ok(Ai), + "AL" => Ok(Al), + "AM" => Ok(Am), + "AO" => Ok(Ao), + "AQ" => Ok(Aq), + "AR" => Ok(Ar), + "AT" => Ok(At), + "AU" => Ok(Au), + "AW" => Ok(Aw), + "AX" => Ok(Ax), + "AZ" => Ok(Az), + "BA" => Ok(Ba), + "BB" => Ok(Bb), + "BD" => Ok(Bd), + "BE" => Ok(Be), + "BF" => Ok(Bf), + "BG" => Ok(Bg), + "BH" => Ok(Bh), + "BI" => Ok(Bi), + "BJ" => Ok(Bj), + "BL" => Ok(Bl), + "BM" => Ok(Bm), + "BN" => Ok(Bn), + "BO" => Ok(Bo), + "BQ" => Ok(Bq), + "BR" => Ok(Br), + "BS" => Ok(Bs), + "BT" => Ok(Bt), + "BV" => Ok(Bv), + "BW" => Ok(Bw), + "BY" => Ok(By), + "BZ" => Ok(Bz), + "CA" => Ok(Ca), + "CD" => Ok(Cd), + "CF" => Ok(Cf), + "CG" => Ok(Cg), + "CH" => Ok(Ch), + "CI" => Ok(Ci), + "CK" => Ok(Ck), + "CL" => Ok(Cl), + "CM" => Ok(Cm), + "CN" => Ok(Cn), + "CO" => Ok(Co), + "CR" => Ok(Cr), + "CV" => Ok(Cv), + "CW" => Ok(Cw), + "CY" => Ok(Cy), + "CZ" => Ok(Cz), + "DE" => Ok(De), + "DJ" => Ok(Dj), + "DK" => Ok(Dk), + "DM" => Ok(Dm), + "DO" => Ok(Do), + "DZ" => Ok(Dz), + "EC" => Ok(Ec), + "EE" => Ok(Ee), + "EG" => Ok(Eg), + "EH" => Ok(Eh), + "ER" => Ok(Er), + "ES" => Ok(Es), + "ET" => Ok(Et), + "FI" => Ok(Fi), + "FJ" => Ok(Fj), + "FK" => Ok(Fk), + "FO" => Ok(Fo), + "FR" => Ok(Fr), + "GA" => Ok(Ga), + "GB" => Ok(Gb), + "GD" => Ok(Gd), + "GE" => Ok(Ge), + "GF" => Ok(Gf), + "GG" => Ok(Gg), + "GH" => Ok(Gh), + "GI" => Ok(Gi), + "GL" => Ok(Gl), + "GM" => Ok(Gm), + "GN" => Ok(Gn), + "GP" => Ok(Gp), + "GQ" => Ok(Gq), + "GR" => Ok(Gr), + "GS" => Ok(Gs), + "GT" => Ok(Gt), + "GU" => Ok(Gu), + "GW" => Ok(Gw), + "GY" => Ok(Gy), + "HK" => Ok(Hk), + "HN" => Ok(Hn), + "HR" => Ok(Hr), + "HT" => Ok(Ht), + "HU" => Ok(Hu), + "ID" => Ok(Id), + "IE" => Ok(Ie), + "IL" => Ok(Il), + "IM" => Ok(Im), + "IN" => Ok(In), + "IO" => Ok(Io), + "IQ" => Ok(Iq), + "IS" => Ok(Is), + "IT" => Ok(It), + "JE" => Ok(Je), + "JM" => Ok(Jm), + "JO" => Ok(Jo), + "JP" => Ok(Jp), + "KE" => Ok(Ke), + "KG" => Ok(Kg), + "KH" => Ok(Kh), + "KI" => Ok(Ki), + "KM" => Ok(Km), + "KN" => Ok(Kn), + "KR" => Ok(Kr), + "KW" => Ok(Kw), + "KY" => Ok(Ky), + "KZ" => Ok(Kz), + "LA" => Ok(La), + "LB" => Ok(Lb), + "LC" => Ok(Lc), + "LI" => Ok(Li), + "LK" => Ok(Lk), + "LR" => Ok(Lr), + "LS" => Ok(Ls), + "LT" => Ok(Lt), + "LU" => Ok(Lu), + "LV" => Ok(Lv), + "LY" => Ok(Ly), + "MA" => Ok(Ma), + "MC" => Ok(Mc), + "MD" => Ok(Md), + "ME" => Ok(Me), + "MF" => Ok(Mf), + "MG" => Ok(Mg), + "MK" => Ok(Mk), + "ML" => Ok(Ml), + "MM" => Ok(Mm), + "MN" => Ok(Mn), + "MO" => Ok(Mo), + "MQ" => Ok(Mq), + "MR" => Ok(Mr), + "MS" => Ok(Ms), + "MT" => Ok(Mt), + "MU" => Ok(Mu), + "MV" => Ok(Mv), + "MW" => Ok(Mw), + "MX" => Ok(Mx), + "MY" => Ok(My), + "MZ" => Ok(Mz), + "NA" => Ok(Na), + "NC" => Ok(Nc), + "NE" => Ok(Ne), + "NG" => Ok(Ng), + "NI" => Ok(Ni), + "NL" => Ok(Nl), + "NO" => Ok(No), + "NP" => Ok(Np), + "NR" => Ok(Nr), + "NU" => Ok(Nu), + "NZ" => Ok(Nz), + "OM" => Ok(Om), + "PA" => Ok(Pa), + "PE" => Ok(Pe), + "PF" => Ok(Pf), + "PG" => Ok(Pg), + "PH" => Ok(Ph), + "PK" => Ok(Pk), + "PL" => Ok(Pl), + "PM" => Ok(Pm), + "PN" => Ok(Pn), + "PR" => Ok(Pr), + "PS" => Ok(Ps), + "PT" => Ok(Pt), + "PY" => Ok(Py), + "QA" => Ok(Qa), + "RE" => Ok(Re), + "RO" => Ok(Ro), + "RS" => Ok(Rs), + "RU" => Ok(Ru), + "RW" => Ok(Rw), + "SA" => Ok(Sa), + "SB" => Ok(Sb), + "SC" => Ok(Sc), + "SE" => Ok(Se), + "SG" => Ok(Sg), + "SH" => Ok(Sh), + "SI" => Ok(Si), + "SJ" => Ok(Sj), + "SK" => Ok(Sk), + "SL" => Ok(Sl), + "SM" => Ok(Sm), + "SN" => Ok(Sn), + "SO" => Ok(So), + "SR" => Ok(Sr), + "SS" => Ok(Ss), + "ST" => Ok(St), + "SV" => Ok(Sv), + "SX" => Ok(Sx), + "SZ" => Ok(Sz), + "TA" => Ok(Ta), + "TC" => Ok(Tc), + "TD" => Ok(Td), + "TF" => Ok(Tf), + "TG" => Ok(Tg), + "TH" => Ok(Th), + "TJ" => Ok(Tj), + "TK" => Ok(Tk), + "TL" => Ok(Tl), + "TM" => Ok(Tm), + "TN" => Ok(Tn), + "TO" => Ok(To), + "TR" => Ok(Tr), + "TT" => Ok(Tt), + "TV" => Ok(Tv), + "TW" => Ok(Tw), + "TZ" => Ok(Tz), + "UA" => Ok(Ua), + "UG" => Ok(Ug), + "US" => Ok(Us), + "UY" => Ok(Uy), + "UZ" => Ok(Uz), + "VA" => Ok(Va), + "VC" => Ok(Vc), + "VE" => Ok(Ve), + "VG" => Ok(Vg), + "VN" => Ok(Vn), + "VU" => Ok(Vu), + "WF" => Ok(Wf), + "WS" => Ok(Ws), + "XK" => Ok(Xk), + "YE" => Ok(Ye), + "YT" => Ok(Yt), + "ZA" => Ok(Za), + "ZM" => Ok(Zm), + "ZW" => Ok(Zw), + "ZZ" => Ok(Zz), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentLinkShippingAddressCollectionAllowedCountries { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentLinkShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkShippingAddressCollectionAllowedCountries { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkShippingOptions<'a> { + /// The ID of the Shipping Rate to use for this shipping option. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option<&'a str>, +} +impl<'a> CreatePaymentLinkShippingOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. +/// +/// Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkSubmitType { + Auto, + Book, + Donate, + Pay, +} +impl CreatePaymentLinkSubmitType { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkSubmitType::*; + match self { + Auto => "auto", + Book => "book", + Donate => "donate", + Pay => "pay", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkSubmitType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkSubmitType::*; + match s { + "auto" => Ok(Auto), + "book" => Ok(Book), + "donate" => Ok(Donate), + "pay" => Ok(Pay), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentLinkSubmitType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentLinkSubmitType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkSubmitType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkSubmitType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// When creating a subscription, the specified configuration data will be used. +/// +/// There must be at least one line item with a recurring price to use `subscription_data`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkSubscriptionData<'a> { + /// The subscription's description, meant to be displayable to the customer. + /// + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. + /// + /// Unlike object-level metadata, this field is declarative. + /// Updates will clear prior values. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Integer representing the number of trial period days before the customer is charged for the first time. + /// + /// Has to be at least 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_period_days: Option, +} +impl<'a> CreatePaymentLinkSubscriptionData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls tax ID collection during checkout. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkTaxIdCollection { + /// Set to `true` to enable tax ID collection. + pub enabled: bool, +} +impl CreatePaymentLinkTaxIdCollection { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkTransferData<'a> { + /// The amount that will be transferred automatically when a charge succeeds. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// If specified, successful charges will be attributed to the destination + /// account for tax reporting, and the funds from charges will be transferred + /// to the destination account. + /// + /// The ID of the resulting transfer will be returned on the successful charge's `transfer` field. + pub destination: &'a str, +} +impl<'a> CreatePaymentLinkTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount: Default::default(), destination } + } +} +impl<'a> CreatePaymentLink<'a> { + /// Creates a payment link. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/payment_links", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentLink<'a> { + /// Whether the payment link's `url` is active. + /// + /// If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Behavior after the purchase is complete. + #[serde(skip_serializing_if = "Option::is_none")] + pub after_completion: Option>, + /// Enables user redeemable promotion codes. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_promotion_codes: Option, + /// Configuration for automatic tax collection. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// Configuration for collecting the customer's billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_address_collection: Option, + /// Collect additional information from your customer using custom fields. + /// + /// Up to 2 fields are supported. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [UpdatePaymentLinkCustomFields<'a>]>, + /// Display additional text for your customers using custom text. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_text: Option>, + /// Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_creation: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Generate a post-purchase Invoice for one-time payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_creation: Option>, + /// The line items representing what is being sold. + /// + /// Each line item represents an item being sold. + /// Up to 20 line items are supported. + #[serde(skip_serializing_if = "Option::is_none")] + pub line_items: Option<&'a [UpdatePaymentLinkLineItems<'a>]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + /// Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent_data: Option>, + /// Specify whether Checkout should collect a payment method. + /// + /// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_collection: Option, + /// The list of payment method types that customers can use. + /// + /// Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [UpdatePaymentLinkPaymentMethodTypes]>, + /// Configuration for collecting the customer's shipping address. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_address_collection: Option>, + /// When creating a subscription, the specified configuration data will be used. + /// + /// There must be at least one line item with a recurring price to use `subscription_data`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_data: Option>, +} +impl<'a> UpdatePaymentLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Behavior after the purchase is complete. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkAfterCompletion<'a> { + /// Configuration when `type=hosted_confirmation`. + #[serde(skip_serializing_if = "Option::is_none")] + pub hosted_confirmation: Option>, + /// Configuration when `type=redirect`. + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect: Option>, + /// The specified behavior after the purchase is complete. + /// + /// Either `redirect` or `hosted_confirmation`. + #[serde(rename = "type")] + pub type_: UpdatePaymentLinkAfterCompletionType, +} +impl<'a> UpdatePaymentLinkAfterCompletion<'a> { + pub fn new(type_: UpdatePaymentLinkAfterCompletionType) -> Self { + Self { hosted_confirmation: Default::default(), redirect: Default::default(), type_ } + } +} +/// Configuration when `type=hosted_confirmation`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentLinkAfterCompletionHostedConfirmation<'a> { + /// A custom message to display to the customer after the purchase is complete. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_message: Option<&'a str>, +} +impl<'a> UpdatePaymentLinkAfterCompletionHostedConfirmation<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration when `type=redirect`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkAfterCompletionRedirect<'a> { + /// The URL the customer will be redirected to after the purchase is complete. + /// + /// You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included. + pub url: &'a str, +} +impl<'a> UpdatePaymentLinkAfterCompletionRedirect<'a> { + pub fn new(url: &'a str) -> Self { + Self { url } + } +} +/// The specified behavior after the purchase is complete. +/// +/// Either `redirect` or `hosted_confirmation`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentLinkAfterCompletionType { + HostedConfirmation, + Redirect, +} +impl UpdatePaymentLinkAfterCompletionType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkAfterCompletionType::*; + match self { + HostedConfirmation => "hosted_confirmation", + Redirect => "redirect", + } + } +} + +impl std::str::FromStr for UpdatePaymentLinkAfterCompletionType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkAfterCompletionType::*; + match s { + "hosted_confirmation" => Ok(HostedConfirmation), + "redirect" => Ok(Redirect), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentLinkAfterCompletionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentLinkAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentLinkAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentLinkAfterCompletionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for automatic tax collection. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkAutomaticTax { + /// If `true`, tax will be calculated automatically using the customer's location. + pub enabled: bool, +} +impl UpdatePaymentLinkAutomaticTax { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Configuration for collecting the customer's billing address. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentLinkBillingAddressCollection { + Auto, + Required, +} +impl UpdatePaymentLinkBillingAddressCollection { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkBillingAddressCollection::*; + match self { + Auto => "auto", + Required => "required", + } + } +} + +impl std::str::FromStr for UpdatePaymentLinkBillingAddressCollection { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkBillingAddressCollection::*; + match s { + "auto" => Ok(Auto), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentLinkBillingAddressCollection { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentLinkBillingAddressCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentLinkBillingAddressCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentLinkBillingAddressCollection { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Collect additional information from your customer using custom fields. +/// +/// Up to 2 fields are supported. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkCustomFields<'a> { + /// Configuration for `type=dropdown` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub dropdown: Option>, + /// String of your choice that your integration can use to reconcile this field. + /// + /// Must be unique to this field, alphanumeric, and up to 200 characters. + pub key: &'a str, + /// The label for the field, displayed to the customer. + pub label: UpdatePaymentLinkCustomFieldsLabel<'a>, + /// Configuration for `type=numeric` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub numeric: Option, + /// Whether the customer is required to complete the field before completing the Checkout Session. + /// + /// Defaults to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub optional: Option, + /// Configuration for `type=text` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub text: Option, + /// The type of the field. + #[serde(rename = "type")] + pub type_: UpdatePaymentLinkCustomFieldsType, +} +impl<'a> UpdatePaymentLinkCustomFields<'a> { + pub fn new( + key: &'a str, + label: UpdatePaymentLinkCustomFieldsLabel<'a>, + type_: UpdatePaymentLinkCustomFieldsType, + ) -> Self { + Self { + dropdown: Default::default(), + key, + label, + numeric: Default::default(), + optional: Default::default(), + text: Default::default(), + type_, + } + } +} +/// Configuration for `type=dropdown` fields. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkCustomFieldsDropdown<'a> { + /// The options available for the customer to select. + /// + /// Up to 200 options allowed. + pub options: &'a [UpdatePaymentLinkCustomFieldsDropdownOptions<'a>], +} +impl<'a> UpdatePaymentLinkCustomFieldsDropdown<'a> { + pub fn new(options: &'a [UpdatePaymentLinkCustomFieldsDropdownOptions<'a>]) -> Self { + Self { options } + } +} +/// The options available for the customer to select. +/// +/// Up to 200 options allowed. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkCustomFieldsDropdownOptions<'a> { + /// The label for the option, displayed to the customer. + /// + /// Up to 100 characters. + pub label: &'a str, + /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. + /// + /// Must be unique to this option, alphanumeric, and up to 100 characters. + pub value: &'a str, +} +impl<'a> UpdatePaymentLinkCustomFieldsDropdownOptions<'a> { + pub fn new(label: &'a str, value: &'a str) -> Self { + Self { label, value } + } +} +/// The label for the field, displayed to the customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkCustomFieldsLabel<'a> { + /// Custom text for the label, displayed to the customer. + /// + /// Up to 50 characters. + pub custom: &'a str, + /// The type of the label. + #[serde(rename = "type")] + pub type_: UpdatePaymentLinkCustomFieldsLabelType, +} +impl<'a> UpdatePaymentLinkCustomFieldsLabel<'a> { + pub fn new(custom: &'a str, type_: UpdatePaymentLinkCustomFieldsLabelType) -> Self { + Self { custom, type_ } + } +} +/// The type of the label. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentLinkCustomFieldsLabelType { + Custom, +} +impl UpdatePaymentLinkCustomFieldsLabelType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkCustomFieldsLabelType::*; + match self { + Custom => "custom", + } + } +} + +impl std::str::FromStr for UpdatePaymentLinkCustomFieldsLabelType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkCustomFieldsLabelType::*; + match s { + "custom" => Ok(Custom), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentLinkCustomFieldsLabelType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentLinkCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentLinkCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentLinkCustomFieldsLabelType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for `type=numeric` fields. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentLinkCustomFieldsNumeric { + /// The maximum character length constraint for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_length: Option, +} +impl UpdatePaymentLinkCustomFieldsNumeric { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for `type=text` fields. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentLinkCustomFieldsText { + /// The maximum character length constraint for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_length: Option, +} +impl UpdatePaymentLinkCustomFieldsText { + pub fn new() -> Self { + Self::default() + } +} +/// The type of the field. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentLinkCustomFieldsType { + Dropdown, + Numeric, + Text, +} +impl UpdatePaymentLinkCustomFieldsType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkCustomFieldsType::*; + match self { + Dropdown => "dropdown", + Numeric => "numeric", + Text => "text", + } + } +} + +impl std::str::FromStr for UpdatePaymentLinkCustomFieldsType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkCustomFieldsType::*; + match s { + "dropdown" => Ok(Dropdown), + "numeric" => Ok(Numeric), + "text" => Ok(Text), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentLinkCustomFieldsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentLinkCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentLinkCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentLinkCustomFieldsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Display additional text for your customers using custom text. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentLinkCustomText<'a> { + /// Custom text that should be displayed alongside shipping address collection. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_address: Option>, + /// Custom text that should be displayed alongside the payment confirmation button. + #[serde(skip_serializing_if = "Option::is_none")] + pub submit: Option>, + /// Custom text that should be displayed in place of the default terms of service agreement text. + #[serde(skip_serializing_if = "Option::is_none")] + pub terms_of_service_acceptance: + Option>, +} +impl<'a> UpdatePaymentLinkCustomText<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Custom text that should be displayed alongside shipping address collection. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkCustomTextShippingAddress<'a> { + /// Text may be up to 1200 characters in length. + pub message: &'a str, +} +impl<'a> UpdatePaymentLinkCustomTextShippingAddress<'a> { + pub fn new(message: &'a str) -> Self { + Self { message } + } +} +/// Custom text that should be displayed alongside the payment confirmation button. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkCustomTextSubmit<'a> { + /// Text may be up to 1200 characters in length. + pub message: &'a str, +} +impl<'a> UpdatePaymentLinkCustomTextSubmit<'a> { + pub fn new(message: &'a str) -> Self { + Self { message } + } +} +/// Custom text that should be displayed in place of the default terms of service agreement text. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkCustomTextTermsOfServiceAcceptance<'a> { + /// Text may be up to 1200 characters in length. + pub message: &'a str, +} +impl<'a> UpdatePaymentLinkCustomTextTermsOfServiceAcceptance<'a> { + pub fn new(message: &'a str) -> Self { + Self { message } + } +} +/// Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentLinkCustomerCreation { + Always, + IfRequired, +} +impl UpdatePaymentLinkCustomerCreation { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkCustomerCreation::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for UpdatePaymentLinkCustomerCreation { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkCustomerCreation::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentLinkCustomerCreation { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentLinkCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentLinkCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentLinkCustomerCreation { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Generate a post-purchase Invoice for one-time payments. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkInvoiceCreation<'a> { + /// Whether the feature is enabled. + pub enabled: bool, + /// Invoice PDF configuration. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_data: Option>, +} +impl<'a> UpdatePaymentLinkInvoiceCreation<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, invoice_data: Default::default() } + } +} +/// Invoice PDF configuration. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentLinkInvoiceCreationInvoiceData<'a> { + /// The account tax IDs associated with the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option<&'a [&'a str]>, + /// Default custom fields to be displayed on invoices for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [UpdatePaymentLinkInvoiceCreationInvoiceDataCustomFields<'a>]>, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Default footer to be displayed on invoices for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Default options for invoice PDF rendering for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering_options: Option, +} +impl<'a> UpdatePaymentLinkInvoiceCreationInvoiceData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Default custom fields to be displayed on invoices for this customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkInvoiceCreationInvoiceDataCustomFields<'a> { + /// The name of the custom field. + /// + /// This may be up to 30 characters. + pub name: &'a str, + /// The value of the custom field. + /// + /// This may be up to 30 characters. + pub value: &'a str, +} +impl<'a> UpdatePaymentLinkInvoiceCreationInvoiceDataCustomFields<'a> { + pub fn new(name: &'a str, value: &'a str) -> Self { + Self { name, value } + } +} +/// Default options for invoice PDF rendering for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: + Option, +} +impl UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr + for UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The line items representing what is being sold. +/// +/// Each line item represents an item being sold. +/// Up to 20 line items are supported. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkLineItems<'a> { + /// When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout. + #[serde(skip_serializing_if = "Option::is_none")] + pub adjustable_quantity: Option, + /// The ID of an existing line item on the payment link. + pub id: &'a str, + /// The quantity of the line item being purchased. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, +} +impl<'a> UpdatePaymentLinkLineItems<'a> { + pub fn new(id: &'a str) -> Self { + Self { adjustable_quantity: Default::default(), id, quantity: Default::default() } + } +} +/// When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkLineItemsAdjustableQuantity { + /// Set to true if the quantity can be adjusted to any non-negative Integer. + pub enabled: bool, + /// The maximum quantity the customer can purchase. + /// + /// By default this value is 99. + /// You can specify a value up to 999. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option, + /// The minimum quantity the customer can purchase. + /// + /// By default this value is 0. + /// If there is only one item in the cart then that item's quantity cannot go down to 0. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option, +} +impl UpdatePaymentLinkLineItemsAdjustableQuantity { + pub fn new(enabled: bool) -> Self { + Self { enabled, maximum: Default::default(), minimum: Default::default() } + } +} +/// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentLinkPaymentIntentData<'a> { + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. + /// + /// Unlike object-level metadata, this field is declarative. + /// Updates will clear prior values. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Extra information about the payment. + /// + /// This will appear on your customer's statement when this payment succeeds in creating a charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// Provides information about the charge that customers see on their statements. + /// + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. + /// Maximum 22 characters for the concatenated descriptor. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix: Option<&'a str>, +} +impl<'a> UpdatePaymentLinkPaymentIntentData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Specify whether Checkout should collect a payment method. +/// +/// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentLinkPaymentMethodCollection { + Always, + IfRequired, +} +impl UpdatePaymentLinkPaymentMethodCollection { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkPaymentMethodCollection::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for UpdatePaymentLinkPaymentMethodCollection { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkPaymentMethodCollection::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentLinkPaymentMethodCollection { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentLinkPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentLinkPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentLinkPaymentMethodCollection { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of payment method types that customers can use. +/// +/// Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdatePaymentLinkPaymentMethodTypes { + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Card, + Cashapp, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdatePaymentLinkPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkPaymentMethodTypes::*; + match self { + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdatePaymentLinkPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkPaymentMethodTypes::*; + match s { + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentLinkPaymentMethodTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentLinkPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentLinkPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentLinkPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for collecting the customer's shipping address. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkShippingAddressCollection<'a> { + /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for + /// shipping locations. + /// + /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + pub allowed_countries: &'a [UpdatePaymentLinkShippingAddressCollectionAllowedCountries], +} +impl<'a> UpdatePaymentLinkShippingAddressCollection<'a> { + pub fn new( + allowed_countries: &'a [UpdatePaymentLinkShippingAddressCollectionAllowedCountries], + ) -> Self { + Self { allowed_countries } + } +} +/// An array of two-letter ISO country codes representing which countries Checkout should provide as options for +/// shipping locations. +/// +/// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdatePaymentLinkShippingAddressCollectionAllowedCountries { + Ac, + Ad, + Ae, + Af, + Ag, + Ai, + Al, + Am, + Ao, + Aq, + Ar, + At, + Au, + Aw, + Ax, + Az, + Ba, + Bb, + Bd, + Be, + Bf, + Bg, + Bh, + Bi, + Bj, + Bl, + Bm, + Bn, + Bo, + Bq, + Br, + Bs, + Bt, + Bv, + Bw, + By, + Bz, + Ca, + Cd, + Cf, + Cg, + Ch, + Ci, + Ck, + Cl, + Cm, + Cn, + Co, + Cr, + Cv, + Cw, + Cy, + Cz, + De, + Dj, + Dk, + Dm, + Do, + Dz, + Ec, + Ee, + Eg, + Eh, + Er, + Es, + Et, + Fi, + Fj, + Fk, + Fo, + Fr, + Ga, + Gb, + Gd, + Ge, + Gf, + Gg, + Gh, + Gi, + Gl, + Gm, + Gn, + Gp, + Gq, + Gr, + Gs, + Gt, + Gu, + Gw, + Gy, + Hk, + Hn, + Hr, + Ht, + Hu, + Id, + Ie, + Il, + Im, + In, + Io, + Iq, + Is, + It, + Je, + Jm, + Jo, + Jp, + Ke, + Kg, + Kh, + Ki, + Km, + Kn, + Kr, + Kw, + Ky, + Kz, + La, + Lb, + Lc, + Li, + Lk, + Lr, + Ls, + Lt, + Lu, + Lv, + Ly, + Ma, + Mc, + Md, + Me, + Mf, + Mg, + Mk, + Ml, + Mm, + Mn, + Mo, + Mq, + Mr, + Ms, + Mt, + Mu, + Mv, + Mw, + Mx, + My, + Mz, + Na, + Nc, + Ne, + Ng, + Ni, + Nl, + No, + Np, + Nr, + Nu, + Nz, + Om, + Pa, + Pe, + Pf, + Pg, + Ph, + Pk, + Pl, + Pm, + Pn, + Pr, + Ps, + Pt, + Py, + Qa, + Re, + Ro, + Rs, + Ru, + Rw, + Sa, + Sb, + Sc, + Se, + Sg, + Sh, + Si, + Sj, + Sk, + Sl, + Sm, + Sn, + So, + Sr, + Ss, + St, + Sv, + Sx, + Sz, + Ta, + Tc, + Td, + Tf, + Tg, + Th, + Tj, + Tk, + Tl, + Tm, + Tn, + To, + Tr, + Tt, + Tv, + Tw, + Tz, + Ua, + Ug, + Us, + Uy, + Uz, + Va, + Vc, + Ve, + Vg, + Vn, + Vu, + Wf, + Ws, + Xk, + Ye, + Yt, + Za, + Zm, + Zw, + Zz, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdatePaymentLinkShippingAddressCollectionAllowedCountries { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkShippingAddressCollectionAllowedCountries::*; + match self { + Ac => "AC", + Ad => "AD", + Ae => "AE", + Af => "AF", + Ag => "AG", + Ai => "AI", + Al => "AL", + Am => "AM", + Ao => "AO", + Aq => "AQ", + Ar => "AR", + At => "AT", + Au => "AU", + Aw => "AW", + Ax => "AX", + Az => "AZ", + Ba => "BA", + Bb => "BB", + Bd => "BD", + Be => "BE", + Bf => "BF", + Bg => "BG", + Bh => "BH", + Bi => "BI", + Bj => "BJ", + Bl => "BL", + Bm => "BM", + Bn => "BN", + Bo => "BO", + Bq => "BQ", + Br => "BR", + Bs => "BS", + Bt => "BT", + Bv => "BV", + Bw => "BW", + By => "BY", + Bz => "BZ", + Ca => "CA", + Cd => "CD", + Cf => "CF", + Cg => "CG", + Ch => "CH", + Ci => "CI", + Ck => "CK", + Cl => "CL", + Cm => "CM", + Cn => "CN", + Co => "CO", + Cr => "CR", + Cv => "CV", + Cw => "CW", + Cy => "CY", + Cz => "CZ", + De => "DE", + Dj => "DJ", + Dk => "DK", + Dm => "DM", + Do => "DO", + Dz => "DZ", + Ec => "EC", + Ee => "EE", + Eg => "EG", + Eh => "EH", + Er => "ER", + Es => "ES", + Et => "ET", + Fi => "FI", + Fj => "FJ", + Fk => "FK", + Fo => "FO", + Fr => "FR", + Ga => "GA", + Gb => "GB", + Gd => "GD", + Ge => "GE", + Gf => "GF", + Gg => "GG", + Gh => "GH", + Gi => "GI", + Gl => "GL", + Gm => "GM", + Gn => "GN", + Gp => "GP", + Gq => "GQ", + Gr => "GR", + Gs => "GS", + Gt => "GT", + Gu => "GU", + Gw => "GW", + Gy => "GY", + Hk => "HK", + Hn => "HN", + Hr => "HR", + Ht => "HT", + Hu => "HU", + Id => "ID", + Ie => "IE", + Il => "IL", + Im => "IM", + In => "IN", + Io => "IO", + Iq => "IQ", + Is => "IS", + It => "IT", + Je => "JE", + Jm => "JM", + Jo => "JO", + Jp => "JP", + Ke => "KE", + Kg => "KG", + Kh => "KH", + Ki => "KI", + Km => "KM", + Kn => "KN", + Kr => "KR", + Kw => "KW", + Ky => "KY", + Kz => "KZ", + La => "LA", + Lb => "LB", + Lc => "LC", + Li => "LI", + Lk => "LK", + Lr => "LR", + Ls => "LS", + Lt => "LT", + Lu => "LU", + Lv => "LV", + Ly => "LY", + Ma => "MA", + Mc => "MC", + Md => "MD", + Me => "ME", + Mf => "MF", + Mg => "MG", + Mk => "MK", + Ml => "ML", + Mm => "MM", + Mn => "MN", + Mo => "MO", + Mq => "MQ", + Mr => "MR", + Ms => "MS", + Mt => "MT", + Mu => "MU", + Mv => "MV", + Mw => "MW", + Mx => "MX", + My => "MY", + Mz => "MZ", + Na => "NA", + Nc => "NC", + Ne => "NE", + Ng => "NG", + Ni => "NI", + Nl => "NL", + No => "NO", + Np => "NP", + Nr => "NR", + Nu => "NU", + Nz => "NZ", + Om => "OM", + Pa => "PA", + Pe => "PE", + Pf => "PF", + Pg => "PG", + Ph => "PH", + Pk => "PK", + Pl => "PL", + Pm => "PM", + Pn => "PN", + Pr => "PR", + Ps => "PS", + Pt => "PT", + Py => "PY", + Qa => "QA", + Re => "RE", + Ro => "RO", + Rs => "RS", + Ru => "RU", + Rw => "RW", + Sa => "SA", + Sb => "SB", + Sc => "SC", + Se => "SE", + Sg => "SG", + Sh => "SH", + Si => "SI", + Sj => "SJ", + Sk => "SK", + Sl => "SL", + Sm => "SM", + Sn => "SN", + So => "SO", + Sr => "SR", + Ss => "SS", + St => "ST", + Sv => "SV", + Sx => "SX", + Sz => "SZ", + Ta => "TA", + Tc => "TC", + Td => "TD", + Tf => "TF", + Tg => "TG", + Th => "TH", + Tj => "TJ", + Tk => "TK", + Tl => "TL", + Tm => "TM", + Tn => "TN", + To => "TO", + Tr => "TR", + Tt => "TT", + Tv => "TV", + Tw => "TW", + Tz => "TZ", + Ua => "UA", + Ug => "UG", + Us => "US", + Uy => "UY", + Uz => "UZ", + Va => "VA", + Vc => "VC", + Ve => "VE", + Vg => "VG", + Vn => "VN", + Vu => "VU", + Wf => "WF", + Ws => "WS", + Xk => "XK", + Ye => "YE", + Yt => "YT", + Za => "ZA", + Zm => "ZM", + Zw => "ZW", + Zz => "ZZ", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdatePaymentLinkShippingAddressCollectionAllowedCountries { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkShippingAddressCollectionAllowedCountries::*; + match s { + "AC" => Ok(Ac), + "AD" => Ok(Ad), + "AE" => Ok(Ae), + "AF" => Ok(Af), + "AG" => Ok(Ag), + "AI" => Ok(Ai), + "AL" => Ok(Al), + "AM" => Ok(Am), + "AO" => Ok(Ao), + "AQ" => Ok(Aq), + "AR" => Ok(Ar), + "AT" => Ok(At), + "AU" => Ok(Au), + "AW" => Ok(Aw), + "AX" => Ok(Ax), + "AZ" => Ok(Az), + "BA" => Ok(Ba), + "BB" => Ok(Bb), + "BD" => Ok(Bd), + "BE" => Ok(Be), + "BF" => Ok(Bf), + "BG" => Ok(Bg), + "BH" => Ok(Bh), + "BI" => Ok(Bi), + "BJ" => Ok(Bj), + "BL" => Ok(Bl), + "BM" => Ok(Bm), + "BN" => Ok(Bn), + "BO" => Ok(Bo), + "BQ" => Ok(Bq), + "BR" => Ok(Br), + "BS" => Ok(Bs), + "BT" => Ok(Bt), + "BV" => Ok(Bv), + "BW" => Ok(Bw), + "BY" => Ok(By), + "BZ" => Ok(Bz), + "CA" => Ok(Ca), + "CD" => Ok(Cd), + "CF" => Ok(Cf), + "CG" => Ok(Cg), + "CH" => Ok(Ch), + "CI" => Ok(Ci), + "CK" => Ok(Ck), + "CL" => Ok(Cl), + "CM" => Ok(Cm), + "CN" => Ok(Cn), + "CO" => Ok(Co), + "CR" => Ok(Cr), + "CV" => Ok(Cv), + "CW" => Ok(Cw), + "CY" => Ok(Cy), + "CZ" => Ok(Cz), + "DE" => Ok(De), + "DJ" => Ok(Dj), + "DK" => Ok(Dk), + "DM" => Ok(Dm), + "DO" => Ok(Do), + "DZ" => Ok(Dz), + "EC" => Ok(Ec), + "EE" => Ok(Ee), + "EG" => Ok(Eg), + "EH" => Ok(Eh), + "ER" => Ok(Er), + "ES" => Ok(Es), + "ET" => Ok(Et), + "FI" => Ok(Fi), + "FJ" => Ok(Fj), + "FK" => Ok(Fk), + "FO" => Ok(Fo), + "FR" => Ok(Fr), + "GA" => Ok(Ga), + "GB" => Ok(Gb), + "GD" => Ok(Gd), + "GE" => Ok(Ge), + "GF" => Ok(Gf), + "GG" => Ok(Gg), + "GH" => Ok(Gh), + "GI" => Ok(Gi), + "GL" => Ok(Gl), + "GM" => Ok(Gm), + "GN" => Ok(Gn), + "GP" => Ok(Gp), + "GQ" => Ok(Gq), + "GR" => Ok(Gr), + "GS" => Ok(Gs), + "GT" => Ok(Gt), + "GU" => Ok(Gu), + "GW" => Ok(Gw), + "GY" => Ok(Gy), + "HK" => Ok(Hk), + "HN" => Ok(Hn), + "HR" => Ok(Hr), + "HT" => Ok(Ht), + "HU" => Ok(Hu), + "ID" => Ok(Id), + "IE" => Ok(Ie), + "IL" => Ok(Il), + "IM" => Ok(Im), + "IN" => Ok(In), + "IO" => Ok(Io), + "IQ" => Ok(Iq), + "IS" => Ok(Is), + "IT" => Ok(It), + "JE" => Ok(Je), + "JM" => Ok(Jm), + "JO" => Ok(Jo), + "JP" => Ok(Jp), + "KE" => Ok(Ke), + "KG" => Ok(Kg), + "KH" => Ok(Kh), + "KI" => Ok(Ki), + "KM" => Ok(Km), + "KN" => Ok(Kn), + "KR" => Ok(Kr), + "KW" => Ok(Kw), + "KY" => Ok(Ky), + "KZ" => Ok(Kz), + "LA" => Ok(La), + "LB" => Ok(Lb), + "LC" => Ok(Lc), + "LI" => Ok(Li), + "LK" => Ok(Lk), + "LR" => Ok(Lr), + "LS" => Ok(Ls), + "LT" => Ok(Lt), + "LU" => Ok(Lu), + "LV" => Ok(Lv), + "LY" => Ok(Ly), + "MA" => Ok(Ma), + "MC" => Ok(Mc), + "MD" => Ok(Md), + "ME" => Ok(Me), + "MF" => Ok(Mf), + "MG" => Ok(Mg), + "MK" => Ok(Mk), + "ML" => Ok(Ml), + "MM" => Ok(Mm), + "MN" => Ok(Mn), + "MO" => Ok(Mo), + "MQ" => Ok(Mq), + "MR" => Ok(Mr), + "MS" => Ok(Ms), + "MT" => Ok(Mt), + "MU" => Ok(Mu), + "MV" => Ok(Mv), + "MW" => Ok(Mw), + "MX" => Ok(Mx), + "MY" => Ok(My), + "MZ" => Ok(Mz), + "NA" => Ok(Na), + "NC" => Ok(Nc), + "NE" => Ok(Ne), + "NG" => Ok(Ng), + "NI" => Ok(Ni), + "NL" => Ok(Nl), + "NO" => Ok(No), + "NP" => Ok(Np), + "NR" => Ok(Nr), + "NU" => Ok(Nu), + "NZ" => Ok(Nz), + "OM" => Ok(Om), + "PA" => Ok(Pa), + "PE" => Ok(Pe), + "PF" => Ok(Pf), + "PG" => Ok(Pg), + "PH" => Ok(Ph), + "PK" => Ok(Pk), + "PL" => Ok(Pl), + "PM" => Ok(Pm), + "PN" => Ok(Pn), + "PR" => Ok(Pr), + "PS" => Ok(Ps), + "PT" => Ok(Pt), + "PY" => Ok(Py), + "QA" => Ok(Qa), + "RE" => Ok(Re), + "RO" => Ok(Ro), + "RS" => Ok(Rs), + "RU" => Ok(Ru), + "RW" => Ok(Rw), + "SA" => Ok(Sa), + "SB" => Ok(Sb), + "SC" => Ok(Sc), + "SE" => Ok(Se), + "SG" => Ok(Sg), + "SH" => Ok(Sh), + "SI" => Ok(Si), + "SJ" => Ok(Sj), + "SK" => Ok(Sk), + "SL" => Ok(Sl), + "SM" => Ok(Sm), + "SN" => Ok(Sn), + "SO" => Ok(So), + "SR" => Ok(Sr), + "SS" => Ok(Ss), + "ST" => Ok(St), + "SV" => Ok(Sv), + "SX" => Ok(Sx), + "SZ" => Ok(Sz), + "TA" => Ok(Ta), + "TC" => Ok(Tc), + "TD" => Ok(Td), + "TF" => Ok(Tf), + "TG" => Ok(Tg), + "TH" => Ok(Th), + "TJ" => Ok(Tj), + "TK" => Ok(Tk), + "TL" => Ok(Tl), + "TM" => Ok(Tm), + "TN" => Ok(Tn), + "TO" => Ok(To), + "TR" => Ok(Tr), + "TT" => Ok(Tt), + "TV" => Ok(Tv), + "TW" => Ok(Tw), + "TZ" => Ok(Tz), + "UA" => Ok(Ua), + "UG" => Ok(Ug), + "US" => Ok(Us), + "UY" => Ok(Uy), + "UZ" => Ok(Uz), + "VA" => Ok(Va), + "VC" => Ok(Vc), + "VE" => Ok(Ve), + "VG" => Ok(Vg), + "VN" => Ok(Vn), + "VU" => Ok(Vu), + "WF" => Ok(Wf), + "WS" => Ok(Ws), + "XK" => Ok(Xk), + "YE" => Ok(Ye), + "YT" => Ok(Yt), + "ZA" => Ok(Za), + "ZM" => Ok(Zm), + "ZW" => Ok(Zw), + "ZZ" => Ok(Zz), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentLinkShippingAddressCollectionAllowedCountries { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentLinkShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentLinkShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentLinkShippingAddressCollectionAllowedCountries { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// When creating a subscription, the specified configuration data will be used. +/// +/// There must be at least one line item with a recurring price to use `subscription_data`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentLinkSubscriptionData<'a> { + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. + /// + /// Unlike object-level metadata, this field is declarative. + /// Updates will clear prior values. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdatePaymentLinkSubscriptionData<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdatePaymentLink<'a> { + /// Updates a payment link. + pub fn send( + &self, + client: &stripe::Client, + payment_link: &stripe_types::payment_link::PaymentLinkId, + ) -> stripe::Response { + client.send_form(&format!("/payment_links/{payment_link}"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_payment/src/payment_links_resource_after_completion/mod.rs b/generated/stripe_payment/src/payment_links_resource_after_completion/mod.rs new file mode 100644 index 000000000..e1a03d720 --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_after_completion/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_after_completion::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_automatic_tax/mod.rs b/generated/stripe_payment/src/payment_links_resource_automatic_tax/mod.rs new file mode 100644 index 000000000..3c057069e --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_automatic_tax/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_automatic_tax::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_completion_behavior_confirmation_page/mod.rs b/generated/stripe_payment/src/payment_links_resource_completion_behavior_confirmation_page/mod.rs new file mode 100644 index 000000000..46152d641 --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_completion_behavior_confirmation_page/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_completion_behavior_confirmation_page::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_completion_behavior_redirect/mod.rs b/generated/stripe_payment/src/payment_links_resource_completion_behavior_redirect/mod.rs new file mode 100644 index 000000000..8c4f0f5e2 --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_completion_behavior_redirect/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_completion_behavior_redirect::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_consent_collection/mod.rs b/generated/stripe_payment/src/payment_links_resource_consent_collection/mod.rs new file mode 100644 index 000000000..e0520066d --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_consent_collection/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_consent_collection::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_custom_fields/mod.rs b/generated/stripe_payment/src/payment_links_resource_custom_fields/mod.rs new file mode 100644 index 000000000..27418de19 --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_custom_fields/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_custom_fields::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_custom_fields_dropdown/mod.rs b/generated/stripe_payment/src/payment_links_resource_custom_fields_dropdown/mod.rs new file mode 100644 index 000000000..e36497e17 --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_custom_fields_dropdown/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_custom_fields_dropdown::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_custom_fields_dropdown_option/mod.rs b/generated/stripe_payment/src/payment_links_resource_custom_fields_dropdown_option/mod.rs new file mode 100644 index 000000000..6dffb9bc3 --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_custom_fields_dropdown_option/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_custom_fields_dropdown_option::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_custom_fields_label/mod.rs b/generated/stripe_payment/src/payment_links_resource_custom_fields_label/mod.rs new file mode 100644 index 000000000..636146014 --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_custom_fields_label/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_custom_fields_label::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_custom_fields_numeric/mod.rs b/generated/stripe_payment/src/payment_links_resource_custom_fields_numeric/mod.rs new file mode 100644 index 000000000..c88e79403 --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_custom_fields_numeric/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_custom_fields_numeric::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_custom_fields_text/mod.rs b/generated/stripe_payment/src/payment_links_resource_custom_fields_text/mod.rs new file mode 100644 index 000000000..d3048a743 --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_custom_fields_text/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_custom_fields_text::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_custom_text/mod.rs b/generated/stripe_payment/src/payment_links_resource_custom_text/mod.rs new file mode 100644 index 000000000..32d9632e4 --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_custom_text/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_custom_text::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_custom_text_position/mod.rs b/generated/stripe_payment/src/payment_links_resource_custom_text_position/mod.rs new file mode 100644 index 000000000..20eb2d1ba --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_custom_text_position/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_custom_text_position::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_invoice_creation/mod.rs b/generated/stripe_payment/src/payment_links_resource_invoice_creation/mod.rs new file mode 100644 index 000000000..58d1b1230 --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_invoice_creation/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_invoice_creation::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_invoice_settings/mod.rs b/generated/stripe_payment/src/payment_links_resource_invoice_settings/mod.rs new file mode 100644 index 000000000..48515d33d --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_invoice_settings/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_invoice_settings::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_payment_intent_data/mod.rs b/generated/stripe_payment/src/payment_links_resource_payment_intent_data/mod.rs new file mode 100644 index 000000000..da4b0a039 --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_payment_intent_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_payment_intent_data::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_phone_number_collection/mod.rs b/generated/stripe_payment/src/payment_links_resource_phone_number_collection/mod.rs new file mode 100644 index 000000000..5b28a2138 --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_phone_number_collection/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_phone_number_collection::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_shipping_address_collection/mod.rs b/generated/stripe_payment/src/payment_links_resource_shipping_address_collection/mod.rs new file mode 100644 index 000000000..6772e7d45 --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_shipping_address_collection/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_shipping_address_collection::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_shipping_option/mod.rs b/generated/stripe_payment/src/payment_links_resource_shipping_option/mod.rs new file mode 100644 index 000000000..b6212e91d --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_shipping_option/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_shipping_option::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_subscription_data/mod.rs b/generated/stripe_payment/src/payment_links_resource_subscription_data/mod.rs new file mode 100644 index 000000000..dc73a4d6a --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_subscription_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_subscription_data::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_tax_id_collection/mod.rs b/generated/stripe_payment/src/payment_links_resource_tax_id_collection/mod.rs new file mode 100644 index 000000000..53a4b2ed1 --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_tax_id_collection/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_tax_id_collection::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_links_resource_transfer_data/mod.rs b/generated/stripe_payment/src/payment_links_resource_transfer_data/mod.rs new file mode 100644 index 000000000..1a337c347 --- /dev/null +++ b/generated/stripe_payment/src/payment_links_resource_transfer_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_links_resource_transfer_data::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method/mod.rs b/generated/stripe_payment/src/payment_method/mod.rs new file mode 100644 index 000000000..1ef66d7c6 --- /dev/null +++ b/generated/stripe_payment/src/payment_method/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::payment_method::*; +#[cfg(feature = "payment_method")] +mod requests; +#[cfg(feature = "payment_method")] +pub use requests::*; diff --git a/generated/stripe_payment/src/payment_method/requests.rs b/generated/stripe_payment/src/payment_method/requests.rs new file mode 100644 index 000000000..17e5991e9 --- /dev/null +++ b/generated/stripe_payment/src/payment_method/requests.rs @@ -0,0 +1,1735 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethod<'a> { + /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option<&'a serde_json::Value>, + /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option<&'a serde_json::Value>, + /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option<&'a serde_json::Value>, + /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option>, + /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option>, + /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option<&'a serde_json::Value>, + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: Option>, + /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option<&'a serde_json::Value>, + /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option>, + /// If this is a `card` PaymentMethod, this hash contains the user's card details. + /// + /// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. + /// When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). + /// We strongly recommend using Stripe.js instead of interacting with this API directly. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option<&'a serde_json::Value>, + /// The `Customer` to whom the original PaymentMethod is attached. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option<&'a serde_json::Value>, + /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option<&'a serde_json::Value>, + /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option<&'a serde_json::Value>, + /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option<&'a serde_json::Value>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option<&'a serde_json::Value>, + /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// The PaymentMethod to share. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option<&'a serde_json::Value>, + /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option<&'a serde_json::Value>, + /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option<&'a serde_json::Value>, + /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option<&'a serde_json::Value>, + /// Options to configure Radar. + /// + /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option<&'a serde_json::Value>, + /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// The type of the PaymentMethod. + /// + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option<&'a serde_json::Value>, + /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option<&'a serde_json::Value>, +} +impl<'a> CreatePaymentMethod<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodAcssDebit<'a> { + /// Customer's bank account number. + pub account_number: &'a str, + /// Institution number of the customer's bank. + pub institution_number: &'a str, + /// Transit number of the customer's bank. + pub transit_number: &'a str, +} +impl<'a> CreatePaymentMethodAcssDebit<'a> { + pub fn new( + account_number: &'a str, + institution_number: &'a str, + transit_number: &'a str, + ) -> Self { + Self { account_number, institution_number, transit_number } + } +} +/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodAuBecsDebit<'a> { + /// The account number for the bank account. + pub account_number: &'a str, + /// Bank-State-Branch number of the bank account. + pub bsb_number: &'a str, +} +impl<'a> CreatePaymentMethodAuBecsDebit<'a> { + pub fn new(account_number: &'a str, bsb_number: &'a str) -> Self { + Self { account_number, bsb_number } + } +} +/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodBacsDebit<'a> { + /// Account number of the bank account that the funds will be debited from. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Sort code of the bank account. + /// + /// (e.g., `10-20-30`). + #[serde(skip_serializing_if = "Option::is_none")] + pub sort_code: Option<&'a str>, +} +impl<'a> CreatePaymentMethodBacsDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodBillingDetails<'a> { + /// Billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Billing phone number (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> CreatePaymentMethodBillingDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodBillingDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreatePaymentMethodBillingDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodBoleto<'a> { + /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers). + pub tax_id: &'a str, +} +impl<'a> CreatePaymentMethodBoleto<'a> { + pub fn new(tax_id: &'a str) -> Self { + Self { tax_id } + } +} +/// If this is a `card` PaymentMethod, this hash contains the user's card details. +/// +/// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. +/// When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). +/// We strongly recommend using Stripe.js instead of interacting with this API directly. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreatePaymentMethodCard<'a> { + CardDetailsParams(CreatePaymentMethodCardDetailsParams<'a>), + TokenParams(CreatePaymentMethodTokenParams<'a>), +} +/// If this is a `card` PaymentMethod, this hash contains the user's card details. +/// +/// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. +/// When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). +/// We strongly recommend using Stripe.js instead of interacting with this API directly. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodCardDetailsParams<'a> { + /// The card's CVC. + /// + /// It is highly recommended to always include this value. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc: Option<&'a str>, + /// Two-digit number representing the card's expiration month. + pub exp_month: i64, + /// Four-digit number representing the card's expiration year. + pub exp_year: i64, + /// The card number, as a string without any separators. + pub number: &'a str, +} +impl<'a> CreatePaymentMethodCardDetailsParams<'a> { + pub fn new(exp_month: i64, exp_year: i64, number: &'a str) -> Self { + Self { cvc: Default::default(), exp_month, exp_year, number } + } +} +/// If this is a `card` PaymentMethod, this hash contains the user's card details. +/// +/// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. +/// When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). +/// We strongly recommend using Stripe.js instead of interacting with this API directly. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodTokenParams<'a> { + /// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format card: {token: "tok_visa"}. + pub token: &'a str, +} +impl<'a> CreatePaymentMethodTokenParams<'a> { + pub fn new(token: &'a str) -> Self { + Self { token } + } +} +/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodEps { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreatePaymentMethodEps { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentMethodEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentMethodEpsBank { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentMethodEpsBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodFpx { + /// Account holder type for FPX transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The customer's bank. + pub bank: CreatePaymentMethodFpxBank, +} +impl CreatePaymentMethodFpx { + pub fn new(bank: CreatePaymentMethodFpxBank) -> Self { + Self { account_holder_type: Default::default(), bank } + } +} +/// Account holder type for FPX transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodFpxAccountHolderType { + Company, + Individual, +} +impl CreatePaymentMethodFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentMethodFpxAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentMethodFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentMethodFpxBank { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentMethodFpxBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodIdeal { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreatePaymentMethodIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentMethodIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentMethodIdealBank { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentMethodIdealBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodKlarna { + /// Customer's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, +} +impl CreatePaymentMethodKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Customer's date of birth. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodKlarnaDob { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl CreatePaymentMethodKlarnaDob { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodP24 { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreatePaymentMethodP24 { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentMethodP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentMethodP24Bank { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentMethodP24Bank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options to configure Radar. +/// +/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodRadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> CreatePaymentMethodRadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodSepaDebit<'a> { + /// IBAN of the bank account. + pub iban: &'a str, +} +impl<'a> CreatePaymentMethodSepaDebit<'a> { + pub fn new(iban: &'a str) -> Self { + Self { iban } + } +} +/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodSofort { + /// Two-letter ISO code representing the country the bank account is located in. + pub country: CreatePaymentMethodSofortCountry, +} +impl CreatePaymentMethodSofort { + pub fn new(country: CreatePaymentMethodSofortCountry) -> Self { + Self { country } + } +} +/// Two-letter ISO code representing the country the bank account is located in. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodSofortCountry { + At, + Be, + De, + Es, + It, + Nl, +} +impl CreatePaymentMethodSofortCountry { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodSofortCountry::*; + match self { + At => "AT", + Be => "BE", + De => "DE", + Es => "ES", + It => "IT", + Nl => "NL", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodSofortCountry { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodSofortCountry::*; + match s { + "AT" => Ok(At), + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "IT" => Ok(It), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentMethodSofortCountry { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodSofortCountry { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of the PaymentMethod. +/// +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentMethodType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Card, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentMethodType { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentMethodType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodUsBankAccount<'a> { + /// Account holder type: individual or company. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// Account number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Account type: checkings or savings. + /// + /// Defaults to checking if omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// The ID of a Financial Connections Account to use as a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections_account: Option<&'a str>, + /// Routing number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> CreatePaymentMethodUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodUsBankAccountAccountHolderType { + Company, + Individual, +} +impl CreatePaymentMethodUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentMethodUsBankAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Account type: checkings or savings. +/// +/// Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodUsBankAccountAccountType { + Checking, + Savings, +} +impl CreatePaymentMethodUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl AsRef for CreatePaymentMethodUsBankAccountAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreatePaymentMethod<'a> { + /// Creates a PaymentMethod object. + /// + /// Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents](https://stripe.com/docs/payments/accept-a-payment) API to accept a payment immediately or the [SetupIntent](https://stripe.com/docs/payments/save-and-reuse) API to collect payment method details ahead of a future payment. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/payment_methods", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePaymentMethod<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePaymentMethod<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePaymentMethod<'a> { + /// Retrieves a PaymentMethod object attached to the StripeAccount. + /// + /// To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer’s PaymentMethods](https://stripe.com/docs/api/payment_methods/customer). + pub fn send( + &self, + client: &stripe::Client, + payment_method: &stripe_types::payment_method::PaymentMethodId, + ) -> stripe::Response { + client.get_query(&format!("/payment_methods/{payment_method}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethod<'a> { + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: Option>, + /// If this is a `card` PaymentMethod, this hash contains the user's card details. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option<&'a serde_json::Value>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} +impl<'a> UpdatePaymentMethod<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodBillingDetails<'a> { + /// Billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Billing phone number (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> UpdatePaymentMethodBillingDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodBillingDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdatePaymentMethodBillingDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `card` PaymentMethod, this hash contains the user's card details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodCard { + /// Two-digit number representing the card's expiration month. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option, + /// Four-digit number representing the card's expiration year. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option, +} +impl UpdatePaymentMethodCard { + pub fn new() -> Self { + Self::default() + } +} +/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodUsBankAccount { + /// Bank account type. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, +} +impl UpdatePaymentMethodUsBankAccount { + pub fn new() -> Self { + Self::default() + } +} +/// Bank account type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodUsBankAccountAccountHolderType { + Company, + Individual, +} +impl UpdatePaymentMethodUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for UpdatePaymentMethodUsBankAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdatePaymentMethod<'a> { + /// Updates a PaymentMethod object. + /// + /// A PaymentMethod must be attached a customer to be updated. + pub fn send( + &self, + client: &stripe::Client, + payment_method: &stripe_types::payment_method::PaymentMethodId, + ) -> stripe::Response { + client.send_form( + &format!("/payment_methods/{payment_method}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPaymentMethod<'a> { + /// The ID of the customer whose PaymentMethods will be retrieved. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// An optional filter on the list, based on the object `type` field. + /// + /// Without the filter, the list includes all current and future payment method types. + /// If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> ListPaymentMethod<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An optional filter on the list, based on the object `type` field. +/// +/// Without the filter, the list includes all current and future payment method types. +/// If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ListPaymentMethodType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Card, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ListPaymentMethodType { + pub fn as_str(self) -> &'static str { + use ListPaymentMethodType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ListPaymentMethodType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListPaymentMethodType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl AsRef for ListPaymentMethodType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListPaymentMethodType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListPaymentMethodType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListPaymentMethodType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListPaymentMethod<'a> { + /// Returns a list of PaymentMethods for Treasury flows. + /// + /// If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer’s PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/payment_methods", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/payment_methods", self) + } +} +impl<'a> stripe::PaginationParams for ListPaymentMethod<'a> {} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct AttachPaymentMethod<'a> { + /// The ID of the customer to which to attach the PaymentMethod. + pub customer: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> AttachPaymentMethod<'a> { + pub fn new(customer: &'a str) -> Self { + Self { customer, expand: Default::default() } + } +} +impl<'a> AttachPaymentMethod<'a> { + /// Attaches a PaymentMethod object to a Customer. + /// + /// To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) + /// or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). + /// These approaches will perform any necessary steps to set up the PaymentMethod for future payments. + /// + /// Using the `/v1/payment_methods/:id/attach` endpoint without first using a SetupIntent or PaymentIntent with `setup_future_usage` does not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up future payments. To use this PaymentMethod as the default for invoice or subscription payments, set `invoice_settings.default_payment_method`, on the Customer to the PaymentMethod’s ID. + pub fn send( + &self, + client: &stripe::Client, + payment_method: &stripe_types::payment_method::PaymentMethodId, + ) -> stripe::Response { + client.send_form( + &format!("/payment_methods/{payment_method}/attach"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DetachPaymentMethod<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> DetachPaymentMethod<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> DetachPaymentMethod<'a> { + /// Detaches a PaymentMethod object from a Customer. + /// + /// After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + pub fn send( + &self, + client: &stripe::Client, + payment_method: &stripe_types::payment_method::PaymentMethodId, + ) -> stripe::Response { + client.send_form( + &format!("/payment_methods/{payment_method}/detach"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_payment/src/payment_method_acss_debit/mod.rs b/generated/stripe_payment/src/payment_method_acss_debit/mod.rs new file mode 100644 index 000000000..8f815c5f9 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_acss_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_acss_debit::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_affirm/mod.rs b/generated/stripe_payment/src/payment_method_affirm/mod.rs new file mode 100644 index 000000000..8c3d8057d --- /dev/null +++ b/generated/stripe_payment/src/payment_method_affirm/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_affirm::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_afterpay_clearpay/mod.rs b/generated/stripe_payment/src/payment_method_afterpay_clearpay/mod.rs new file mode 100644 index 000000000..7f827152e --- /dev/null +++ b/generated/stripe_payment/src/payment_method_afterpay_clearpay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_afterpay_clearpay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_au_becs_debit/mod.rs b/generated/stripe_payment/src/payment_method_au_becs_debit/mod.rs new file mode 100644 index 000000000..334e23379 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_au_becs_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_au_becs_debit::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_bacs_debit/mod.rs b/generated/stripe_payment/src/payment_method_bacs_debit/mod.rs new file mode 100644 index 000000000..c89fe0396 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_bacs_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_bacs_debit::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_bancontact/mod.rs b/generated/stripe_payment/src/payment_method_bancontact/mod.rs new file mode 100644 index 000000000..ed010485c --- /dev/null +++ b/generated/stripe_payment/src/payment_method_bancontact/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_bancontact::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_blik/mod.rs b/generated/stripe_payment/src/payment_method_blik/mod.rs new file mode 100644 index 000000000..f749bcbac --- /dev/null +++ b/generated/stripe_payment/src/payment_method_blik/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_blik::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_boleto/mod.rs b/generated/stripe_payment/src/payment_method_boleto/mod.rs new file mode 100644 index 000000000..0c17f3d6a --- /dev/null +++ b/generated/stripe_payment/src/payment_method_boleto/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_boleto::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_card/mod.rs b/generated/stripe_payment/src/payment_method_card/mod.rs new file mode 100644 index 000000000..86556378e --- /dev/null +++ b/generated/stripe_payment/src/payment_method_card/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_card::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_card_checks/mod.rs b/generated/stripe_payment/src/payment_method_card_checks/mod.rs new file mode 100644 index 000000000..ad2c59f3d --- /dev/null +++ b/generated/stripe_payment/src/payment_method_card_checks/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_card_checks::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_card_present/mod.rs b/generated/stripe_payment/src/payment_method_card_present/mod.rs new file mode 100644 index 000000000..53ea282f1 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_card_present/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_card_present::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_card_present_networks/mod.rs b/generated/stripe_payment/src/payment_method_card_present_networks/mod.rs new file mode 100644 index 000000000..b9f191882 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_card_present_networks/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_card_present_networks::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_card_wallet/mod.rs b/generated/stripe_payment/src/payment_method_card_wallet/mod.rs new file mode 100644 index 000000000..eb950e188 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_card_wallet/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_card_wallet::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_card_wallet_amex_express_checkout/mod.rs b/generated/stripe_payment/src/payment_method_card_wallet_amex_express_checkout/mod.rs new file mode 100644 index 000000000..90b65d78b --- /dev/null +++ b/generated/stripe_payment/src/payment_method_card_wallet_amex_express_checkout/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_card_wallet_amex_express_checkout::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_card_wallet_apple_pay/mod.rs b/generated/stripe_payment/src/payment_method_card_wallet_apple_pay/mod.rs new file mode 100644 index 000000000..553e4e96d --- /dev/null +++ b/generated/stripe_payment/src/payment_method_card_wallet_apple_pay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_card_wallet_apple_pay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_card_wallet_google_pay/mod.rs b/generated/stripe_payment/src/payment_method_card_wallet_google_pay/mod.rs new file mode 100644 index 000000000..1fd1268d0 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_card_wallet_google_pay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_card_wallet_google_pay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_card_wallet_link/mod.rs b/generated/stripe_payment/src/payment_method_card_wallet_link/mod.rs new file mode 100644 index 000000000..18f05c0db --- /dev/null +++ b/generated/stripe_payment/src/payment_method_card_wallet_link/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_card_wallet_link::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_card_wallet_masterpass/mod.rs b/generated/stripe_payment/src/payment_method_card_wallet_masterpass/mod.rs new file mode 100644 index 000000000..7d176095e --- /dev/null +++ b/generated/stripe_payment/src/payment_method_card_wallet_masterpass/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_card_wallet_masterpass::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_card_wallet_samsung_pay/mod.rs b/generated/stripe_payment/src/payment_method_card_wallet_samsung_pay/mod.rs new file mode 100644 index 000000000..212a10651 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_card_wallet_samsung_pay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_card_wallet_samsung_pay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_card_wallet_visa_checkout/mod.rs b/generated/stripe_payment/src/payment_method_card_wallet_visa_checkout/mod.rs new file mode 100644 index 000000000..5aba63e8c --- /dev/null +++ b/generated/stripe_payment/src/payment_method_card_wallet_visa_checkout/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_card_wallet_visa_checkout::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_cashapp/mod.rs b/generated/stripe_payment/src/payment_method_cashapp/mod.rs new file mode 100644 index 000000000..57f4d73b3 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_cashapp/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_cashapp::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_config_biz_payment_method_configuration_details/mod.rs b/generated/stripe_payment/src/payment_method_config_biz_payment_method_configuration_details/mod.rs new file mode 100644 index 000000000..86595b81f --- /dev/null +++ b/generated/stripe_payment/src/payment_method_config_biz_payment_method_configuration_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_config_biz_payment_method_configuration_details::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_config_resource_display_preference/mod.rs b/generated/stripe_payment/src/payment_method_config_resource_display_preference/mod.rs new file mode 100644 index 000000000..6e8bd4f41 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_config_resource_display_preference/mod.rs @@ -0,0 +1,138 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodConfigResourceDisplayPreference { + /// For child configs, whether or not the account's preference will be observed. + /// + /// If `false`, the parent configuration's default is used. + pub overridable: Option, + /// The account's display preference. + pub preference: PaymentMethodConfigResourceDisplayPreferencePreference, + /// The effective display preference value. + pub value: PaymentMethodConfigResourceDisplayPreferenceValue, +} +/// The account's display preference. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodConfigResourceDisplayPreferencePreference { + None, + Off, + On, +} +impl PaymentMethodConfigResourceDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use PaymentMethodConfigResourceDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for PaymentMethodConfigResourceDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodConfigResourceDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodConfigResourceDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodConfigResourceDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodConfigResourceDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodConfigResourceDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodConfigResourceDisplayPreferencePreference { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodConfigResourceDisplayPreferencePreference", + ) + }) + } +} +/// The effective display preference value. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodConfigResourceDisplayPreferenceValue { + Off, + On, +} +impl PaymentMethodConfigResourceDisplayPreferenceValue { + pub fn as_str(self) -> &'static str { + use PaymentMethodConfigResourceDisplayPreferenceValue::*; + match self { + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for PaymentMethodConfigResourceDisplayPreferenceValue { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodConfigResourceDisplayPreferenceValue::*; + match s { + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodConfigResourceDisplayPreferenceValue { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodConfigResourceDisplayPreferenceValue { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodConfigResourceDisplayPreferenceValue { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodConfigResourceDisplayPreferenceValue { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodConfigResourceDisplayPreferenceValue { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodConfigResourceDisplayPreferenceValue", + ) + }) + } +} diff --git a/generated/stripe_payment/src/payment_method_config_resource_payment_method_configuration/mod.rs b/generated/stripe_payment/src/payment_method_config_resource_payment_method_configuration/mod.rs new file mode 100644 index 000000000..9fbdcf16f --- /dev/null +++ b/generated/stripe_payment/src/payment_method_config_resource_payment_method_configuration/mod.rs @@ -0,0 +1,109 @@ +/// PaymentMethodConfigurations control which payment methods are displayed to your customers when you don't explicitly specify payment method types. +/// +/// You can have multiple configurations with different sets of payment methods for different scenarios. There are two types of PaymentMethodConfigurations. +/// Which is used depends on the [charge type](https://stripe.com/docs/connect/charges): **Direct** configurations apply to payments created on your account, including Connect destination charges, Connect separate charges and transfers, and payments not involving Connect. **Child** configurations apply to payments created on your connected accounts using direct charges, and charges with the on_behalf_of parameter. Child configurations have a `parent` that sets default values and controls which settings connected accounts may override. +/// You can specify a parent ID at payment time, and Stripe will automatically resolve the connected account’s associated child configuration. +/// Parent configurations are [managed in the dashboard](https://dashboard.stripe.com/settings/payment_methods/connected_accounts) and are not available in this API. Related guides: - [Payment Method Configurations API](https://stripe.com/docs/connect/payment-method-configurations) - [Multiple configurations on dynamic payment methods](https://stripe.com/docs/payments/multiple-payment-method-configs) - [Multiple configurations for your Connect accounts](https://stripe.com/docs/connect/multiple-payment-method-configurations) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodConfigResourcePaymentMethodConfiguration { +#[serde(skip_serializing_if = "Option::is_none")] +pub acss_debit: Option, + /// Whether the configuration can be used for new payments. +pub active: bool, +#[serde(skip_serializing_if = "Option::is_none")] +pub affirm: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub afterpay_clearpay: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub alipay: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub apple_pay: Option, + /// For child configs, the Connect application associated with the configuration. +pub application: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub au_becs_debit: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub bacs_debit: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub bancontact: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub blik: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub boleto: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub card: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub cartes_bancaires: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub cashapp: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub eps: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub fpx: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub giropay: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub google_pay: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub grabpay: Option, + /// Unique identifier for the object. +pub id: stripe_payment::payment_method_config_resource_payment_method_configuration::PaymentMethodConfigurationId, +#[serde(skip_serializing_if = "Option::is_none")] +pub id_bank_transfer: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub ideal: Option, + /// The default configuration is used whenever a payment method configuration is not specified. +pub is_default: bool, +#[serde(skip_serializing_if = "Option::is_none")] +pub jcb: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub klarna: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub konbini: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub link: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. +pub livemode: bool, +#[serde(skip_serializing_if = "Option::is_none")] +pub multibanco: Option, + /// The configuration's name. +pub name: String, +#[serde(skip_serializing_if = "Option::is_none")] +pub netbanking: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub oxxo: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub p24: Option, + /// For child configs, the configuration's parent configuration. +pub parent: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub pay_by_bank: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub paynow: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub paypal: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub promptpay: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub sepa_debit: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub sofort: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub upi: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub us_bank_account: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub wechat_pay: Option, + +} +impl stripe_types::Object for PaymentMethodConfigResourcePaymentMethodConfiguration { + type Id = stripe_payment::payment_method_config_resource_payment_method_configuration::PaymentMethodConfigurationId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(PaymentMethodConfigurationId); +#[cfg(feature = "payment_method_config_resource_payment_method_configuration")] +mod requests; +#[cfg(feature = "payment_method_config_resource_payment_method_configuration")] +pub use requests::*; diff --git a/generated/stripe_payment/src/payment_method_config_resource_payment_method_configuration/requests.rs b/generated/stripe_payment/src/payment_method_config_resource_payment_method_configuration/requests.rs new file mode 100644 index 000000000..f51143be1 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_config_resource_payment_method_configuration/requests.rs @@ -0,0 +1,6332 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPaymentMethodConfigResourcePaymentMethodConfiguration<'a> { + /// The Connect application to filter by. + #[serde(skip_serializing_if = "Option::is_none")] + pub application: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ListPaymentMethodConfigResourcePaymentMethodConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPaymentMethodConfigResourcePaymentMethodConfiguration<'a> { + /// List payment method configurations. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response< + stripe_types::List, + > { + client.get_query("/payment_method_configurations", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator + { + stripe::ListPaginator::from_params("/payment_method_configurations", self) + } +} +impl<'a> stripe::PaginationParams + for ListPaymentMethodConfigResourcePaymentMethodConfiguration<'a> +{ +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePaymentMethodConfigResourcePaymentMethodConfiguration<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePaymentMethodConfigResourcePaymentMethodConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePaymentMethodConfigResourcePaymentMethodConfiguration<'a> { + /// Retrieve payment method configuration. + pub fn send( + &self, + client: &stripe::Client, + configuration: &str, + ) -> stripe::Response + { + client.get_query(&format!("/payment_method_configurations/{configuration}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfiguration<'a> { + /// Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + /// Whether the configuration can be used for new payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// [Affirm](https://www.affirm.com/) gives your customers a way to split purchases over a series of payments. + /// + /// Depending on the purchase, they can pay with four interest-free payments (Split Pay) or pay over a longer term (Installments), which might include interest. + /// Check this [page](https://stripe.com/docs/payments/affirm) for more details like country availability. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option, + /// Afterpay gives your customers a way to pay for purchases in installments, check this [page](https://stripe.com/docs/payments/afterpay-clearpay) for more details like country availability. + /// + /// Afterpay is particularly popular among businesses selling fashion, beauty, and sports products. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: + Option, + /// Alipay is a digital wallet in China that has more than a billion active users worldwide. + /// + /// Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. + /// Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. + /// Check this [page](https://stripe.com/docs/payments/alipay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + /// Stripe users can accept [Apple Pay](/payments/apple-pay) in iOS applications in iOS 9 and later, and on the web in Safari starting with iOS 10 or macOS Sierra. + /// + /// There are no additional fees to process Apple Pay payments, and the [pricing](/pricing) is the same as other card transactions. + /// Check this [page](https://stripe.com/docs/apple-pay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub apple_pay: Option, + /// Apple Pay Later, a payment method for customers to buy now and pay later, gives your customers a way to split purchases into four installments across six weeks. + #[serde(skip_serializing_if = "Option::is_none")] + pub apple_pay_later: + Option, + /// Stripe users in Australia can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with an Australian bank account. + /// + /// Check this [page](https://stripe.com/docs/payments/au-becs-debit) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: + Option, + /// Stripe users in the UK can accept Bacs Direct Debit payments from customers with a UK bank account, check this [page](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + /// Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. + /// + /// [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. + /// Check this [page](https://stripe.com/docs/payments/bancontact) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. + /// + /// When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. + /// Check this [page](https://stripe.com/docs/payments/blik) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option, + /// Boleto is an official (regulated by the Central Bank of Brazil) payment method in Brazil. + /// + /// Check this [page](https://stripe.com/docs/payments/boleto) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + /// Cards are a popular way for consumers and businesses to pay online or in person. + /// + /// Stripe supports global and local card networks. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + /// Cartes Bancaires is France's local card network. + /// + /// More than 95% of these cards are co-branded with either Visa or Mastercard, meaning you can process these cards over either Cartes Bancaires or the Visa or Mastercard networks. + /// Check this [page](https://stripe.com/docs/payments/cartes-bancaires) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub cartes_bancaires: + Option, + /// Cash App is a popular consumer app in the US that allows customers to bank, invest, send, and receive money using their digital wallet. + /// + /// Check this [page](https://stripe.com/docs/payments/cash-app-pay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. + /// + /// EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. + /// Check this [page](https://stripe.com/docs/payments/eps) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Financial Process Exchange (FPX) is a Malaysia-based payment method that allows customers to complete transactions online using their bank credentials. + /// + /// Bank Negara Malaysia (BNM), the Central Bank of Malaysia, and eleven other major Malaysian financial institutions are members of the PayNet Group, which owns and operates FPX. + /// It is one of the most popular online payment methods in Malaysia, with nearly 90 million transactions in 2018 according to BNM. + /// Check this [page](https://stripe.com/docs/payments/fpx) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// giropay is a German payment method based on online banking, introduced in 2006. + /// + /// It allows customers to complete transactions online using their online banking environment, with funds debited from their bank account. + /// Depending on their bank, customers confirm payments on giropay using a second factor of authentication or a PIN. + /// giropay accounts for 10% of online checkouts in Germany. + /// Check this [page](https://stripe.com/docs/payments/giropay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + /// Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. + /// + /// Use the Google Pay API to request any credit or debit card stored in your customer's Google account. + /// Check this [page](https://stripe.com/docs/google-pay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub google_pay: Option, + /// GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). + /// + /// GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. + /// Check this [page](https://stripe.com/docs/payments/grabpay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + /// iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. + /// + /// All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. + /// Check this [page](https://stripe.com/docs/payments/ideal) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// JCB is a credit card company based in Japan. + /// + /// JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in Australia, Canada, Hong Kong, Japan, New Zealand, Singapore, Switzerland, United Kingdom, United States, and all countries in the European Economic Area except Iceland. + /// Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub jcb: Option, + /// Klarna gives customers a range of [payment options](https://stripe.com/docs/payments/klarna#payment-options) during checkout. + /// + /// Available payment options vary depending on the customer's billing address and the transaction amount. + /// These payment options make it convenient for customers to purchase items in all price ranges. + /// Check this [page](https://stripe.com/docs/payments/klarna) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// Konbini allows customers in Japan to pay for bills and online purchases at convenience stores with cash. + /// + /// Check this [page](https://stripe.com/docs/payments/konbini) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option, + /// [Link](https://stripe.com/docs/payments/link) is a payment method network. + /// + /// With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + /// Configuration name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. + /// + /// OXXO allows customers to pay bills and online purchases in-store with cash. + /// Check this [page](https://stripe.com/docs/payments/oxxo) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + /// Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. + /// + /// Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. + /// Check this [page](https://stripe.com/docs/payments/p24) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. + /// + /// Check this [page](https://stripe.com/docs/payments/paynow) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + /// PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. + /// + /// Check this [page](https://stripe.com/docs/payments/paypal) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + /// PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. + /// + /// Check this [page](https://stripe.com/docs/payments/promptpay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option, + /// The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. + /// + /// SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + /// Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. + /// + /// Check this [page](https://stripe.com/docs/payments/sofort) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. + /// + /// Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: + Option, + /// WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. + /// + /// Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. + /// WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. + /// Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option, +} +impl<'a> UpdatePaymentMethodConfigResourcePaymentMethodConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebit { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference +{ + None, + Off, + On, +} +impl + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference +{ + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// [Affirm](https://www.affirm.com/) gives your customers a way to split purchases over a series of payments. +/// +/// Depending on the purchase, they can pay with four interest-free payments (Split Pay) or pay over a longer term (Installments), which might include interest. +/// Check this [page](https://stripe.com/docs/payments/affirm) for more details like country availability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAffirm { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAffirm { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Afterpay gives your customers a way to pay for purchases in installments, check this [page](https://stripe.com/docs/payments/afterpay-clearpay) for more details like country availability. +/// +/// Afterpay is particularly popular among businesses selling fashion, beauty, and sports products. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpay { + /// Whether or not the payment method should be displayed. +#[serde(skip_serializing_if = "Option::is_none")] +pub display_preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::*; + match self { +None => "none", +Off => "off", +On => "on", + + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Alipay is a digital wallet in China that has more than a billion active users worldwide. +/// +/// Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. +/// Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. +/// Check this [page](https://stripe.com/docs/payments/alipay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAlipay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAlipay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users can accept [Apple Pay](/payments/apple-pay) in iOS applications in iOS 9 and later, and on the web in Safari starting with iOS 10 or macOS Sierra. +/// +/// There are no additional fees to process Apple Pay payments, and the [pricing](/pricing) is the same as other card transactions. +/// Check this [page](https://stripe.com/docs/apple-pay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference +{ + None, + Off, + On, +} +impl + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference +{ + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Apple Pay Later, a payment method for customers to buy now and pay later, gives your customers a way to split purchases into four installments across six weeks. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLater { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLater { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::*; + match self { +None => "none", +Off => "off", +On => "on", + + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users in Australia can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with an Australian bank account. +/// +/// Check this [page](https://stripe.com/docs/payments/au-becs-debit) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebit { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::*; + match self { +None => "none", +Off => "off", +On => "on", + + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users in the UK can accept Bacs Direct Debit payments from customers with a UK bank account, check this [page](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebit { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference +{ + None, + Off, + On, +} +impl + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference +{ + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. +/// +/// [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. +/// Check this [page](https://stripe.com/docs/payments/bancontact) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBancontact { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference +{ + None, + Off, + On, +} +impl + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference +{ + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. +/// +/// When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. +/// Check this [page](https://stripe.com/docs/payments/blik) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBlik { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBlik { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Boleto is an official (regulated by the Central Bank of Brazil) payment method in Brazil. +/// +/// Check this [page](https://stripe.com/docs/payments/boleto) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBoleto { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBoleto { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Cards are a popular way for consumers and businesses to pay online or in person. +/// +/// Stripe supports global and local card networks. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCard { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCard { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Cartes Bancaires is France's local card network. +/// +/// More than 95% of these cards are co-branded with either Visa or Mastercard, meaning you can process these cards over either Cartes Bancaires or the Visa or Mastercard networks. +/// Check this [page](https://stripe.com/docs/payments/cartes-bancaires) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancaires { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancaires { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::*; + match self { +None => "none", +Off => "off", +On => "on", + + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Cash App is a popular consumer app in the US that allows customers to bank, invest, send, and receive money using their digital wallet. +/// +/// Check this [page](https://stripe.com/docs/payments/cash-app-pay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCashapp { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCashapp { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. +/// +/// EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. +/// Check this [page](https://stripe.com/docs/payments/eps) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationEps { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationEps { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Financial Process Exchange (FPX) is a Malaysia-based payment method that allows customers to complete transactions online using their bank credentials. +/// +/// Bank Negara Malaysia (BNM), the Central Bank of Malaysia, and eleven other major Malaysian financial institutions are members of the PayNet Group, which owns and operates FPX. +/// It is one of the most popular online payment methods in Malaysia, with nearly 90 million transactions in 2018 according to BNM. +/// Check this [page](https://stripe.com/docs/payments/fpx) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationFpx { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationFpx { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// giropay is a German payment method based on online banking, introduced in 2006. +/// +/// It allows customers to complete transactions online using their online banking environment, with funds debited from their bank account. +/// Depending on their bank, customers confirm payments on giropay using a second factor of authentication or a PIN. +/// giropay accounts for 10% of online checkouts in Germany. +/// Check this [page](https://stripe.com/docs/payments/giropay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGiropay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGiropay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. +/// +/// Use the Google Pay API to request any credit or debit card stored in your customer's Google account. +/// Check this [page](https://stripe.com/docs/google-pay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference +{ + None, + Off, + On, +} +impl + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference +{ + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). +/// +/// GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. +/// Check this [page](https://stripe.com/docs/payments/grabpay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. +/// +/// All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. +/// Check this [page](https://stripe.com/docs/payments/ideal) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationIdeal { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// JCB is a credit card company based in Japan. +/// +/// JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in Australia, Canada, Hong Kong, Japan, New Zealand, Singapore, Switzerland, United Kingdom, United States, and all countries in the European Economic Area except Iceland. +/// Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationJcb { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationJcb { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Klarna gives customers a range of [payment options](https://stripe.com/docs/payments/klarna#payment-options) during checkout. +/// +/// Available payment options vary depending on the customer's billing address and the transaction amount. +/// These payment options make it convenient for customers to purchase items in all price ranges. +/// Check this [page](https://stripe.com/docs/payments/klarna) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKlarna { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Konbini allows customers in Japan to pay for bills and online purchases at convenience stores with cash. +/// +/// Check this [page](https://stripe.com/docs/payments/konbini) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKonbini { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKonbini { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// [Link](https://stripe.com/docs/payments/link) is a payment method network. +/// +/// With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationLink { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationLink { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. +/// +/// OXXO allows customers to pay bills and online purchases in-store with cash. +/// Check this [page](https://stripe.com/docs/payments/oxxo) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationOxxo { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationOxxo { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. +/// +/// Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. +/// Check this [page](https://stripe.com/docs/payments/p24) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationP24 { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationP24 { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. +/// +/// Check this [page](https://stripe.com/docs/payments/paynow) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaynow { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaynow { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. +/// +/// Check this [page](https://stripe.com/docs/payments/paypal) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaypal { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaypal { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. +/// +/// Check this [page](https://stripe.com/docs/payments/promptpay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference +{ + None, + Off, + On, +} +impl + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference +{ + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. +/// +/// SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebit { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference +{ + None, + Off, + On, +} +impl + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference +{ + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. +/// +/// Check this [page](https://stripe.com/docs/payments/sofort) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSofort { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSofort { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. +/// +/// Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccount { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccount { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference +{ + None, + Off, + On, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::*; + match self { +None => "none", +Off => "off", +On => "on", + + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. +/// +/// Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. +/// WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. +/// Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreference, + >, +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl UpdatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference +{ + None, + Off, + On, +} +impl + UpdatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference +{ + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdatePaymentMethodConfigResourcePaymentMethodConfiguration<'a> { + /// Update payment method configuration. + pub fn send( + &self, + client: &stripe::Client, + configuration: &str, + ) -> stripe::Response + { + client.send_form( + &format!("/payment_method_configurations/{configuration}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfiguration<'a> { + /// Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + /// [Affirm](https://www.affirm.com/) gives your customers a way to split purchases over a series of payments. + /// + /// Depending on the purchase, they can pay with four interest-free payments (Split Pay) or pay over a longer term (Installments), which might include interest. + /// Check this [page](https://stripe.com/docs/payments/affirm) for more details like country availability. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option, + /// Afterpay gives your customers a way to pay for purchases in installments, check this [page](https://stripe.com/docs/payments/afterpay-clearpay) for more details like country availability. + /// + /// Afterpay is particularly popular among businesses selling fashion, beauty, and sports products. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: + Option, + /// Alipay is a digital wallet in China that has more than a billion active users worldwide. + /// + /// Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. + /// Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. + /// Check this [page](https://stripe.com/docs/payments/alipay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + /// Stripe users can accept [Apple Pay](/payments/apple-pay) in iOS applications in iOS 9 and later, and on the web in Safari starting with iOS 10 or macOS Sierra. + /// + /// There are no additional fees to process Apple Pay payments, and the [pricing](/pricing) is the same as other card transactions. + /// Check this [page](https://stripe.com/docs/apple-pay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub apple_pay: Option, + /// Apple Pay Later, a payment method for customers to buy now and pay later, gives your customers a way to split purchases into four installments across six weeks. + #[serde(skip_serializing_if = "Option::is_none")] + pub apple_pay_later: + Option, + /// Stripe users in Australia can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with an Australian bank account. + /// + /// Check this [page](https://stripe.com/docs/payments/au-becs-debit) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: + Option, + /// Stripe users in the UK can accept Bacs Direct Debit payments from customers with a UK bank account, check this [page](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + /// Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. + /// + /// [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. + /// Check this [page](https://stripe.com/docs/payments/bancontact) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. + /// + /// When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. + /// Check this [page](https://stripe.com/docs/payments/blik) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option, + /// Boleto is an official (regulated by the Central Bank of Brazil) payment method in Brazil. + /// + /// Check this [page](https://stripe.com/docs/payments/boleto) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + /// Cards are a popular way for consumers and businesses to pay online or in person. + /// + /// Stripe supports global and local card networks. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + /// Cartes Bancaires is France's local card network. + /// + /// More than 95% of these cards are co-branded with either Visa or Mastercard, meaning you can process these cards over either Cartes Bancaires or the Visa or Mastercard networks. + /// Check this [page](https://stripe.com/docs/payments/cartes-bancaires) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub cartes_bancaires: + Option, + /// Cash App is a popular consumer app in the US that allows customers to bank, invest, send, and receive money using their digital wallet. + /// + /// Check this [page](https://stripe.com/docs/payments/cash-app-pay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. + /// + /// EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. + /// Check this [page](https://stripe.com/docs/payments/eps) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Financial Process Exchange (FPX) is a Malaysia-based payment method that allows customers to complete transactions online using their bank credentials. + /// + /// Bank Negara Malaysia (BNM), the Central Bank of Malaysia, and eleven other major Malaysian financial institutions are members of the PayNet Group, which owns and operates FPX. + /// It is one of the most popular online payment methods in Malaysia, with nearly 90 million transactions in 2018 according to BNM. + /// Check this [page](https://stripe.com/docs/payments/fpx) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// giropay is a German payment method based on online banking, introduced in 2006. + /// + /// It allows customers to complete transactions online using their online banking environment, with funds debited from their bank account. + /// Depending on their bank, customers confirm payments on giropay using a second factor of authentication or a PIN. + /// giropay accounts for 10% of online checkouts in Germany. + /// Check this [page](https://stripe.com/docs/payments/giropay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + /// Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. + /// + /// Use the Google Pay API to request any credit or debit card stored in your customer's Google account. + /// Check this [page](https://stripe.com/docs/google-pay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub google_pay: Option, + /// GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). + /// + /// GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. + /// Check this [page](https://stripe.com/docs/payments/grabpay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + /// iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. + /// + /// All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. + /// Check this [page](https://stripe.com/docs/payments/ideal) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// JCB is a credit card company based in Japan. + /// + /// JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in Australia, Canada, Hong Kong, Japan, New Zealand, Singapore, Switzerland, United Kingdom, United States, and all countries in the European Economic Area except Iceland. + /// Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub jcb: Option, + /// Klarna gives customers a range of [payment options](https://stripe.com/docs/payments/klarna#payment-options) during checkout. + /// + /// Available payment options vary depending on the customer's billing address and the transaction amount. + /// These payment options make it convenient for customers to purchase items in all price ranges. + /// Check this [page](https://stripe.com/docs/payments/klarna) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// Konbini allows customers in Japan to pay for bills and online purchases at convenience stores with cash. + /// + /// Check this [page](https://stripe.com/docs/payments/konbini) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option, + /// [Link](https://stripe.com/docs/payments/link) is a payment method network. + /// + /// With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + /// Configuration name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. + /// + /// OXXO allows customers to pay bills and online purchases in-store with cash. + /// Check this [page](https://stripe.com/docs/payments/oxxo) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + /// Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. + /// + /// Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. + /// Check this [page](https://stripe.com/docs/payments/p24) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// Configuration's parent configuration. + /// + /// Specify to create a child configuration. + #[serde(skip_serializing_if = "Option::is_none")] + pub parent: Option<&'a str>, + /// PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. + /// + /// Check this [page](https://stripe.com/docs/payments/paynow) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + /// PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. + /// + /// Check this [page](https://stripe.com/docs/payments/paypal) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + /// PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. + /// + /// Check this [page](https://stripe.com/docs/payments/promptpay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option, + /// The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. + /// + /// SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + /// Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. + /// + /// Check this [page](https://stripe.com/docs/payments/sofort) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. + /// + /// Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: + Option, + /// WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. + /// + /// Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. + /// WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. + /// Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option, +} +impl<'a> CreatePaymentMethodConfigResourcePaymentMethodConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebit { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference +{ + None, + Off, + On, +} +impl + CreatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference +{ + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// [Affirm](https://www.affirm.com/) gives your customers a way to split purchases over a series of payments. +/// +/// Depending on the purchase, they can pay with four interest-free payments (Split Pay) or pay over a longer term (Installments), which might include interest. +/// Check this [page](https://stripe.com/docs/payments/affirm) for more details like country availability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationAffirm { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationAffirm { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAffirmDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Afterpay gives your customers a way to pay for purchases in installments, check this [page](https://stripe.com/docs/payments/afterpay-clearpay) for more details like country availability. +/// +/// Afterpay is particularly popular among businesses selling fashion, beauty, and sports products. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpay { + /// Whether or not the payment method should be displayed. +#[serde(skip_serializing_if = "Option::is_none")] +pub display_preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::*; + match self { +None => "none", +Off => "off", +On => "on", + + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Alipay is a digital wallet in China that has more than a billion active users worldwide. +/// +/// Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. +/// Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. +/// Check this [page](https://stripe.com/docs/payments/alipay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationAlipay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationAlipay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAlipayDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users can accept [Apple Pay](/payments/apple-pay) in iOS applications in iOS 9 and later, and on the web in Safari starting with iOS 10 or macOS Sierra. +/// +/// There are no additional fees to process Apple Pay payments, and the [pricing](/pricing) is the same as other card transactions. +/// Check this [page](https://stripe.com/docs/apple-pay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference +{ + None, + Off, + On, +} +impl + CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference +{ + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Apple Pay Later, a payment method for customers to buy now and pay later, gives your customers a way to split purchases into four installments across six weeks. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLater { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLater { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::*; + match self { +None => "none", +Off => "off", +On => "on", + + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigResourcePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users in Australia can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with an Australian bank account. +/// +/// Check this [page](https://stripe.com/docs/payments/au-becs-debit) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebit { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::*; + match self { +None => "none", +Off => "off", +On => "on", + + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigResourcePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users in the UK can accept Bacs Direct Debit payments from customers with a UK bank account, check this [page](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebit { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference +{ + None, + Off, + On, +} +impl + CreatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference +{ + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. +/// +/// [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. +/// Check this [page](https://stripe.com/docs/payments/bancontact) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationBancontact { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference +{ + None, + Off, + On, +} +impl + CreatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference +{ + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBancontactDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. +/// +/// When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. +/// Check this [page](https://stripe.com/docs/payments/blik) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationBlik { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationBlik { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBlikDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Boleto is an official (regulated by the Central Bank of Brazil) payment method in Brazil. +/// +/// Check this [page](https://stripe.com/docs/payments/boleto) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationBoleto { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationBoleto { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationBoletoDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Cards are a popular way for consumers and businesses to pay online or in person. +/// +/// Stripe supports global and local card networks. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationCard { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationCard { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationCardDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Cartes Bancaires is France's local card network. +/// +/// More than 95% of these cards are co-branded with either Visa or Mastercard, meaning you can process these cards over either Cartes Bancaires or the Visa or Mastercard networks. +/// Check this [page](https://stripe.com/docs/payments/cartes-bancaires) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancaires { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancaires { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::*; + match self { +None => "none", +Off => "off", +On => "on", + + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for CreatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigResourcePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Cash App is a popular consumer app in the US that allows customers to bank, invest, send, and receive money using their digital wallet. +/// +/// Check this [page](https://stripe.com/docs/payments/cash-app-pay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationCashapp { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationCashapp { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for CreatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigResourcePaymentMethodConfigurationCashappDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. +/// +/// EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. +/// Check this [page](https://stripe.com/docs/payments/eps) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationEps { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationEps { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationEpsDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Financial Process Exchange (FPX) is a Malaysia-based payment method that allows customers to complete transactions online using their bank credentials. +/// +/// Bank Negara Malaysia (BNM), the Central Bank of Malaysia, and eleven other major Malaysian financial institutions are members of the PayNet Group, which owns and operates FPX. +/// It is one of the most popular online payment methods in Malaysia, with nearly 90 million transactions in 2018 according to BNM. +/// Check this [page](https://stripe.com/docs/payments/fpx) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationFpx { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationFpx { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationFpxDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// giropay is a German payment method based on online banking, introduced in 2006. +/// +/// It allows customers to complete transactions online using their online banking environment, with funds debited from their bank account. +/// Depending on their bank, customers confirm payments on giropay using a second factor of authentication or a PIN. +/// giropay accounts for 10% of online checkouts in Germany. +/// Check this [page](https://stripe.com/docs/payments/giropay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationGiropay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationGiropay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for CreatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigResourcePaymentMethodConfigurationGiropayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. +/// +/// Use the Google Pay API to request any credit or debit card stored in your customer's Google account. +/// Check this [page](https://stripe.com/docs/google-pay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference +{ + None, + Off, + On, +} +impl + CreatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference +{ + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for CreatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigResourcePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). +/// +/// GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. +/// Check this [page](https://stripe.com/docs/payments/grabpay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for CreatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigResourcePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. +/// +/// All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. +/// Check this [page](https://stripe.com/docs/payments/ideal) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationIdeal { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationIdealDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// JCB is a credit card company based in Japan. +/// +/// JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in Australia, Canada, Hong Kong, Japan, New Zealand, Singapore, Switzerland, United Kingdom, United States, and all countries in the European Economic Area except Iceland. +/// Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationJcb { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationJcb { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationJcbDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Klarna gives customers a range of [payment options](https://stripe.com/docs/payments/klarna#payment-options) during checkout. +/// +/// Available payment options vary depending on the customer's billing address and the transaction amount. +/// These payment options make it convenient for customers to purchase items in all price ranges. +/// Check this [page](https://stripe.com/docs/payments/klarna) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationKlarna { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationKlarnaDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Konbini allows customers in Japan to pay for bills and online purchases at convenience stores with cash. +/// +/// Check this [page](https://stripe.com/docs/payments/konbini) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationKonbini { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationKonbini { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for CreatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigResourcePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// [Link](https://stripe.com/docs/payments/link) is a payment method network. +/// +/// With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationLink { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationLink { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationLinkDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. +/// +/// OXXO allows customers to pay bills and online purchases in-store with cash. +/// Check this [page](https://stripe.com/docs/payments/oxxo) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationOxxo { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationOxxo { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationOxxoDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. +/// +/// Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. +/// Check this [page](https://stripe.com/docs/payments/p24) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationP24 { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationP24 { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationP24DisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. +/// +/// Check this [page](https://stripe.com/docs/payments/paynow) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaynow { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaynow { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaynowDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. +/// +/// Check this [page](https://stripe.com/docs/payments/paypal) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaypal { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaypal { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationPaypalDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. +/// +/// Check this [page](https://stripe.com/docs/payments/promptpay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference +{ + None, + Off, + On, +} +impl + CreatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference +{ + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for CreatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigResourcePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. +/// +/// SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebit { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference +{ + None, + Off, + On, +} +impl + CreatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference +{ + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for CreatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigResourcePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. +/// +/// Check this [page](https://stripe.com/docs/payments/sofort) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationSofort { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationSofort { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl AsRef + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigResourcePaymentMethodConfigurationSofortDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. +/// +/// Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccount { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccount { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference +{ + None, + Off, + On, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::*; + match self { +None => "none", +Off => "off", +On => "on", + + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for CreatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigResourcePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. +/// +/// Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. +/// WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. +/// Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option< + CreatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreference, + >, +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreference { + /// The account's preference for whether or not to display this payment method. +#[serde(skip_serializing_if = "Option::is_none")] +pub preference: Option, + +} +impl CreatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference +{ + None, + Off, + On, +} +impl + CreatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference +{ + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), +"off" => Ok(Off), +"on" => Ok(On), +_ => Err(()) + + } + } +} +impl AsRef for CreatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigResourcePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreatePaymentMethodConfigResourcePaymentMethodConfiguration<'a> { + /// Creates a payment method configuration. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response + { + client.send_form("/payment_method_configurations", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_payment/src/payment_method_config_resource_payment_method_properties/mod.rs b/generated/stripe_payment/src/payment_method_config_resource_payment_method_properties/mod.rs new file mode 100644 index 000000000..5aa0622fc --- /dev/null +++ b/generated/stripe_payment/src/payment_method_config_resource_payment_method_properties/mod.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodConfigResourcePaymentMethodProperties { + /// Whether this payment method may be offered at checkout. + /// + /// True if `display_preference` is `on` and the payment method's capability is active. + pub available: bool, + pub display_preference: stripe_payment::PaymentMethodConfigResourceDisplayPreference, +} diff --git a/generated/stripe_payment/src/payment_method_customer_balance/mod.rs b/generated/stripe_payment/src/payment_method_customer_balance/mod.rs new file mode 100644 index 000000000..86a0432c3 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_customer_balance/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_customer_balance::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details/mod.rs b/generated/stripe_payment/src/payment_method_details/mod.rs new file mode 100644 index 000000000..44f82fd97 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_ach_credit_transfer/mod.rs b/generated/stripe_payment/src/payment_method_details_ach_credit_transfer/mod.rs new file mode 100644 index 000000000..11f365dd4 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_ach_credit_transfer/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_ach_credit_transfer::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_ach_debit/mod.rs b/generated/stripe_payment/src/payment_method_details_ach_debit/mod.rs new file mode 100644 index 000000000..20fc18910 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_ach_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_ach_debit::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_acss_debit/mod.rs b/generated/stripe_payment/src/payment_method_details_acss_debit/mod.rs new file mode 100644 index 000000000..8d8600e90 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_acss_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_acss_debit::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_affirm/mod.rs b/generated/stripe_payment/src/payment_method_details_affirm/mod.rs new file mode 100644 index 000000000..a0389f7e7 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_affirm/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_affirm::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_afterpay_clearpay/mod.rs b/generated/stripe_payment/src/payment_method_details_afterpay_clearpay/mod.rs new file mode 100644 index 000000000..9031bc4a1 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_afterpay_clearpay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_afterpay_clearpay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_au_becs_debit/mod.rs b/generated/stripe_payment/src/payment_method_details_au_becs_debit/mod.rs new file mode 100644 index 000000000..3c61570ce --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_au_becs_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_au_becs_debit::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_bacs_debit/mod.rs b/generated/stripe_payment/src/payment_method_details_bacs_debit/mod.rs new file mode 100644 index 000000000..a7c36acbc --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_bacs_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_bacs_debit::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_bancontact/mod.rs b/generated/stripe_payment/src/payment_method_details_bancontact/mod.rs new file mode 100644 index 000000000..7c688f95a --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_bancontact/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_bancontact::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_blik/mod.rs b/generated/stripe_payment/src/payment_method_details_blik/mod.rs new file mode 100644 index 000000000..0eb0af65f --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_blik/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_blik::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_boleto/mod.rs b/generated/stripe_payment/src/payment_method_details_boleto/mod.rs new file mode 100644 index 000000000..5e3cf2f40 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_boleto/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_boleto::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_card/mod.rs b/generated/stripe_payment/src/payment_method_details_card/mod.rs new file mode 100644 index 000000000..ccecd5276 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_card/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_card::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_card_checks/mod.rs b/generated/stripe_payment/src/payment_method_details_card_checks/mod.rs new file mode 100644 index 000000000..35d162534 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_card_checks/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_card_checks::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_card_installments/mod.rs b/generated/stripe_payment/src/payment_method_details_card_installments/mod.rs new file mode 100644 index 000000000..c768fe085 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_card_installments/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_card_installments::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_card_installments_plan/mod.rs b/generated/stripe_payment/src/payment_method_details_card_installments_plan/mod.rs new file mode 100644 index 000000000..d021e4cdb --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_card_installments_plan/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_card_installments_plan::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_card_network_token/mod.rs b/generated/stripe_payment/src/payment_method_details_card_network_token/mod.rs new file mode 100644 index 000000000..eac5611e2 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_card_network_token/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_card_network_token::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_card_present/mod.rs b/generated/stripe_payment/src/payment_method_details_card_present/mod.rs new file mode 100644 index 000000000..8a9cbfdce --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_card_present/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_card_present::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_card_present_offline/mod.rs b/generated/stripe_payment/src/payment_method_details_card_present_offline/mod.rs new file mode 100644 index 000000000..ea0cbd1c3 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_card_present_offline/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_card_present_offline::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_card_present_receipt/mod.rs b/generated/stripe_payment/src/payment_method_details_card_present_receipt/mod.rs new file mode 100644 index 000000000..3df4e6a0f --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_card_present_receipt/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_card_present_receipt::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_card_wallet/mod.rs b/generated/stripe_payment/src/payment_method_details_card_wallet/mod.rs new file mode 100644 index 000000000..5bf402673 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_card_wallet/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_card_wallet::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_card_wallet_amex_express_checkout/mod.rs b/generated/stripe_payment/src/payment_method_details_card_wallet_amex_express_checkout/mod.rs new file mode 100644 index 000000000..7c72003cf --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_card_wallet_amex_express_checkout/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_card_wallet_amex_express_checkout::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_card_wallet_apple_pay/mod.rs b/generated/stripe_payment/src/payment_method_details_card_wallet_apple_pay/mod.rs new file mode 100644 index 000000000..771ae1731 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_card_wallet_apple_pay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_card_wallet_apple_pay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_card_wallet_google_pay/mod.rs b/generated/stripe_payment/src/payment_method_details_card_wallet_google_pay/mod.rs new file mode 100644 index 000000000..2cf905dfb --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_card_wallet_google_pay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_card_wallet_google_pay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_card_wallet_link/mod.rs b/generated/stripe_payment/src/payment_method_details_card_wallet_link/mod.rs new file mode 100644 index 000000000..cb57435c8 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_card_wallet_link/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_card_wallet_link::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_card_wallet_masterpass/mod.rs b/generated/stripe_payment/src/payment_method_details_card_wallet_masterpass/mod.rs new file mode 100644 index 000000000..1a387b16d --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_card_wallet_masterpass/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_card_wallet_masterpass::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_card_wallet_samsung_pay/mod.rs b/generated/stripe_payment/src/payment_method_details_card_wallet_samsung_pay/mod.rs new file mode 100644 index 000000000..53343e1dc --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_card_wallet_samsung_pay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_card_wallet_samsung_pay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_card_wallet_visa_checkout/mod.rs b/generated/stripe_payment/src/payment_method_details_card_wallet_visa_checkout/mod.rs new file mode 100644 index 000000000..84d1f655f --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_card_wallet_visa_checkout/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_card_wallet_visa_checkout::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_cashapp/mod.rs b/generated/stripe_payment/src/payment_method_details_cashapp/mod.rs new file mode 100644 index 000000000..dde4abb62 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_cashapp/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_cashapp::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_customer_balance/mod.rs b/generated/stripe_payment/src/payment_method_details_customer_balance/mod.rs new file mode 100644 index 000000000..8a4209869 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_customer_balance/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_customer_balance::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_eps/mod.rs b/generated/stripe_payment/src/payment_method_details_eps/mod.rs new file mode 100644 index 000000000..bd1dcc53f --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_eps/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_eps::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_fpx/mod.rs b/generated/stripe_payment/src/payment_method_details_fpx/mod.rs new file mode 100644 index 000000000..fd54b0726 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_fpx/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_fpx::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_giropay/mod.rs b/generated/stripe_payment/src/payment_method_details_giropay/mod.rs new file mode 100644 index 000000000..895e38ca4 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_giropay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_giropay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_grabpay/mod.rs b/generated/stripe_payment/src/payment_method_details_grabpay/mod.rs new file mode 100644 index 000000000..74394e4c2 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_grabpay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_grabpay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_ideal/mod.rs b/generated/stripe_payment/src/payment_method_details_ideal/mod.rs new file mode 100644 index 000000000..99977e59e --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_ideal/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_ideal::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_interac_present/mod.rs b/generated/stripe_payment/src/payment_method_details_interac_present/mod.rs new file mode 100644 index 000000000..50ff98766 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_interac_present/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_interac_present::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_interac_present_receipt/mod.rs b/generated/stripe_payment/src/payment_method_details_interac_present_receipt/mod.rs new file mode 100644 index 000000000..03d92b199 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_interac_present_receipt/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_interac_present_receipt::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_klarna/mod.rs b/generated/stripe_payment/src/payment_method_details_klarna/mod.rs new file mode 100644 index 000000000..25df048e8 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_klarna/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_klarna::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_konbini/mod.rs b/generated/stripe_payment/src/payment_method_details_konbini/mod.rs new file mode 100644 index 000000000..510de37d3 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_konbini/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_konbini::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_konbini_store/mod.rs b/generated/stripe_payment/src/payment_method_details_konbini_store/mod.rs new file mode 100644 index 000000000..ba458fcd0 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_konbini_store/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_konbini_store::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_link/mod.rs b/generated/stripe_payment/src/payment_method_details_link/mod.rs new file mode 100644 index 000000000..522da62c3 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_link/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_link::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_multibanco/mod.rs b/generated/stripe_payment/src/payment_method_details_multibanco/mod.rs new file mode 100644 index 000000000..8e38032f4 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_multibanco/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_multibanco::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_oxxo/mod.rs b/generated/stripe_payment/src/payment_method_details_oxxo/mod.rs new file mode 100644 index 000000000..10c51289e --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_oxxo/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_oxxo::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_p24/mod.rs b/generated/stripe_payment/src/payment_method_details_p24/mod.rs new file mode 100644 index 000000000..cfd45de98 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_p24/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_p24::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_paynow/mod.rs b/generated/stripe_payment/src/payment_method_details_paynow/mod.rs new file mode 100644 index 000000000..57ddd0585 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_paynow/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_paynow::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_paypal/mod.rs b/generated/stripe_payment/src/payment_method_details_paypal/mod.rs new file mode 100644 index 000000000..7025d1bcb --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_paypal/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_paypal::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_pix/mod.rs b/generated/stripe_payment/src/payment_method_details_pix/mod.rs new file mode 100644 index 000000000..fac2c2217 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_pix/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_pix::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_promptpay/mod.rs b/generated/stripe_payment/src/payment_method_details_promptpay/mod.rs new file mode 100644 index 000000000..ba771d11c --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_promptpay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_promptpay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_revolut_pay/mod.rs b/generated/stripe_payment/src/payment_method_details_revolut_pay/mod.rs new file mode 100644 index 000000000..199945e26 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_revolut_pay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_revolut_pay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_sepa_credit_transfer/mod.rs b/generated/stripe_payment/src/payment_method_details_sepa_credit_transfer/mod.rs new file mode 100644 index 000000000..61bbca24d --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_sepa_credit_transfer/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_sepa_credit_transfer::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_sepa_debit/mod.rs b/generated/stripe_payment/src/payment_method_details_sepa_debit/mod.rs new file mode 100644 index 000000000..e4d83d5c1 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_sepa_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_sepa_debit::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_sofort/mod.rs b/generated/stripe_payment/src/payment_method_details_sofort/mod.rs new file mode 100644 index 000000000..05c1a1f11 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_sofort/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_sofort::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_stripe_account/mod.rs b/generated/stripe_payment/src/payment_method_details_stripe_account/mod.rs new file mode 100644 index 000000000..09655af88 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_stripe_account/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_stripe_account::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_us_bank_account/mod.rs b/generated/stripe_payment/src/payment_method_details_us_bank_account/mod.rs new file mode 100644 index 000000000..683d9c6a5 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_us_bank_account/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_us_bank_account::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_wechat/mod.rs b/generated/stripe_payment/src/payment_method_details_wechat/mod.rs new file mode 100644 index 000000000..598830ea2 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_wechat/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_wechat::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_wechat_pay/mod.rs b/generated/stripe_payment/src/payment_method_details_wechat_pay/mod.rs new file mode 100644 index 000000000..e76d01c1d --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_wechat_pay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_wechat_pay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_details_zip/mod.rs b/generated/stripe_payment/src/payment_method_details_zip/mod.rs new file mode 100644 index 000000000..512f1ee47 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_details_zip/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_details_zip::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_domain_resource_payment_method_domain/mod.rs b/generated/stripe_payment/src/payment_method_domain_resource_payment_method_domain/mod.rs new file mode 100644 index 000000000..cc1d7533a --- /dev/null +++ b/generated/stripe_payment/src/payment_method_domain_resource_payment_method_domain/mod.rs @@ -0,0 +1,40 @@ +/// A payment method domain represents a web domain that you have registered with Stripe. +/// Stripe Elements use registered payment method domains to control where certain payment methods are shown. +/// +/// Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDomainResourcePaymentMethodDomain { + pub apple_pay: stripe_payment::PaymentMethodDomainResourcePaymentMethodStatus, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The domain name that this payment method domain object represents. + pub domain_name: String, + /// Whether this payment method domain is enabled. + /// + /// If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. + pub enabled: bool, + pub google_pay: stripe_payment::PaymentMethodDomainResourcePaymentMethodStatus, + /// Unique identifier for the object. + pub id: + stripe_payment::payment_method_domain_resource_payment_method_domain::PaymentMethodDomainId, + pub link: stripe_payment::PaymentMethodDomainResourcePaymentMethodStatus, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + pub paypal: stripe_payment::PaymentMethodDomainResourcePaymentMethodStatus, +} +impl stripe_types::Object for PaymentMethodDomainResourcePaymentMethodDomain { + type Id = + stripe_payment::payment_method_domain_resource_payment_method_domain::PaymentMethodDomainId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(PaymentMethodDomainId); +#[cfg(feature = "payment_method_domain_resource_payment_method_domain")] +mod requests; +#[cfg(feature = "payment_method_domain_resource_payment_method_domain")] +pub use requests::*; diff --git a/generated/stripe_payment/src/payment_method_domain_resource_payment_method_domain/requests.rs b/generated/stripe_payment/src/payment_method_domain_resource_payment_method_domain/requests.rs new file mode 100644 index 000000000..9a3a2ec4a --- /dev/null +++ b/generated/stripe_payment/src/payment_method_domain_resource_payment_method_domain/requests.rs @@ -0,0 +1,158 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePaymentMethodDomainResourcePaymentMethodDomain<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePaymentMethodDomainResourcePaymentMethodDomain<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePaymentMethodDomainResourcePaymentMethodDomain<'a> { + /// Retrieves the details of an existing payment method domain. + pub fn send( + &self, + client: &stripe::Client, + payment_method_domain:&stripe_payment::payment_method_domain_resource_payment_method_domain::PaymentMethodDomainId, + ) -> stripe::Response { + client.get_query(&format!("/payment_method_domains/{payment_method_domain}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPaymentMethodDomainResourcePaymentMethodDomain<'a> { + /// The domain name that this payment method domain object represents. + #[serde(skip_serializing_if = "Option::is_none")] + pub domain_name: Option<&'a str>, + /// Whether this payment method domain is enabled. + /// + /// If the domain is not enabled, payment methods will not appear in Elements. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListPaymentMethodDomainResourcePaymentMethodDomain<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPaymentMethodDomainResourcePaymentMethodDomain<'a> { + /// Lists the details of existing payment method domains. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response< + stripe_types::List, + > { + client.get_query("/payment_method_domains", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/payment_method_domains", self) + } +} +impl<'a> stripe::PaginationParams for ListPaymentMethodDomainResourcePaymentMethodDomain<'a> {} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodDomainResourcePaymentMethodDomain<'a> { + /// The domain name that this payment method domain object represents. + pub domain_name: &'a str, + /// Whether this payment method domain is enabled. + /// + /// If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CreatePaymentMethodDomainResourcePaymentMethodDomain<'a> { + pub fn new(domain_name: &'a str) -> Self { + Self { domain_name, enabled: Default::default(), expand: Default::default() } + } +} +impl<'a> CreatePaymentMethodDomainResourcePaymentMethodDomain<'a> { + /// Creates a payment method domain. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/payment_method_domains", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodDomainResourcePaymentMethodDomain<'a> { + /// Whether this payment method domain is enabled. + /// + /// If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> UpdatePaymentMethodDomainResourcePaymentMethodDomain<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdatePaymentMethodDomainResourcePaymentMethodDomain<'a> { + /// Updates an existing payment method domain. + pub fn send( + &self, + client: &stripe::Client, + payment_method_domain:&stripe_payment::payment_method_domain_resource_payment_method_domain::PaymentMethodDomainId, + ) -> stripe::Response { + client.send_form( + &format!("/payment_method_domains/{payment_method_domain}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ValidatePaymentMethodDomainResourcePaymentMethodDomain<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ValidatePaymentMethodDomainResourcePaymentMethodDomain<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ValidatePaymentMethodDomainResourcePaymentMethodDomain<'a> { + /// Some payment methods such as Apple Pay require additional steps to verify a domain. + /// + /// If the requirements weren’t satisfied when the domain was created, the payment method will be inactive on the domain. The payment method doesn’t appear in Elements for this domain until it is active. To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). + pub fn send( + &self, + client: &stripe::Client, + payment_method_domain:&stripe_payment::payment_method_domain_resource_payment_method_domain::PaymentMethodDomainId, + ) -> stripe::Response { + client.send_form( + &format!("/payment_method_domains/{payment_method_domain}/validate"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_payment/src/payment_method_domain_resource_payment_method_status/mod.rs b/generated/stripe_payment/src/payment_method_domain_resource_payment_method_status/mod.rs new file mode 100644 index 000000000..3610cdd88 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_domain_resource_payment_method_status/mod.rs @@ -0,0 +1,71 @@ +/// Indicates the status of a specific payment method on a payment method domain. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDomainResourcePaymentMethodStatus { + /// The status of the payment method on the domain. + pub status: PaymentMethodDomainResourcePaymentMethodStatusStatus, + #[serde(skip_serializing_if = "Option::is_none")] + pub status_details: + Option, +} +/// The status of the payment method on the domain. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDomainResourcePaymentMethodStatusStatus { + Active, + Inactive, +} +impl PaymentMethodDomainResourcePaymentMethodStatusStatus { + pub fn as_str(self) -> &'static str { + use PaymentMethodDomainResourcePaymentMethodStatusStatus::*; + match self { + Active => "active", + Inactive => "inactive", + } + } +} + +impl std::str::FromStr for PaymentMethodDomainResourcePaymentMethodStatusStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDomainResourcePaymentMethodStatusStatus::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDomainResourcePaymentMethodStatusStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDomainResourcePaymentMethodStatusStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDomainResourcePaymentMethodStatusStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDomainResourcePaymentMethodStatusStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDomainResourcePaymentMethodStatusStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDomainResourcePaymentMethodStatusStatus", + ) + }) + } +} diff --git a/generated/stripe_payment/src/payment_method_domain_resource_payment_method_status_details/mod.rs b/generated/stripe_payment/src/payment_method_domain_resource_payment_method_status_details/mod.rs new file mode 100644 index 000000000..07dcdc569 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_domain_resource_payment_method_status_details/mod.rs @@ -0,0 +1,6 @@ +/// Contains additional details about the status of a payment method for a specific payment method domain. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDomainResourcePaymentMethodStatusDetails { + /// The error message associated with the status of the payment method on the domain. + pub error_message: String, +} diff --git a/generated/stripe_payment/src/payment_method_eps/mod.rs b/generated/stripe_payment/src/payment_method_eps/mod.rs new file mode 100644 index 000000000..dc29e07b7 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_eps/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_eps::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_fpx/mod.rs b/generated/stripe_payment/src/payment_method_fpx/mod.rs new file mode 100644 index 000000000..3a690ed95 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_fpx/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_fpx::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_giropay/mod.rs b/generated/stripe_payment/src/payment_method_giropay/mod.rs new file mode 100644 index 000000000..f220c28e7 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_giropay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_giropay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_grabpay/mod.rs b/generated/stripe_payment/src/payment_method_grabpay/mod.rs new file mode 100644 index 000000000..b79ad1476 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_grabpay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_grabpay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_ideal/mod.rs b/generated/stripe_payment/src/payment_method_ideal/mod.rs new file mode 100644 index 000000000..c12aea5c5 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_ideal/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_ideal::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_interac_present/mod.rs b/generated/stripe_payment/src/payment_method_interac_present/mod.rs new file mode 100644 index 000000000..d768da42e --- /dev/null +++ b/generated/stripe_payment/src/payment_method_interac_present/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_interac_present::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_klarna/mod.rs b/generated/stripe_payment/src/payment_method_klarna/mod.rs new file mode 100644 index 000000000..bb636e088 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_klarna/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_klarna::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_konbini/mod.rs b/generated/stripe_payment/src/payment_method_konbini/mod.rs new file mode 100644 index 000000000..ca98f96ae --- /dev/null +++ b/generated/stripe_payment/src/payment_method_konbini/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_konbini::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_link/mod.rs b/generated/stripe_payment/src/payment_method_link/mod.rs new file mode 100644 index 000000000..d517d46b0 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_link/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_link::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_affirm/mod.rs b/generated/stripe_payment/src/payment_method_options_affirm/mod.rs new file mode 100644 index 000000000..d71be792f --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_affirm/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_affirm::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_afterpay_clearpay/mod.rs b/generated/stripe_payment/src/payment_method_options_afterpay_clearpay/mod.rs new file mode 100644 index 000000000..7a7ca938c --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_afterpay_clearpay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_afterpay_clearpay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_alipay/mod.rs b/generated/stripe_payment/src/payment_method_options_alipay/mod.rs new file mode 100644 index 000000000..8234ff916 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_alipay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_alipay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_bacs_debit/mod.rs b/generated/stripe_payment/src/payment_method_options_bacs_debit/mod.rs new file mode 100644 index 000000000..e70bd6818 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_bacs_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_bacs_debit::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_bancontact/mod.rs b/generated/stripe_payment/src/payment_method_options_bancontact/mod.rs new file mode 100644 index 000000000..f96b24549 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_bancontact/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_bancontact::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_boleto/mod.rs b/generated/stripe_payment/src/payment_method_options_boleto/mod.rs new file mode 100644 index 000000000..9e1a6fa35 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_boleto/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_boleto::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_card_installments/mod.rs b/generated/stripe_payment/src/payment_method_options_card_installments/mod.rs new file mode 100644 index 000000000..07a493a14 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_card_installments/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_card_installments::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_card_mandate_options/mod.rs b/generated/stripe_payment/src/payment_method_options_card_mandate_options/mod.rs new file mode 100644 index 000000000..f298979d6 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_card_mandate_options/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_card_mandate_options::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_card_present/mod.rs b/generated/stripe_payment/src/payment_method_options_card_present/mod.rs new file mode 100644 index 000000000..d0de7838f --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_card_present/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_card_present::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_cashapp/mod.rs b/generated/stripe_payment/src/payment_method_options_cashapp/mod.rs new file mode 100644 index 000000000..0c6bf2600 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_cashapp/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_cashapp::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_customer_balance/mod.rs b/generated/stripe_payment/src/payment_method_options_customer_balance/mod.rs new file mode 100644 index 000000000..9d41362cb --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_customer_balance/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_customer_balance::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_customer_balance_bank_transfer/mod.rs b/generated/stripe_payment/src/payment_method_options_customer_balance_bank_transfer/mod.rs new file mode 100644 index 000000000..02aeb99b6 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_customer_balance_bank_transfer/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_customer_balance_bank_transfer::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_customer_balance_eu_bank_account/mod.rs b/generated/stripe_payment/src/payment_method_options_customer_balance_eu_bank_account/mod.rs new file mode 100644 index 000000000..b2adbcd41 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_customer_balance_eu_bank_account/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_customer_balance_eu_bank_account::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_fpx/mod.rs b/generated/stripe_payment/src/payment_method_options_fpx/mod.rs new file mode 100644 index 000000000..7ef9b6265 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_fpx/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_fpx::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_giropay/mod.rs b/generated/stripe_payment/src/payment_method_options_giropay/mod.rs new file mode 100644 index 000000000..386482af8 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_giropay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_giropay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_grabpay/mod.rs b/generated/stripe_payment/src/payment_method_options_grabpay/mod.rs new file mode 100644 index 000000000..7e681d10c --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_grabpay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_grabpay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_ideal/mod.rs b/generated/stripe_payment/src/payment_method_options_ideal/mod.rs new file mode 100644 index 000000000..8333f53b9 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_ideal/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_ideal::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_interac_present/mod.rs b/generated/stripe_payment/src/payment_method_options_interac_present/mod.rs new file mode 100644 index 000000000..9a3d5a6f6 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_interac_present/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_interac_present::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_klarna/mod.rs b/generated/stripe_payment/src/payment_method_options_klarna/mod.rs new file mode 100644 index 000000000..ae0a4681d --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_klarna/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_klarna::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_konbini/mod.rs b/generated/stripe_payment/src/payment_method_options_konbini/mod.rs new file mode 100644 index 000000000..97112bb5b --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_konbini/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_konbini::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_oxxo/mod.rs b/generated/stripe_payment/src/payment_method_options_oxxo/mod.rs new file mode 100644 index 000000000..b85fa78e2 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_oxxo/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_oxxo::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_p24/mod.rs b/generated/stripe_payment/src/payment_method_options_p24/mod.rs new file mode 100644 index 000000000..454cae852 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_p24/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_p24::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_paynow/mod.rs b/generated/stripe_payment/src/payment_method_options_paynow/mod.rs new file mode 100644 index 000000000..fe6992410 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_paynow/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_paynow::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_paypal/mod.rs b/generated/stripe_payment/src/payment_method_options_paypal/mod.rs new file mode 100644 index 000000000..aa9167f06 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_paypal/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_paypal::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_pix/mod.rs b/generated/stripe_payment/src/payment_method_options_pix/mod.rs new file mode 100644 index 000000000..e1dad456e --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_pix/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_pix::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_promptpay/mod.rs b/generated/stripe_payment/src/payment_method_options_promptpay/mod.rs new file mode 100644 index 000000000..17d5e5f1e --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_promptpay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_promptpay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_revolut_pay/mod.rs b/generated/stripe_payment/src/payment_method_options_revolut_pay/mod.rs new file mode 100644 index 000000000..eb49fa571 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_revolut_pay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_revolut_pay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_sofort/mod.rs b/generated/stripe_payment/src/payment_method_options_sofort/mod.rs new file mode 100644 index 000000000..db9927383 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_sofort/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_sofort::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_wechat_pay/mod.rs b/generated/stripe_payment/src/payment_method_options_wechat_pay/mod.rs new file mode 100644 index 000000000..ba2d19948 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_wechat_pay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_wechat_pay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_options_zip/mod.rs b/generated/stripe_payment/src/payment_method_options_zip/mod.rs new file mode 100644 index 000000000..07b940bc3 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_options_zip/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_options_zip::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_oxxo/mod.rs b/generated/stripe_payment/src/payment_method_oxxo/mod.rs new file mode 100644 index 000000000..a6cd6d7fa --- /dev/null +++ b/generated/stripe_payment/src/payment_method_oxxo/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_oxxo::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_p24/mod.rs b/generated/stripe_payment/src/payment_method_p24/mod.rs new file mode 100644 index 000000000..3eb75514a --- /dev/null +++ b/generated/stripe_payment/src/payment_method_p24/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_p24::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_paynow/mod.rs b/generated/stripe_payment/src/payment_method_paynow/mod.rs new file mode 100644 index 000000000..04a0a2fba --- /dev/null +++ b/generated/stripe_payment/src/payment_method_paynow/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_paynow::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_paypal/mod.rs b/generated/stripe_payment/src/payment_method_paypal/mod.rs new file mode 100644 index 000000000..c379a04a1 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_paypal/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_paypal::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_pix/mod.rs b/generated/stripe_payment/src/payment_method_pix/mod.rs new file mode 100644 index 000000000..f97b42b2d --- /dev/null +++ b/generated/stripe_payment/src/payment_method_pix/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_pix::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_promptpay/mod.rs b/generated/stripe_payment/src/payment_method_promptpay/mod.rs new file mode 100644 index 000000000..a7b73dcb0 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_promptpay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_promptpay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_revolut_pay/mod.rs b/generated/stripe_payment/src/payment_method_revolut_pay/mod.rs new file mode 100644 index 000000000..4b67d87cc --- /dev/null +++ b/generated/stripe_payment/src/payment_method_revolut_pay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_revolut_pay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_sepa_debit/mod.rs b/generated/stripe_payment/src/payment_method_sepa_debit/mod.rs new file mode 100644 index 000000000..6fac0aaa2 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_sepa_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_sepa_debit::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_sofort/mod.rs b/generated/stripe_payment/src/payment_method_sofort/mod.rs new file mode 100644 index 000000000..5e2c6f501 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_sofort/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_sofort::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_us_bank_account/mod.rs b/generated/stripe_payment/src/payment_method_us_bank_account/mod.rs new file mode 100644 index 000000000..a4eb4296a --- /dev/null +++ b/generated/stripe_payment/src/payment_method_us_bank_account/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_us_bank_account::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_us_bank_account_blocked/mod.rs b/generated/stripe_payment/src/payment_method_us_bank_account_blocked/mod.rs new file mode 100644 index 000000000..affed0d2b --- /dev/null +++ b/generated/stripe_payment/src/payment_method_us_bank_account_blocked/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_us_bank_account_blocked::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_us_bank_account_status_details/mod.rs b/generated/stripe_payment/src/payment_method_us_bank_account_status_details/mod.rs new file mode 100644 index 000000000..5443b13d7 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_us_bank_account_status_details/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_us_bank_account_status_details::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_wechat_pay/mod.rs b/generated/stripe_payment/src/payment_method_wechat_pay/mod.rs new file mode 100644 index 000000000..ee97b247f --- /dev/null +++ b/generated/stripe_payment/src/payment_method_wechat_pay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_wechat_pay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/payment_method_zip/mod.rs b/generated/stripe_payment/src/payment_method_zip/mod.rs new file mode 100644 index 000000000..40be636b2 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_zip/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::payment_method_zip::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/paypal_seller_protection/mod.rs b/generated/stripe_payment/src/paypal_seller_protection/mod.rs new file mode 100644 index 000000000..aba6eba52 --- /dev/null +++ b/generated/stripe_payment/src/paypal_seller_protection/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::paypal_seller_protection::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/sepa_debit_generated_from/mod.rs b/generated/stripe_payment/src/sepa_debit_generated_from/mod.rs new file mode 100644 index 000000000..d72f4fb63 --- /dev/null +++ b/generated/stripe_payment/src/sepa_debit_generated_from/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::sepa_debit_generated_from::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source/mod.rs b/generated/stripe_payment/src/source/mod.rs new file mode 100644 index 000000000..6923b3f06 --- /dev/null +++ b/generated/stripe_payment/src/source/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::source::*; +#[cfg(feature = "source")] +mod requests; +#[cfg(feature = "source")] +pub use requests::*; diff --git a/generated/stripe_payment/src/source/requests.rs b/generated/stripe_payment/src/source/requests.rs new file mode 100644 index 000000000..b56e0e192 --- /dev/null +++ b/generated/stripe_payment/src/source/requests.rs @@ -0,0 +1,1569 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DetachSource<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> DetachSource<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> DetachSource<'a> { + /// Delete a specified source for a given customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_types::customer::CustomerId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/sources/{id}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(untagged)] +pub enum DetachReturned { + PaymentSource(stripe_types::PaymentSource), + DeletedPaymentSource(stripe_types::DeletedPaymentSource), +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveSource<'a> { + /// The client secret of the source. + /// + /// Required if a publishable key is used to retrieve the source. + #[serde(skip_serializing_if = "Option::is_none")] + pub client_secret: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveSource<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveSource<'a> { + /// Retrieves an existing source object. + /// + /// Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. + pub fn send( + &self, + client: &stripe::Client, + source: &stripe_types::source::SourceId, + ) -> stripe::Response { + client.get_query(&format!("/sources/{source}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSource<'a> { + /// Amount associated with the source. + /// + /// This is the amount for which the source will be chargeable once ready. + /// Required for `single_use` sources. + /// Not supported for `receiver` type sources, where charge amount may not be specified until funds land. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. + /// + /// This is the currency for which the source will be chargeable once ready. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The `Customer` to whom the original source is attached to. + /// + /// Must be set when the original source is not a `Source` (e.g., `Card`). + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The authentication `flow` of the source to create. + /// + /// `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. + /// It is generally inferred unless a type supports multiple flows. + #[serde(skip_serializing_if = "Option::is_none")] + pub flow: Option, + /// Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The source to share. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_source: Option<&'a str>, + /// Information about the owner of the payment instrument that may be used or required by particular source types. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option>, + /// Optional parameters for the receiver flow. + /// + /// Can be set only if the source is a receiver (`flow` is `receiver`). + #[serde(skip_serializing_if = "Option::is_none")] + pub receiver: Option, + /// Parameters required for the redirect flow. + /// + /// Required if the source is authenticated by a redirect (`flow` is `redirect`). + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect: Option>, + /// Information about the items and shipping associated with the source. + /// + /// Required for transactional credit (for example Klarna) sources before you can charge it. + #[serde(skip_serializing_if = "Option::is_none")] + pub source_order: Option>, + /// An arbitrary string to be displayed on your customer's statement. + /// + /// As an example, if your website is `RunClub` and the item you're charging for is a race ticket, you may want to specify a `statement_descriptor` of `RunClub 5K race ticket.` While many payment types will display this information, some may not display it at all. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// An optional token used to create the source. + /// + /// When passed, token properties will override source parameters. + #[serde(skip_serializing_if = "Option::is_none")] + pub token: Option<&'a str>, + /// The `type` of the source to create. + /// + /// Required unless `customer` and `original_source` are specified (see the [Cloning card Sources](https://stripe.com/docs/sources/connect#cloning-card-sources) guide). + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub usage: Option, +} +impl<'a> CreateSource<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The authentication `flow` of the source to create. +/// +/// `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. +/// It is generally inferred unless a type supports multiple flows. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSourceFlow { + CodeVerification, + None, + Receiver, + Redirect, +} +impl CreateSourceFlow { + pub fn as_str(self) -> &'static str { + use CreateSourceFlow::*; + match self { + CodeVerification => "code_verification", + None => "none", + Receiver => "receiver", + Redirect => "redirect", + } + } +} + +impl std::str::FromStr for CreateSourceFlow { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSourceFlow::*; + match s { + "code_verification" => Ok(CodeVerification), + "none" => Ok(None), + "receiver" => Ok(Receiver), + "redirect" => Ok(Redirect), + _ => Err(()), + } + } +} +impl AsRef for CreateSourceFlow { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSourceFlow { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSourceFlow { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSourceFlow { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSourceMandate<'a> { + /// The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub acceptance: Option>, + /// The amount specified by the mandate. + /// + /// (Leave null for a mandate covering all amounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The currency specified by the mandate. + /// + /// (Must match `currency` of the source). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The interval of debits permitted by the mandate. + /// + /// Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval: Option, + /// The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. + /// + /// Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). + #[serde(skip_serializing_if = "Option::is_none")] + pub notification_method: Option, +} +impl<'a> CreateSourceMandate<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSourceMandateAcceptance<'a> { + /// The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The parameters required to store a mandate accepted offline. + /// + /// Should only be set if `mandate[type]` is `offline`. + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option>, + /// The parameters required to store a mandate accepted online. + /// + /// Should only be set if `mandate[type]` is `online`. + #[serde(skip_serializing_if = "Option::is_none")] + pub online: Option>, + /// The status of the mandate acceptance. + /// + /// Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). + pub status: CreateSourceMandateAcceptanceStatus, + /// The type of acceptance information included with the mandate. + /// + /// Either `online` or `offline`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// The user agent of the browser from which the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> CreateSourceMandateAcceptance<'a> { + pub fn new(status: CreateSourceMandateAcceptanceStatus) -> Self { + Self { + date: Default::default(), + ip: Default::default(), + offline: Default::default(), + online: Default::default(), + status, + type_: Default::default(), + user_agent: Default::default(), + } + } +} +/// The parameters required to store a mandate accepted offline. +/// +/// Should only be set if `mandate[type]` is `offline`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSourceMandateAcceptanceOffline<'a> { + /// An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`. + pub contact_email: &'a str, +} +impl<'a> CreateSourceMandateAcceptanceOffline<'a> { + pub fn new(contact_email: &'a str) -> Self { + Self { contact_email } + } +} +/// The parameters required to store a mandate accepted online. +/// +/// Should only be set if `mandate[type]` is `online`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSourceMandateAcceptanceOnline<'a> { + /// The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> CreateSourceMandateAcceptanceOnline<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The status of the mandate acceptance. +/// +/// Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSourceMandateAcceptanceStatus { + Accepted, + Pending, + Refused, + Revoked, +} +impl CreateSourceMandateAcceptanceStatus { + pub fn as_str(self) -> &'static str { + use CreateSourceMandateAcceptanceStatus::*; + match self { + Accepted => "accepted", + Pending => "pending", + Refused => "refused", + Revoked => "revoked", + } + } +} + +impl std::str::FromStr for CreateSourceMandateAcceptanceStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSourceMandateAcceptanceStatus::*; + match s { + "accepted" => Ok(Accepted), + "pending" => Ok(Pending), + "refused" => Ok(Refused), + "revoked" => Ok(Revoked), + _ => Err(()), + } + } +} +impl AsRef for CreateSourceMandateAcceptanceStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSourceMandateAcceptanceStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSourceMandateAcceptanceStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSourceMandateAcceptanceStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of acceptance information included with the mandate. +/// +/// Either `online` or `offline`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSourceMandateAcceptanceType { + Offline, + Online, +} +impl CreateSourceMandateAcceptanceType { + pub fn as_str(self) -> &'static str { + use CreateSourceMandateAcceptanceType::*; + match self { + Offline => "offline", + Online => "online", + } + } +} + +impl std::str::FromStr for CreateSourceMandateAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSourceMandateAcceptanceType::*; + match s { + "offline" => Ok(Offline), + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl AsRef for CreateSourceMandateAcceptanceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSourceMandateAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSourceMandateAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSourceMandateAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The interval of debits permitted by the mandate. +/// +/// Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSourceMandateInterval { + OneTime, + Scheduled, + Variable, +} +impl CreateSourceMandateInterval { + pub fn as_str(self) -> &'static str { + use CreateSourceMandateInterval::*; + match self { + OneTime => "one_time", + Scheduled => "scheduled", + Variable => "variable", + } + } +} + +impl std::str::FromStr for CreateSourceMandateInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSourceMandateInterval::*; + match s { + "one_time" => Ok(OneTime), + "scheduled" => Ok(Scheduled), + "variable" => Ok(Variable), + _ => Err(()), + } + } +} +impl AsRef for CreateSourceMandateInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSourceMandateInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSourceMandateInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSourceMandateInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. +/// +/// Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSourceMandateNotificationMethod { + DeprecatedNone, + Email, + Manual, + None, + StripeEmail, +} +impl CreateSourceMandateNotificationMethod { + pub fn as_str(self) -> &'static str { + use CreateSourceMandateNotificationMethod::*; + match self { + DeprecatedNone => "deprecated_none", + Email => "email", + Manual => "manual", + None => "none", + StripeEmail => "stripe_email", + } + } +} + +impl std::str::FromStr for CreateSourceMandateNotificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSourceMandateNotificationMethod::*; + match s { + "deprecated_none" => Ok(DeprecatedNone), + "email" => Ok(Email), + "manual" => Ok(Manual), + "none" => Ok(None), + "stripe_email" => Ok(StripeEmail), + _ => Err(()), + } + } +} +impl AsRef for CreateSourceMandateNotificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSourceMandateNotificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSourceMandateNotificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSourceMandateNotificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about the owner of the payment instrument that may be used or required by particular source types. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSourceOwner<'a> { + /// Owner's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Owner's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Owner's full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Owner's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> CreateSourceOwner<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Owner's address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSourceOwnerAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateSourceOwnerAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Optional parameters for the receiver flow. +/// +/// Can be set only if the source is a receiver (`flow` is `receiver`). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSourceReceiver { + /// The method Stripe should use to request information needed to process a refund or mispayment. + /// + /// Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). + /// Refer to each payment method's documentation to learn which refund attributes may be required. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_attributes_method: Option, +} +impl CreateSourceReceiver { + pub fn new() -> Self { + Self::default() + } +} +/// The method Stripe should use to request information needed to process a refund or mispayment. +/// +/// Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). +/// Refer to each payment method's documentation to learn which refund attributes may be required. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSourceReceiverRefundAttributesMethod { + Email, + Manual, + None, +} +impl CreateSourceReceiverRefundAttributesMethod { + pub fn as_str(self) -> &'static str { + use CreateSourceReceiverRefundAttributesMethod::*; + match self { + Email => "email", + Manual => "manual", + None => "none", + } + } +} + +impl std::str::FromStr for CreateSourceReceiverRefundAttributesMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSourceReceiverRefundAttributesMethod::*; + match s { + "email" => Ok(Email), + "manual" => Ok(Manual), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for CreateSourceReceiverRefundAttributesMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSourceReceiverRefundAttributesMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSourceReceiverRefundAttributesMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSourceReceiverRefundAttributesMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Parameters required for the redirect flow. +/// +/// Required if the source is authenticated by a redirect (`flow` is `redirect`). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSourceRedirect<'a> { + /// The URL you provide to redirect the customer back to you after they authenticated their payment. + /// + /// It can use your application URI scheme in the context of a mobile application. + pub return_url: &'a str, +} +impl<'a> CreateSourceRedirect<'a> { + pub fn new(return_url: &'a str) -> Self { + Self { return_url } + } +} +/// Information about the items and shipping associated with the source. +/// +/// Required for transactional credit (for example Klarna) sources before you can charge it. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSourceSourceOrder<'a> { + /// List of items constituting the order. + #[serde(skip_serializing_if = "Option::is_none")] + pub items: Option<&'a [CreateSourceSourceOrderItems<'a>]>, + /// Shipping address for the order. + /// + /// Required if any of the SKUs are for products that have `shippable` set to true. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, +} +impl<'a> CreateSourceSourceOrder<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// List of items constituting the order. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSourceSourceOrderItems<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The ID of the SKU being ordered. + #[serde(skip_serializing_if = "Option::is_none")] + pub parent: Option<&'a str>, + /// The quantity of this order item. + /// + /// When type is `sku`, this is the number of instances of the SKU to be ordered. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> CreateSourceSourceOrderItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSourceSourceOrderItemsType { + Discount, + Shipping, + Sku, + Tax, +} +impl CreateSourceSourceOrderItemsType { + pub fn as_str(self) -> &'static str { + use CreateSourceSourceOrderItemsType::*; + match self { + Discount => "discount", + Shipping => "shipping", + Sku => "sku", + Tax => "tax", + } + } +} + +impl std::str::FromStr for CreateSourceSourceOrderItemsType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSourceSourceOrderItemsType::*; + match s { + "discount" => Ok(Discount), + "shipping" => Ok(Shipping), + "sku" => Ok(Sku), + "tax" => Ok(Tax), + _ => Err(()), + } + } +} +impl AsRef for CreateSourceSourceOrderItemsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSourceSourceOrderItemsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSourceSourceOrderItemsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSourceSourceOrderItemsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Shipping address for the order. +/// +/// Required if any of the SKUs are for products that have `shippable` set to true. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSourceSourceOrderShipping<'a> { + /// Shipping address. + pub address: CreateSourceSourceOrderShippingAddress<'a>, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// Recipient name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Recipient phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The tracking number for a physical product, obtained from the delivery service. + /// + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub tracking_number: Option<&'a str>, +} +impl<'a> CreateSourceSourceOrderShipping<'a> { + pub fn new(address: CreateSourceSourceOrderShippingAddress<'a>) -> Self { + Self { + address, + carrier: Default::default(), + name: Default::default(), + phone: Default::default(), + tracking_number: Default::default(), + } + } +} +/// Shipping address. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSourceSourceOrderShippingAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + pub line1: &'a str, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateSourceSourceOrderShippingAddress<'a> { + pub fn new(line1: &'a str) -> Self { + Self { + city: Default::default(), + country: Default::default(), + line1, + line2: Default::default(), + postal_code: Default::default(), + state: Default::default(), + } + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSourceUsage { + Reusable, + SingleUse, +} +impl CreateSourceUsage { + pub fn as_str(self) -> &'static str { + use CreateSourceUsage::*; + match self { + Reusable => "reusable", + SingleUse => "single_use", + } + } +} + +impl std::str::FromStr for CreateSourceUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSourceUsage::*; + match s { + "reusable" => Ok(Reusable), + "single_use" => Ok(SingleUse), + _ => Err(()), + } + } +} +impl AsRef for CreateSourceUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateSourceUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSourceUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSourceUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateSource<'a> { + /// Creates a new source object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/sources", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSource<'a> { + /// Amount associated with the source. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Information about the owner of the payment instrument that may be used or required by particular source types. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option>, + /// Information about the items and shipping associated with the source. + /// + /// Required for transactional credit (for example Klarna) sources before you can charge it. + #[serde(skip_serializing_if = "Option::is_none")] + pub source_order: Option>, +} +impl<'a> UpdateSource<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSourceMandate<'a> { + /// The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub acceptance: Option>, + /// The amount specified by the mandate. + /// + /// (Leave null for a mandate covering all amounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The currency specified by the mandate. + /// + /// (Must match `currency` of the source). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The interval of debits permitted by the mandate. + /// + /// Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval: Option, + /// The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. + /// + /// Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). + #[serde(skip_serializing_if = "Option::is_none")] + pub notification_method: Option, +} +impl<'a> UpdateSourceMandate<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSourceMandateAcceptance<'a> { + /// The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The parameters required to store a mandate accepted offline. + /// + /// Should only be set if `mandate[type]` is `offline`. + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option>, + /// The parameters required to store a mandate accepted online. + /// + /// Should only be set if `mandate[type]` is `online`. + #[serde(skip_serializing_if = "Option::is_none")] + pub online: Option>, + /// The status of the mandate acceptance. + /// + /// Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). + pub status: UpdateSourceMandateAcceptanceStatus, + /// The type of acceptance information included with the mandate. + /// + /// Either `online` or `offline`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// The user agent of the browser from which the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> UpdateSourceMandateAcceptance<'a> { + pub fn new(status: UpdateSourceMandateAcceptanceStatus) -> Self { + Self { + date: Default::default(), + ip: Default::default(), + offline: Default::default(), + online: Default::default(), + status, + type_: Default::default(), + user_agent: Default::default(), + } + } +} +/// The parameters required to store a mandate accepted offline. +/// +/// Should only be set if `mandate[type]` is `offline`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSourceMandateAcceptanceOffline<'a> { + /// An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`. + pub contact_email: &'a str, +} +impl<'a> UpdateSourceMandateAcceptanceOffline<'a> { + pub fn new(contact_email: &'a str) -> Self { + Self { contact_email } + } +} +/// The parameters required to store a mandate accepted online. +/// +/// Should only be set if `mandate[type]` is `online`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSourceMandateAcceptanceOnline<'a> { + /// The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> UpdateSourceMandateAcceptanceOnline<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The status of the mandate acceptance. +/// +/// Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSourceMandateAcceptanceStatus { + Accepted, + Pending, + Refused, + Revoked, +} +impl UpdateSourceMandateAcceptanceStatus { + pub fn as_str(self) -> &'static str { + use UpdateSourceMandateAcceptanceStatus::*; + match self { + Accepted => "accepted", + Pending => "pending", + Refused => "refused", + Revoked => "revoked", + } + } +} + +impl std::str::FromStr for UpdateSourceMandateAcceptanceStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSourceMandateAcceptanceStatus::*; + match s { + "accepted" => Ok(Accepted), + "pending" => Ok(Pending), + "refused" => Ok(Refused), + "revoked" => Ok(Revoked), + _ => Err(()), + } + } +} +impl AsRef for UpdateSourceMandateAcceptanceStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSourceMandateAcceptanceStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSourceMandateAcceptanceStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSourceMandateAcceptanceStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of acceptance information included with the mandate. +/// +/// Either `online` or `offline`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSourceMandateAcceptanceType { + Offline, + Online, +} +impl UpdateSourceMandateAcceptanceType { + pub fn as_str(self) -> &'static str { + use UpdateSourceMandateAcceptanceType::*; + match self { + Offline => "offline", + Online => "online", + } + } +} + +impl std::str::FromStr for UpdateSourceMandateAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSourceMandateAcceptanceType::*; + match s { + "offline" => Ok(Offline), + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl AsRef for UpdateSourceMandateAcceptanceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSourceMandateAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSourceMandateAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSourceMandateAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The interval of debits permitted by the mandate. +/// +/// Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSourceMandateInterval { + OneTime, + Scheduled, + Variable, +} +impl UpdateSourceMandateInterval { + pub fn as_str(self) -> &'static str { + use UpdateSourceMandateInterval::*; + match self { + OneTime => "one_time", + Scheduled => "scheduled", + Variable => "variable", + } + } +} + +impl std::str::FromStr for UpdateSourceMandateInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSourceMandateInterval::*; + match s { + "one_time" => Ok(OneTime), + "scheduled" => Ok(Scheduled), + "variable" => Ok(Variable), + _ => Err(()), + } + } +} +impl AsRef for UpdateSourceMandateInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSourceMandateInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSourceMandateInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSourceMandateInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. +/// +/// Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSourceMandateNotificationMethod { + DeprecatedNone, + Email, + Manual, + None, + StripeEmail, +} +impl UpdateSourceMandateNotificationMethod { + pub fn as_str(self) -> &'static str { + use UpdateSourceMandateNotificationMethod::*; + match self { + DeprecatedNone => "deprecated_none", + Email => "email", + Manual => "manual", + None => "none", + StripeEmail => "stripe_email", + } + } +} + +impl std::str::FromStr for UpdateSourceMandateNotificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSourceMandateNotificationMethod::*; + match s { + "deprecated_none" => Ok(DeprecatedNone), + "email" => Ok(Email), + "manual" => Ok(Manual), + "none" => Ok(None), + "stripe_email" => Ok(StripeEmail), + _ => Err(()), + } + } +} +impl AsRef for UpdateSourceMandateNotificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSourceMandateNotificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSourceMandateNotificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSourceMandateNotificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about the owner of the payment instrument that may be used or required by particular source types. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSourceOwner<'a> { + /// Owner's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Owner's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Owner's full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Owner's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> UpdateSourceOwner<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Owner's address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSourceOwnerAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateSourceOwnerAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about the items and shipping associated with the source. +/// +/// Required for transactional credit (for example Klarna) sources before you can charge it. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSourceSourceOrder<'a> { + /// List of items constituting the order. + #[serde(skip_serializing_if = "Option::is_none")] + pub items: Option<&'a [UpdateSourceSourceOrderItems<'a>]>, + /// Shipping address for the order. + /// + /// Required if any of the SKUs are for products that have `shippable` set to true. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, +} +impl<'a> UpdateSourceSourceOrder<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// List of items constituting the order. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSourceSourceOrderItems<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The ID of the SKU being ordered. + #[serde(skip_serializing_if = "Option::is_none")] + pub parent: Option<&'a str>, + /// The quantity of this order item. + /// + /// When type is `sku`, this is the number of instances of the SKU to be ordered. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> UpdateSourceSourceOrderItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSourceSourceOrderItemsType { + Discount, + Shipping, + Sku, + Tax, +} +impl UpdateSourceSourceOrderItemsType { + pub fn as_str(self) -> &'static str { + use UpdateSourceSourceOrderItemsType::*; + match self { + Discount => "discount", + Shipping => "shipping", + Sku => "sku", + Tax => "tax", + } + } +} + +impl std::str::FromStr for UpdateSourceSourceOrderItemsType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSourceSourceOrderItemsType::*; + match s { + "discount" => Ok(Discount), + "shipping" => Ok(Shipping), + "sku" => Ok(Sku), + "tax" => Ok(Tax), + _ => Err(()), + } + } +} +impl AsRef for UpdateSourceSourceOrderItemsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateSourceSourceOrderItemsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSourceSourceOrderItemsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSourceSourceOrderItemsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Shipping address for the order. +/// +/// Required if any of the SKUs are for products that have `shippable` set to true. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSourceSourceOrderShipping<'a> { + /// Shipping address. + pub address: UpdateSourceSourceOrderShippingAddress<'a>, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// Recipient name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Recipient phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The tracking number for a physical product, obtained from the delivery service. + /// + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub tracking_number: Option<&'a str>, +} +impl<'a> UpdateSourceSourceOrderShipping<'a> { + pub fn new(address: UpdateSourceSourceOrderShippingAddress<'a>) -> Self { + Self { + address, + carrier: Default::default(), + name: Default::default(), + phone: Default::default(), + tracking_number: Default::default(), + } + } +} +/// Shipping address. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSourceSourceOrderShippingAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + pub line1: &'a str, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateSourceSourceOrderShippingAddress<'a> { + pub fn new(line1: &'a str) -> Self { + Self { + city: Default::default(), + country: Default::default(), + line1, + line2: Default::default(), + postal_code: Default::default(), + state: Default::default(), + } + } +} +impl<'a> UpdateSource<'a> { + /// Updates the specified source by setting the values of the parameters passed. + /// + /// Any parameters not provided will be left unchanged. This request accepts the `metadata` and `owner` as arguments. + /// It is also possible to update type specific information for selected payment methods. + /// Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. + pub fn send( + &self, + client: &stripe::Client, + source: &stripe_types::source::SourceId, + ) -> stripe::Response { + client.send_form(&format!("/sources/{source}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct VerifySource<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The values needed to verify the source. + pub values: &'a [&'a str], +} +impl<'a> VerifySource<'a> { + pub fn new(values: &'a [&'a str]) -> Self { + Self { expand: Default::default(), values } + } +} +impl<'a> VerifySource<'a> { + /// Verify a given source. + pub fn send( + &self, + client: &stripe::Client, + source: &stripe_types::source::SourceId, + ) -> stripe::Response { + client.send_form(&format!("/sources/{source}/verify"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct SourceTransactionsSource<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> SourceTransactionsSource<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> SourceTransactionsSource<'a> { + /// List source transactions for a given source. + pub fn send( + &self, + client: &stripe::Client, + source: &stripe_types::source::SourceId, + ) -> stripe::Response> { + client.get_query(&format!("/sources/{source}/source_transactions"), self) + } + pub fn paginate( + self, + source: &stripe_types::source::SourceId, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params(&format!("/sources/{source}/source_transactions"), self) + } +} +impl<'a> stripe::PaginationParams for SourceTransactionsSource<'a> {} diff --git a/generated/stripe_payment/src/source_code_verification_flow/mod.rs b/generated/stripe_payment/src/source_code_verification_flow/mod.rs new file mode 100644 index 000000000..bc8d7707b --- /dev/null +++ b/generated/stripe_payment/src/source_code_verification_flow/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_code_verification_flow::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_order/mod.rs b/generated/stripe_payment/src/source_order/mod.rs new file mode 100644 index 000000000..b8e8384ad --- /dev/null +++ b/generated/stripe_payment/src/source_order/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_order::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_order_item/mod.rs b/generated/stripe_payment/src/source_order_item/mod.rs new file mode 100644 index 000000000..2678d1dd9 --- /dev/null +++ b/generated/stripe_payment/src/source_order_item/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_order_item::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_owner/mod.rs b/generated/stripe_payment/src/source_owner/mod.rs new file mode 100644 index 000000000..ed2dd774d --- /dev/null +++ b/generated/stripe_payment/src/source_owner/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_owner::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_receiver_flow/mod.rs b/generated/stripe_payment/src/source_receiver_flow/mod.rs new file mode 100644 index 000000000..7735ca9df --- /dev/null +++ b/generated/stripe_payment/src/source_receiver_flow/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_receiver_flow::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_redirect_flow/mod.rs b/generated/stripe_payment/src/source_redirect_flow/mod.rs new file mode 100644 index 000000000..2eb707aa5 --- /dev/null +++ b/generated/stripe_payment/src/source_redirect_flow/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_redirect_flow::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_transaction/mod.rs b/generated/stripe_payment/src/source_transaction/mod.rs new file mode 100644 index 000000000..3d080c22c --- /dev/null +++ b/generated/stripe_payment/src/source_transaction/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_transaction::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_transaction_ach_credit_transfer_data/mod.rs b/generated/stripe_payment/src/source_transaction_ach_credit_transfer_data/mod.rs new file mode 100644 index 000000000..a04593b64 --- /dev/null +++ b/generated/stripe_payment/src/source_transaction_ach_credit_transfer_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_transaction_ach_credit_transfer_data::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_transaction_chf_credit_transfer_data/mod.rs b/generated/stripe_payment/src/source_transaction_chf_credit_transfer_data/mod.rs new file mode 100644 index 000000000..591c2a946 --- /dev/null +++ b/generated/stripe_payment/src/source_transaction_chf_credit_transfer_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_transaction_chf_credit_transfer_data::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_transaction_gbp_credit_transfer_data/mod.rs b/generated/stripe_payment/src/source_transaction_gbp_credit_transfer_data/mod.rs new file mode 100644 index 000000000..941e259f8 --- /dev/null +++ b/generated/stripe_payment/src/source_transaction_gbp_credit_transfer_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_transaction_gbp_credit_transfer_data::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_transaction_paper_check_data/mod.rs b/generated/stripe_payment/src/source_transaction_paper_check_data/mod.rs new file mode 100644 index 000000000..d925606c7 --- /dev/null +++ b/generated/stripe_payment/src/source_transaction_paper_check_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_transaction_paper_check_data::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_transaction_sepa_credit_transfer_data/mod.rs b/generated/stripe_payment/src/source_transaction_sepa_credit_transfer_data/mod.rs new file mode 100644 index 000000000..d49ef4550 --- /dev/null +++ b/generated/stripe_payment/src/source_transaction_sepa_credit_transfer_data/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_transaction_sepa_credit_transfer_data::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_ach_credit_transfer/mod.rs b/generated/stripe_payment/src/source_type_ach_credit_transfer/mod.rs new file mode 100644 index 000000000..1b91599b6 --- /dev/null +++ b/generated/stripe_payment/src/source_type_ach_credit_transfer/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_ach_credit_transfer::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_ach_debit/mod.rs b/generated/stripe_payment/src/source_type_ach_debit/mod.rs new file mode 100644 index 000000000..8e9ff4a8f --- /dev/null +++ b/generated/stripe_payment/src/source_type_ach_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_ach_debit::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_acss_debit/mod.rs b/generated/stripe_payment/src/source_type_acss_debit/mod.rs new file mode 100644 index 000000000..1cb05252d --- /dev/null +++ b/generated/stripe_payment/src/source_type_acss_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_acss_debit::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_alipay/mod.rs b/generated/stripe_payment/src/source_type_alipay/mod.rs new file mode 100644 index 000000000..4023bea4d --- /dev/null +++ b/generated/stripe_payment/src/source_type_alipay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_alipay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_au_becs_debit/mod.rs b/generated/stripe_payment/src/source_type_au_becs_debit/mod.rs new file mode 100644 index 000000000..7301ac73a --- /dev/null +++ b/generated/stripe_payment/src/source_type_au_becs_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_au_becs_debit::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_bancontact/mod.rs b/generated/stripe_payment/src/source_type_bancontact/mod.rs new file mode 100644 index 000000000..5165b6525 --- /dev/null +++ b/generated/stripe_payment/src/source_type_bancontact/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_bancontact::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_card/mod.rs b/generated/stripe_payment/src/source_type_card/mod.rs new file mode 100644 index 000000000..2ddecc2b4 --- /dev/null +++ b/generated/stripe_payment/src/source_type_card/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_card::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_card_present/mod.rs b/generated/stripe_payment/src/source_type_card_present/mod.rs new file mode 100644 index 000000000..81989d4bd --- /dev/null +++ b/generated/stripe_payment/src/source_type_card_present/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_card_present::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_eps/mod.rs b/generated/stripe_payment/src/source_type_eps/mod.rs new file mode 100644 index 000000000..cb1b22c2a --- /dev/null +++ b/generated/stripe_payment/src/source_type_eps/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_eps::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_giropay/mod.rs b/generated/stripe_payment/src/source_type_giropay/mod.rs new file mode 100644 index 000000000..cc6989c5b --- /dev/null +++ b/generated/stripe_payment/src/source_type_giropay/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_giropay::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_ideal/mod.rs b/generated/stripe_payment/src/source_type_ideal/mod.rs new file mode 100644 index 000000000..5a2b8c1b6 --- /dev/null +++ b/generated/stripe_payment/src/source_type_ideal/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_ideal::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_klarna/mod.rs b/generated/stripe_payment/src/source_type_klarna/mod.rs new file mode 100644 index 000000000..fb23d14e8 --- /dev/null +++ b/generated/stripe_payment/src/source_type_klarna/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_klarna::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_multibanco/mod.rs b/generated/stripe_payment/src/source_type_multibanco/mod.rs new file mode 100644 index 000000000..910ca8374 --- /dev/null +++ b/generated/stripe_payment/src/source_type_multibanco/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_multibanco::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_p24/mod.rs b/generated/stripe_payment/src/source_type_p24/mod.rs new file mode 100644 index 000000000..bff78c927 --- /dev/null +++ b/generated/stripe_payment/src/source_type_p24/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_p24::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_sepa_credit_transfer/mod.rs b/generated/stripe_payment/src/source_type_sepa_credit_transfer/mod.rs new file mode 100644 index 000000000..5db625b11 --- /dev/null +++ b/generated/stripe_payment/src/source_type_sepa_credit_transfer/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_sepa_credit_transfer::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_sepa_debit/mod.rs b/generated/stripe_payment/src/source_type_sepa_debit/mod.rs new file mode 100644 index 000000000..d924b2614 --- /dev/null +++ b/generated/stripe_payment/src/source_type_sepa_debit/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_sepa_debit::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_sofort/mod.rs b/generated/stripe_payment/src/source_type_sofort/mod.rs new file mode 100644 index 000000000..88f128428 --- /dev/null +++ b/generated/stripe_payment/src/source_type_sofort/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_sofort::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_three_d_secure/mod.rs b/generated/stripe_payment/src/source_type_three_d_secure/mod.rs new file mode 100644 index 000000000..2ac5f21f7 --- /dev/null +++ b/generated/stripe_payment/src/source_type_three_d_secure/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_three_d_secure::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/source_type_wechat/mod.rs b/generated/stripe_payment/src/source_type_wechat/mod.rs new file mode 100644 index 000000000..f56591e54 --- /dev/null +++ b/generated/stripe_payment/src/source_type_wechat/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::source_type_wechat::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/three_d_secure_details_charge/mod.rs b/generated/stripe_payment/src/three_d_secure_details_charge/mod.rs new file mode 100644 index 000000000..5e3e9111b --- /dev/null +++ b/generated/stripe_payment/src/three_d_secure_details_charge/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::three_d_secure_details_charge::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/three_d_secure_usage/mod.rs b/generated/stripe_payment/src/three_d_secure_usage/mod.rs new file mode 100644 index 000000000..fbede3d00 --- /dev/null +++ b/generated/stripe_payment/src/three_d_secure_usage/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::three_d_secure_usage::*; \ No newline at end of file diff --git a/generated/stripe_payment/src/us_bank_account_networks/mod.rs b/generated/stripe_payment/src/us_bank_account_networks/mod.rs new file mode 100644 index 000000000..9bc674244 --- /dev/null +++ b/generated/stripe_payment/src/us_bank_account_networks/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::us_bank_account_networks::*; \ No newline at end of file diff --git a/generated/stripe_product/Cargo.toml b/generated/stripe_product/Cargo.toml new file mode 100644 index 000000000..15861e5b1 --- /dev/null +++ b/generated/stripe_product/Cargo.toml @@ -0,0 +1,53 @@ +[package] +name = "stripe_product" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + +[dependencies] +serde.workspace = true +http-types.workspace = true +smol_str.workspace = true +serde_json.workspace = true +async-stripe = {path = "../../async-stripe"} + +stripe_types = {path = "../../stripe_types"} + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +coupon = [] +price = [] +product = [] +promotion_code = [] +shipping_rate = [] +tax_product_resource_tax_code = [] +tax_rate = [] + +full = ["coupon", +"price", +"product", +"promotion_code", +"shipping_rate", +"tax_product_resource_tax_code", +"tax_rate"] + diff --git a/generated/stripe_product/src/coupon/mod.rs b/generated/stripe_product/src/coupon/mod.rs new file mode 100644 index 000000000..14c1315c7 --- /dev/null +++ b/generated/stripe_product/src/coupon/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::coupon::*; +#[cfg(feature = "coupon")] +mod requests; +#[cfg(feature = "coupon")] +pub use requests::*; diff --git a/generated/stripe_product/src/coupon/requests.rs b/generated/stripe_product/src/coupon/requests.rs new file mode 100644 index 000000000..35abd92eb --- /dev/null +++ b/generated/stripe_product/src/coupon/requests.rs @@ -0,0 +1,296 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCoupon<'a> { + /// A filter on the list, based on the object `created` field. + /// + /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListCoupon<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCoupon<'a> { + /// Returns a list of your coupons. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/coupons", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/coupons", self) + } +} +impl<'a> stripe::PaginationParams for ListCoupon<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCoupon<'a> { + /// A positive integer representing the amount to subtract from an invoice total (required if `percent_off` is not passed). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_off: Option, + /// A hash containing directions for what this Coupon will apply discounts to. + #[serde(skip_serializing_if = "Option::is_none")] + pub applies_to: Option>, + /// Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `amount_off` parameter (required if `amount_off` is passed). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Coupons defined in each available currency option (only supported if `amount_off` is passed). + /// + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: + Option<&'a std::collections::HashMap>, + /// Specifies how long the discount will be in effect if used on a subscription. + /// + /// Defaults to `once`. + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Required only if `duration` is `repeating`, in which case it must be a positive integer that specifies the number of months the discount will be in effect. + #[serde(skip_serializing_if = "Option::is_none")] + pub duration_in_months: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Unique string of your choice that will be used to identify this coupon when applying it to a customer. + /// + /// If you don't want to specify a particular code, you can leave the ID blank and we'll generate a random code for you. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<&'a str>, + /// A positive integer specifying the number of times the coupon can be redeemed before it's no longer valid. + /// + /// For example, you might have a 50% off coupon that the first 20 readers of your blog can use. + #[serde(skip_serializing_if = "Option::is_none")] + pub max_redemptions: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Name of the coupon displayed to customers on, for instance invoices, or receipts. + /// + /// By default the `id` is shown if `name` is not set. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if `amount_off` is not passed). + #[serde(skip_serializing_if = "Option::is_none")] + pub percent_off: Option, + /// Unix timestamp specifying the last time at which the coupon can be redeemed. + /// + /// After the redeem_by date, the coupon can no longer be applied to new customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub redeem_by: Option, +} +impl<'a> CreateCoupon<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A hash containing directions for what this Coupon will apply discounts to. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCouponAppliesTo<'a> { + /// An array of Product IDs that this Coupon will apply to. + #[serde(skip_serializing_if = "Option::is_none")] + pub products: Option<&'a [&'a str]>, +} +impl<'a> CreateCouponAppliesTo<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Coupons defined in each available currency option (only supported if `amount_off` is passed). +/// +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCouponCurrencyOptions { + /// A positive integer representing the amount to subtract from an invoice total. + pub amount_off: i64, +} +impl CreateCouponCurrencyOptions { + pub fn new(amount_off: i64) -> Self { + Self { amount_off } + } +} +/// Specifies how long the discount will be in effect if used on a subscription. +/// +/// Defaults to `once`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCouponDuration { + Forever, + Once, + Repeating, +} +impl CreateCouponDuration { + pub fn as_str(self) -> &'static str { + use CreateCouponDuration::*; + match self { + Forever => "forever", + Once => "once", + Repeating => "repeating", + } + } +} + +impl std::str::FromStr for CreateCouponDuration { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCouponDuration::*; + match s { + "forever" => Ok(Forever), + "once" => Ok(Once), + "repeating" => Ok(Repeating), + _ => Err(()), + } + } +} +impl AsRef for CreateCouponDuration { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateCouponDuration { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCouponDuration { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCouponDuration { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateCoupon<'a> { + /// You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. + /// + /// Coupon creation is also accessible via the API if you need to create coupons on the fly. A coupon has either a `percent_off` or an `amount_off` and `currency`. + /// If you set an `amount_off`, that amount will be subtracted from any invoice’s subtotal. + /// For example, an invoice with a subtotal of $100 will have a final total of $0 if a coupon with an `amount_off` of 20000 is applied to it and an invoice with a subtotal of $300 will have a final total of $100 if a coupon with an `amount_off` of 20000 is applied to it. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/coupons", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCoupon<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCoupon<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCoupon<'a> { + /// Retrieves the coupon with the given ID. + pub fn send( + &self, + client: &stripe::Client, + coupon: &stripe_types::coupon::CouponId, + ) -> stripe::Response { + client.get_query(&format!("/coupons/{coupon}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCoupon<'a> { + /// Coupons defined in each available currency option (only supported if the coupon is amount-based). + /// + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: + Option<&'a std::collections::HashMap>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Name of the coupon displayed to customers on, for instance invoices, or receipts. + /// + /// By default the `id` is shown if `name` is not set. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, +} +impl<'a> UpdateCoupon<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Coupons defined in each available currency option (only supported if the coupon is amount-based). +/// +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateCouponCurrencyOptions { + /// A positive integer representing the amount to subtract from an invoice total. + pub amount_off: i64, +} +impl UpdateCouponCurrencyOptions { + pub fn new(amount_off: i64) -> Self { + Self { amount_off } + } +} +impl<'a> UpdateCoupon<'a> { + /// Updates the metadata of a coupon. + /// + /// Other coupon details (currency, duration, amount_off) are, by design, not editable. + pub fn send( + &self, + client: &stripe::Client, + coupon: &stripe_types::coupon::CouponId, + ) -> stripe::Response { + client.send_form(&format!("/coupons/{coupon}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteCoupon {} +impl DeleteCoupon { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteCoupon { + /// You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. + /// + /// However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can’t redeem the coupon. + /// You can also delete coupons via the API. + pub fn send( + &self, + client: &stripe::Client, + coupon: &stripe_types::coupon::CouponId, + ) -> stripe::Response { + client.send_form(&format!("/coupons/{coupon}"), self, http_types::Method::Delete) + } +} diff --git a/generated/stripe_product/src/coupon_applies_to/mod.rs b/generated/stripe_product/src/coupon_applies_to/mod.rs new file mode 100644 index 000000000..6f1d493cc --- /dev/null +++ b/generated/stripe_product/src/coupon_applies_to/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::coupon_applies_to::*; \ No newline at end of file diff --git a/generated/stripe_product/src/coupon_currency_option/mod.rs b/generated/stripe_product/src/coupon_currency_option/mod.rs new file mode 100644 index 000000000..eb3b3dfad --- /dev/null +++ b/generated/stripe_product/src/coupon_currency_option/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::coupon_currency_option::*; \ No newline at end of file diff --git a/generated/stripe_product/src/currency_option/mod.rs b/generated/stripe_product/src/currency_option/mod.rs new file mode 100644 index 000000000..fee607d47 --- /dev/null +++ b/generated/stripe_product/src/currency_option/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::currency_option::*; \ No newline at end of file diff --git a/generated/stripe_product/src/custom_unit_amount/mod.rs b/generated/stripe_product/src/custom_unit_amount/mod.rs new file mode 100644 index 000000000..e884a3e48 --- /dev/null +++ b/generated/stripe_product/src/custom_unit_amount/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::custom_unit_amount::*; \ No newline at end of file diff --git a/generated/stripe_product/src/deleted_coupon/mod.rs b/generated/stripe_product/src/deleted_coupon/mod.rs new file mode 100644 index 000000000..4a685a138 --- /dev/null +++ b/generated/stripe_product/src/deleted_coupon/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::deleted_coupon::*; \ No newline at end of file diff --git a/generated/stripe_product/src/deleted_discount/mod.rs b/generated/stripe_product/src/deleted_discount/mod.rs new file mode 100644 index 000000000..9abec7dc8 --- /dev/null +++ b/generated/stripe_product/src/deleted_discount/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::deleted_discount::*; \ No newline at end of file diff --git a/generated/stripe_product/src/deleted_product/mod.rs b/generated/stripe_product/src/deleted_product/mod.rs new file mode 100644 index 000000000..6934f85c3 --- /dev/null +++ b/generated/stripe_product/src/deleted_product/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::deleted_product::*; \ No newline at end of file diff --git a/generated/stripe_product/src/discount/mod.rs b/generated/stripe_product/src/discount/mod.rs new file mode 100644 index 000000000..de8a0743e --- /dev/null +++ b/generated/stripe_product/src/discount/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::discount::*; \ No newline at end of file diff --git a/generated/stripe_product/src/line_items_discount_amount/mod.rs b/generated/stripe_product/src/line_items_discount_amount/mod.rs new file mode 100644 index 000000000..48a3506d5 --- /dev/null +++ b/generated/stripe_product/src/line_items_discount_amount/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::line_items_discount_amount::*; \ No newline at end of file diff --git a/generated/stripe_product/src/line_items_tax_amount/mod.rs b/generated/stripe_product/src/line_items_tax_amount/mod.rs new file mode 100644 index 000000000..eae465f89 --- /dev/null +++ b/generated/stripe_product/src/line_items_tax_amount/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::line_items_tax_amount::*; \ No newline at end of file diff --git a/generated/stripe_product/src/mod.rs b/generated/stripe_product/src/mod.rs new file mode 100644 index 000000000..edd531fa9 --- /dev/null +++ b/generated/stripe_product/src/mod.rs @@ -0,0 +1,35 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::invalid_html_tags)] +extern crate self as stripe_product; +pub use stripe_types::Coupon; +pub mod coupon; +pub use stripe_types::CouponAppliesTo; +pub use stripe_types::CouponCurrencyOption; +pub use stripe_types::CurrencyOption; +pub use stripe_types::CustomUnitAmount; +pub use stripe_types::DeletedCoupon; +pub use stripe_types::DeletedDiscount; +pub use stripe_types::DeletedProduct; +pub use stripe_types::Discount; +pub use stripe_types::LineItemsDiscountAmount; +pub use stripe_types::LineItemsTaxAmount; +pub use stripe_types::PackageDimensions; +pub use stripe_types::Price; +pub mod price; +pub use stripe_types::PriceTier; +pub use stripe_types::Product; +pub mod product; +pub use stripe_types::ProductFeature; +pub use stripe_types::PromotionCode; +pub mod promotion_code; +pub use stripe_types::PromotionCodeCurrencyOption; +pub use stripe_types::PromotionCodesResourceRestrictions; +pub use stripe_types::Recurring; +pub use stripe_types::ShippingRate; +pub mod shipping_rate; +pub use stripe_types::TaxProductResourceTaxCode; +pub mod tax_product_resource_tax_code; +pub use stripe_types::TaxRate; +pub mod tax_rate; +pub use stripe_types::TransformQuantity; diff --git a/generated/stripe_product/src/package_dimensions/mod.rs b/generated/stripe_product/src/package_dimensions/mod.rs new file mode 100644 index 000000000..4051e7490 --- /dev/null +++ b/generated/stripe_product/src/package_dimensions/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::package_dimensions::*; \ No newline at end of file diff --git a/generated/stripe_product/src/price/mod.rs b/generated/stripe_product/src/price/mod.rs new file mode 100644 index 000000000..74d9232e0 --- /dev/null +++ b/generated/stripe_product/src/price/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::price::*; +#[cfg(feature = "price")] +mod requests; +#[cfg(feature = "price")] +pub use requests::*; diff --git a/generated/stripe_product/src/price/requests.rs b/generated/stripe_product/src/price/requests.rs new file mode 100644 index 000000000..c2194fe64 --- /dev/null +++ b/generated/stripe_product/src/price/requests.rs @@ -0,0 +1,1540 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SearchPrice<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for pagination across multiple pages of results. + /// + /// Don't include this parameter on the first call. + /// Use the next_page value returned in a previous response to request subsequent results. + #[serde(skip_serializing_if = "Option::is_none")] + pub page: Option<&'a str>, + /// The search query string. + /// + /// See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for prices](https://stripe.com/docs/search#query-fields-for-prices). + pub query: &'a str, +} +impl<'a> SearchPrice<'a> { + pub fn new(query: &'a str) -> Self { + Self { + expand: Default::default(), + limit: Default::default(), + page: Default::default(), + query, + } + } +} +impl<'a> SearchPrice<'a> { + /// Search for prices you’ve previously created using Stripe’s [Search Query Language](https://stripe.com/docs/search#search-query-language). + /// Don’t use search in read-after-write flows where strict consistency is necessary. + /// + /// Under normal operating conditions, data is searchable in less than a minute. + /// Occasionally, propagation of new or updated data can be up to an hour behind during outages. + /// Search functionality is not available to merchants in India. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.get_query("/prices/search", self) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SearchReturned { + pub data: Vec, + pub has_more: bool, + pub next_page: Option, + /// String representing the object's type. + /// + /// Objects of the same type share the same value. + pub object: SearchReturnedObject, + /// The total number of objects that match the query, only accurate up to 10,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub total_count: Option, + pub url: String, +} +/// String representing the object's type. +/// +/// Objects of the same type share the same value. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SearchReturnedObject { + SearchResult, +} +impl SearchReturnedObject { + pub fn as_str(self) -> &'static str { + use SearchReturnedObject::*; + match self { + SearchResult => "search_result", + } + } +} + +impl std::str::FromStr for SearchReturnedObject { + type Err = (); + fn from_str(s: &str) -> Result { + use SearchReturnedObject::*; + match s { + "search_result" => Ok(SearchResult), + _ => Err(()), + } + } +} +impl AsRef for SearchReturnedObject { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SearchReturnedObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SearchReturnedObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SearchReturnedObject { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SearchReturnedObject { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SearchReturnedObject")) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPrice<'a> { + /// Only return prices that are active or inactive (e.g., pass `false` to list all inactive prices). + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// A filter on the list, based on the object `created` field. + /// + /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return prices for the given currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return the price with these lookup_keys, if any exist. + #[serde(skip_serializing_if = "Option::is_none")] + pub lookup_keys: Option<&'a [&'a str]>, + /// Only return prices for the given product. + #[serde(skip_serializing_if = "Option::is_none")] + pub product: Option<&'a str>, + /// Only return prices with these recurring fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return prices of type `recurring` or `one_time`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> ListPrice<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Only return prices with these recurring fields. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPriceRecurring { + /// Filter by billing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval: Option, + /// Filter by the usage type for this price. + /// + /// Can be either `metered` or `licensed`. + #[serde(skip_serializing_if = "Option::is_none")] + pub usage_type: Option, +} +impl ListPriceRecurring { + pub fn new() -> Self { + Self::default() + } +} +/// Filter by billing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListPriceRecurringInterval { + Day, + Month, + Week, + Year, +} +impl ListPriceRecurringInterval { + pub fn as_str(self) -> &'static str { + use ListPriceRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for ListPriceRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use ListPriceRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for ListPriceRecurringInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListPriceRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListPriceRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListPriceRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Filter by the usage type for this price. +/// +/// Can be either `metered` or `licensed`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListPriceRecurringUsageType { + Licensed, + Metered, +} +impl ListPriceRecurringUsageType { + pub fn as_str(self) -> &'static str { + use ListPriceRecurringUsageType::*; + match self { + Licensed => "licensed", + Metered => "metered", + } + } +} + +impl std::str::FromStr for ListPriceRecurringUsageType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListPriceRecurringUsageType::*; + match s { + "licensed" => Ok(Licensed), + "metered" => Ok(Metered), + _ => Err(()), + } + } +} +impl AsRef for ListPriceRecurringUsageType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListPriceRecurringUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListPriceRecurringUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListPriceRecurringUsageType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only return prices of type `recurring` or `one_time`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListPriceType { + OneTime, + Recurring, +} +impl ListPriceType { + pub fn as_str(self) -> &'static str { + use ListPriceType::*; + match self { + OneTime => "one_time", + Recurring => "recurring", + } + } +} + +impl std::str::FromStr for ListPriceType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListPriceType::*; + match s { + "one_time" => Ok(OneTime), + "recurring" => Ok(Recurring), + _ => Err(()), + } + } +} +impl AsRef for ListPriceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListPriceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListPriceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListPriceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListPrice<'a> { + /// Returns a list of your active prices, excluding [inline prices](https://stripe.com/docs/products-prices/pricing-models#inline-pricing). + /// + /// For the list of inactive prices, set `active` to false. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/prices", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/prices", self) + } +} +impl<'a> stripe::PaginationParams for ListPrice<'a> {} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePrice<'a> { + /// Whether the price can be used for new purchases. + /// + /// Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Describes how to compute the price per period. + /// + /// Either `per_unit` or `tiered`. + /// `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). + /// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_scheme: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Prices defined in each available currency option. + /// + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: + Option<&'a std::collections::HashMap>, + /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_unit_amount: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A lookup key used to retrieve prices dynamically from a static string. + /// + /// This may be up to 200 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub lookup_key: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A brief description of the price, hidden from customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub nickname: Option<&'a str>, + /// The ID of the product that this price will belong to. + #[serde(skip_serializing_if = "Option::is_none")] + pub product: Option<&'a str>, + /// These fields can be used to create a new product that this price will belong to. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_data: Option>, + /// The recurring components of a price such as `interval` and `usage_type`. + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring: Option, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// Each element represents a pricing tier. + /// + /// This parameter requires `billing_scheme` to be set to `tiered`. + /// See also the documentation for `billing_scheme`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers: Option<&'a [CreatePriceTiers<'a>]>, + /// Defines if the tiering price should be `graduated` or `volume` based. + /// + /// In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers_mode: Option, + /// If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_lookup_key: Option, + /// Apply a transformation to the reported usage or set quantity before computing the billed price. + /// + /// Cannot be combined with `tiers`. + #[serde(skip_serializing_if = "Option::is_none")] + pub transform_quantity: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + /// + /// One of `unit_amount` or `custom_unit_amount` is required, unless `billing_scheme=tiered`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreatePrice<'a> { + pub fn new(currency: stripe_types::Currency) -> Self { + Self { + active: Default::default(), + billing_scheme: Default::default(), + currency, + currency_options: Default::default(), + custom_unit_amount: Default::default(), + expand: Default::default(), + lookup_key: Default::default(), + metadata: Default::default(), + nickname: Default::default(), + product: Default::default(), + product_data: Default::default(), + recurring: Default::default(), + tax_behavior: Default::default(), + tiers: Default::default(), + tiers_mode: Default::default(), + transfer_lookup_key: Default::default(), + transform_quantity: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// Describes how to compute the price per period. +/// +/// Either `per_unit` or `tiered`. +/// `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). +/// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePriceBillingScheme { + PerUnit, + Tiered, +} +impl CreatePriceBillingScheme { + pub fn as_str(self) -> &'static str { + use CreatePriceBillingScheme::*; + match self { + PerUnit => "per_unit", + Tiered => "tiered", + } + } +} + +impl std::str::FromStr for CreatePriceBillingScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePriceBillingScheme::*; + match s { + "per_unit" => Ok(PerUnit), + "tiered" => Ok(Tiered), + _ => Err(()), + } + } +} +impl AsRef for CreatePriceBillingScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePriceBillingScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePriceBillingScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePriceBillingScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Prices defined in each available currency option. +/// +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Clone, Debug, Default, serde::Serialize)] +pub struct CreatePriceCurrencyOptions { + /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_unit_amount: Option, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// Each element represents a pricing tier. + /// + /// This parameter requires `billing_scheme` to be set to `tiered`. + /// See also the documentation for `billing_scheme`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers: Option>, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option, +} +impl CreatePriceCurrencyOptions { + pub fn new() -> Self { + Self::default() + } +} +/// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePriceCurrencyOptionsCustomUnitAmount { + /// Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. + pub enabled: bool, + /// The maximum unit amount the customer can specify for this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option, + /// The minimum unit amount the customer can specify for this item. + /// + /// Must be at least the minimum charge amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option, + /// The starting unit amount which can be updated by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub preset: Option, +} +impl CreatePriceCurrencyOptionsCustomUnitAmount { + pub fn new(enabled: bool) -> Self { + Self { + enabled, + maximum: Default::default(), + minimum: Default::default(), + preset: Default::default(), + } + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePriceCurrencyOptionsTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreatePriceCurrencyOptionsTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreatePriceCurrencyOptionsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreatePriceCurrencyOptionsTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePriceCurrencyOptionsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreatePriceCurrencyOptionsTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePriceCurrencyOptionsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePriceCurrencyOptionsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePriceCurrencyOptionsTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Each element represents a pricing tier. +/// +/// This parameter requires `billing_scheme` to be set to `tiered`. +/// See also the documentation for `billing_scheme`. +#[derive(Clone, Debug, serde::Serialize)] +pub struct CreatePriceCurrencyOptionsTiers { + /// The flat billing amount for an entire tier, regardless of the number of units in the tier. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount: Option, + /// Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. + /// + /// Only one of `flat_amount` and `flat_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount_decimal: Option, + /// The per unit billing amount for each individual unit for which this tier applies. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option, + /// Specifies the upper bound of this tier. + /// + /// The lower bound of a tier is the upper bound of the previous tier adding one. + /// Use `inf` to define a fallback tier. + pub up_to: CreatePriceCurrencyOptionsTiersUpTo, +} +impl CreatePriceCurrencyOptionsTiers { + pub fn new(up_to: CreatePriceCurrencyOptionsTiersUpTo) -> Self { + Self { + flat_amount: Default::default(), + flat_amount_decimal: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + up_to, + } + } +} +/// Specifies the upper bound of this tier. +/// +/// The lower bound of a tier is the upper bound of the previous tier adding one. +/// Use `inf` to define a fallback tier. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreatePriceCurrencyOptionsTiersUpTo { + Inf, + I64(i64), +} +/// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePriceCustomUnitAmount { + /// Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. + pub enabled: bool, + /// The maximum unit amount the customer can specify for this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option, + /// The minimum unit amount the customer can specify for this item. + /// + /// Must be at least the minimum charge amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option, + /// The starting unit amount which can be updated by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub preset: Option, +} +impl CreatePriceCustomUnitAmount { + pub fn new(enabled: bool) -> Self { + Self { + enabled, + maximum: Default::default(), + minimum: Default::default(), + preset: Default::default(), + } + } +} +/// These fields can be used to create a new product that this price will belong to. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePriceProductData<'a> { + /// Whether the product is currently available for purchase. + /// + /// Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// The identifier for the product. + /// + /// Must be unique. + /// If not provided, an identifier will be randomly generated. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The product's name, meant to be displayable to the customer. + pub name: &'a str, + /// An arbitrary string to be displayed on your customer's credit card or bank statement. + /// + /// While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. + /// The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. + /// Non-ASCII characters are automatically stripped. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// A label that represents units of this product. + /// + /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_label: Option<&'a str>, +} +impl<'a> CreatePriceProductData<'a> { + pub fn new(name: &'a str) -> Self { + Self { + active: Default::default(), + id: Default::default(), + metadata: Default::default(), + name, + statement_descriptor: Default::default(), + tax_code: Default::default(), + unit_label: Default::default(), + } + } +} +/// The recurring components of a price such as `interval` and `usage_type`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePriceRecurring { + /// Specifies a usage aggregation strategy for prices of `usage_type=metered`. + /// + /// Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. + /// Defaults to `sum`. + #[serde(skip_serializing_if = "Option::is_none")] + pub aggregate_usage: Option, + /// Specifies billing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + pub interval: CreatePriceRecurringInterval, + /// The number of intervals between subscription billings. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, + /// Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_period_days: Option, + /// Configures how the quantity per period should be determined. + /// + /// Can be either `metered` or `licensed`. + /// `licensed` automatically bills the `quantity` set when adding it to a subscription. + /// `metered` aggregates the total usage based on usage records. + /// Defaults to `licensed`. + #[serde(skip_serializing_if = "Option::is_none")] + pub usage_type: Option, +} +impl CreatePriceRecurring { + pub fn new(interval: CreatePriceRecurringInterval) -> Self { + Self { + aggregate_usage: Default::default(), + interval, + interval_count: Default::default(), + trial_period_days: Default::default(), + usage_type: Default::default(), + } + } +} +/// Specifies a usage aggregation strategy for prices of `usage_type=metered`. +/// +/// Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. +/// Defaults to `sum`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePriceRecurringAggregateUsage { + LastDuringPeriod, + LastEver, + Max, + Sum, +} +impl CreatePriceRecurringAggregateUsage { + pub fn as_str(self) -> &'static str { + use CreatePriceRecurringAggregateUsage::*; + match self { + LastDuringPeriod => "last_during_period", + LastEver => "last_ever", + Max => "max", + Sum => "sum", + } + } +} + +impl std::str::FromStr for CreatePriceRecurringAggregateUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePriceRecurringAggregateUsage::*; + match s { + "last_during_period" => Ok(LastDuringPeriod), + "last_ever" => Ok(LastEver), + "max" => Ok(Max), + "sum" => Ok(Sum), + _ => Err(()), + } + } +} +impl AsRef for CreatePriceRecurringAggregateUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePriceRecurringAggregateUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePriceRecurringAggregateUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePriceRecurringAggregateUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies billing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePriceRecurringInterval { + Day, + Month, + Week, + Year, +} +impl CreatePriceRecurringInterval { + pub fn as_str(self) -> &'static str { + use CreatePriceRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreatePriceRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePriceRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for CreatePriceRecurringInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePriceRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePriceRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePriceRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configures how the quantity per period should be determined. +/// +/// Can be either `metered` or `licensed`. +/// `licensed` automatically bills the `quantity` set when adding it to a subscription. +/// `metered` aggregates the total usage based on usage records. +/// Defaults to `licensed`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePriceRecurringUsageType { + Licensed, + Metered, +} +impl CreatePriceRecurringUsageType { + pub fn as_str(self) -> &'static str { + use CreatePriceRecurringUsageType::*; + match self { + Licensed => "licensed", + Metered => "metered", + } + } +} + +impl std::str::FromStr for CreatePriceRecurringUsageType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePriceRecurringUsageType::*; + match s { + "licensed" => Ok(Licensed), + "metered" => Ok(Metered), + _ => Err(()), + } + } +} +impl AsRef for CreatePriceRecurringUsageType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePriceRecurringUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePriceRecurringUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePriceRecurringUsageType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePriceTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreatePriceTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreatePriceTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreatePriceTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePriceTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreatePriceTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePriceTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePriceTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePriceTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Each element represents a pricing tier. +/// +/// This parameter requires `billing_scheme` to be set to `tiered`. +/// See also the documentation for `billing_scheme`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePriceTiers<'a> { + /// The flat billing amount for an entire tier, regardless of the number of units in the tier. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount: Option, + /// Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. + /// + /// Only one of `flat_amount` and `flat_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount_decimal: Option<&'a str>, + /// The per unit billing amount for each individual unit for which this tier applies. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, + /// Specifies the upper bound of this tier. + /// + /// The lower bound of a tier is the upper bound of the previous tier adding one. + /// Use `inf` to define a fallback tier. + pub up_to: CreatePriceTiersUpTo, +} +impl<'a> CreatePriceTiers<'a> { + pub fn new(up_to: CreatePriceTiersUpTo) -> Self { + Self { + flat_amount: Default::default(), + flat_amount_decimal: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + up_to, + } + } +} +/// Specifies the upper bound of this tier. +/// +/// The lower bound of a tier is the upper bound of the previous tier adding one. +/// Use `inf` to define a fallback tier. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreatePriceTiersUpTo { + Inf, + I64(i64), +} +/// Defines if the tiering price should be `graduated` or `volume` based. +/// +/// In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePriceTiersMode { + Graduated, + Volume, +} +impl CreatePriceTiersMode { + pub fn as_str(self) -> &'static str { + use CreatePriceTiersMode::*; + match self { + Graduated => "graduated", + Volume => "volume", + } + } +} + +impl std::str::FromStr for CreatePriceTiersMode { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePriceTiersMode::*; + match s { + "graduated" => Ok(Graduated), + "volume" => Ok(Volume), + _ => Err(()), + } + } +} +impl AsRef for CreatePriceTiersMode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePriceTiersMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePriceTiersMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePriceTiersMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Apply a transformation to the reported usage or set quantity before computing the billed price. +/// +/// Cannot be combined with `tiers`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePriceTransformQuantity { + /// Divide usage by this number. + pub divide_by: i64, + /// After division, either round the result `up` or `down`. + pub round: CreatePriceTransformQuantityRound, +} +impl CreatePriceTransformQuantity { + pub fn new(divide_by: i64, round: CreatePriceTransformQuantityRound) -> Self { + Self { divide_by, round } + } +} +/// After division, either round the result `up` or `down`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePriceTransformQuantityRound { + Down, + Up, +} +impl CreatePriceTransformQuantityRound { + pub fn as_str(self) -> &'static str { + use CreatePriceTransformQuantityRound::*; + match self { + Down => "down", + Up => "up", + } + } +} + +impl std::str::FromStr for CreatePriceTransformQuantityRound { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePriceTransformQuantityRound::*; + match s { + "down" => Ok(Down), + "up" => Ok(Up), + _ => Err(()), + } + } +} +impl AsRef for CreatePriceTransformQuantityRound { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreatePriceTransformQuantityRound { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePriceTransformQuantityRound { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePriceTransformQuantityRound { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreatePrice<'a> { + /// Creates a new price for an existing product. + /// + /// The price can be recurring or one-time. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/prices", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePrice<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePrice<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePrice<'a> { + /// Retrieves the price with the given ID. + pub fn send( + &self, + client: &stripe::Client, + price: &stripe_types::price::PriceId, + ) -> stripe::Response { + client.get_query(&format!("/prices/{price}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePrice<'a> { + /// Whether the price can be used for new purchases. + /// + /// Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Prices defined in each available currency option. + /// + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: + Option<&'a std::collections::HashMap>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A lookup key used to retrieve prices dynamically from a static string. + /// + /// This may be up to 200 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub lookup_key: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A brief description of the price, hidden from customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub nickname: Option<&'a str>, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_lookup_key: Option, +} +impl<'a> UpdatePrice<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Prices defined in each available currency option. +/// +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePriceCurrencyOptions { + /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_unit_amount: Option, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// Each element represents a pricing tier. + /// + /// This parameter requires `billing_scheme` to be set to `tiered`. + /// See also the documentation for `billing_scheme`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers: Option>, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option, +} +impl UpdatePriceCurrencyOptions { + pub fn new() -> Self { + Self::default() + } +} +/// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePriceCurrencyOptionsCustomUnitAmount { + /// Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. + pub enabled: bool, + /// The maximum unit amount the customer can specify for this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option, + /// The minimum unit amount the customer can specify for this item. + /// + /// Must be at least the minimum charge amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option, + /// The starting unit amount which can be updated by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub preset: Option, +} +impl UpdatePriceCurrencyOptionsCustomUnitAmount { + pub fn new(enabled: bool) -> Self { + Self { + enabled, + maximum: Default::default(), + minimum: Default::default(), + preset: Default::default(), + } + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePriceCurrencyOptionsTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdatePriceCurrencyOptionsTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdatePriceCurrencyOptionsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdatePriceCurrencyOptionsTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePriceCurrencyOptionsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpdatePriceCurrencyOptionsTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePriceCurrencyOptionsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePriceCurrencyOptionsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePriceCurrencyOptionsTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Each element represents a pricing tier. +/// +/// This parameter requires `billing_scheme` to be set to `tiered`. +/// See also the documentation for `billing_scheme`. +#[derive(Clone, Debug, serde::Serialize)] +pub struct UpdatePriceCurrencyOptionsTiers { + /// The flat billing amount for an entire tier, regardless of the number of units in the tier. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount: Option, + /// Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. + /// + /// Only one of `flat_amount` and `flat_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount_decimal: Option, + /// The per unit billing amount for each individual unit for which this tier applies. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option, + /// Specifies the upper bound of this tier. + /// + /// The lower bound of a tier is the upper bound of the previous tier adding one. + /// Use `inf` to define a fallback tier. + pub up_to: UpdatePriceCurrencyOptionsTiersUpTo, +} +impl UpdatePriceCurrencyOptionsTiers { + pub fn new(up_to: UpdatePriceCurrencyOptionsTiersUpTo) -> Self { + Self { + flat_amount: Default::default(), + flat_amount_decimal: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + up_to, + } + } +} +/// Specifies the upper bound of this tier. +/// +/// The lower bound of a tier is the upper bound of the previous tier adding one. +/// Use `inf` to define a fallback tier. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdatePriceCurrencyOptionsTiersUpTo { + Inf, + I64(i64), +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePriceTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdatePriceTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdatePriceTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdatePriceTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePriceTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpdatePriceTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdatePriceTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePriceTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePriceTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdatePrice<'a> { + /// Updates the specified price by setting the values of the parameters passed. + /// + /// Any parameters not provided are left unchanged. + pub fn send( + &self, + client: &stripe::Client, + price: &stripe_types::price::PriceId, + ) -> stripe::Response { + client.send_form(&format!("/prices/{price}"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_product/src/price_tier/mod.rs b/generated/stripe_product/src/price_tier/mod.rs new file mode 100644 index 000000000..75ca49203 --- /dev/null +++ b/generated/stripe_product/src/price_tier/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::price_tier::*; \ No newline at end of file diff --git a/generated/stripe_product/src/product/mod.rs b/generated/stripe_product/src/product/mod.rs new file mode 100644 index 000000000..d899aab5c --- /dev/null +++ b/generated/stripe_product/src/product/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::product::*; +#[cfg(feature = "product")] +mod requests; +#[cfg(feature = "product")] +pub use requests::*; diff --git a/generated/stripe_product/src/product/requests.rs b/generated/stripe_product/src/product/requests.rs new file mode 100644 index 000000000..6884e82ac --- /dev/null +++ b/generated/stripe_product/src/product/requests.rs @@ -0,0 +1,945 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SearchProduct<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for pagination across multiple pages of results. + /// + /// Don't include this parameter on the first call. + /// Use the next_page value returned in a previous response to request subsequent results. + #[serde(skip_serializing_if = "Option::is_none")] + pub page: Option<&'a str>, + /// The search query string. + /// + /// See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for products](https://stripe.com/docs/search#query-fields-for-products). + pub query: &'a str, +} +impl<'a> SearchProduct<'a> { + pub fn new(query: &'a str) -> Self { + Self { + expand: Default::default(), + limit: Default::default(), + page: Default::default(), + query, + } + } +} +impl<'a> SearchProduct<'a> { + /// Search for products you’ve previously created using Stripe’s [Search Query Language](https://stripe.com/docs/search#search-query-language). + /// Don’t use search in read-after-write flows where strict consistency is necessary. + /// + /// Under normal operating conditions, data is searchable in less than a minute. + /// Occasionally, propagation of new or updated data can be up to an hour behind during outages. + /// Search functionality is not available to merchants in India. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.get_query("/products/search", self) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SearchReturned { + pub data: Vec, + pub has_more: bool, + pub next_page: Option, + /// String representing the object's type. + /// + /// Objects of the same type share the same value. + pub object: SearchReturnedObject, + /// The total number of objects that match the query, only accurate up to 10,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub total_count: Option, + pub url: String, +} +/// String representing the object's type. +/// +/// Objects of the same type share the same value. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SearchReturnedObject { + SearchResult, +} +impl SearchReturnedObject { + pub fn as_str(self) -> &'static str { + use SearchReturnedObject::*; + match self { + SearchResult => "search_result", + } + } +} + +impl std::str::FromStr for SearchReturnedObject { + type Err = (); + fn from_str(s: &str) -> Result { + use SearchReturnedObject::*; + match s { + "search_result" => Ok(SearchResult), + _ => Err(()), + } + } +} +impl AsRef for SearchReturnedObject { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SearchReturnedObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SearchReturnedObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SearchReturnedObject { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SearchReturnedObject { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SearchReturnedObject")) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateProduct<'a> { + /// Whether the product is currently available for purchase. + /// + /// Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object. + /// + /// This Price will be set as the default price for this product. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_price_data: Option>, + /// The product's description, meant to be displayable to the customer. + /// + /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A list of up to 15 features for this product. + /// + /// These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option<&'a [CreateProductFeatures<'a>]>, + /// An identifier will be randomly generated by Stripe. + /// + /// You can optionally override this ID, but the ID must be unique across all products in your Stripe account. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<&'a str>, + /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub images: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The product's name, meant to be displayable to the customer. + pub name: &'a str, + /// The dimensions of this product for shipping purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub package_dimensions: Option, + /// Whether this product is shipped (i.e., physical goods). + #[serde(skip_serializing_if = "Option::is_none")] + pub shippable: Option, + /// An arbitrary string to be displayed on your customer's credit card or bank statement. + /// + /// While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. + /// The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. + /// Non-ASCII characters are automatically stripped. It must contain at least one letter. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// The type of the product. + /// + /// Defaults to `service` if not explicitly specified, enabling use of this product with Subscriptions and Plans. + /// Set this parameter to `good` to use this product with Orders and SKUs. + /// On API versions before `2018-02-05`, this field defaults to `good` for compatibility reasons. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// A label that represents units of this product. + /// + /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_label: Option<&'a str>, + /// A URL of a publicly-accessible webpage for this product. + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option<&'a str>, +} +impl<'a> CreateProduct<'a> { + pub fn new(name: &'a str) -> Self { + Self { + active: Default::default(), + default_price_data: Default::default(), + description: Default::default(), + expand: Default::default(), + features: Default::default(), + id: Default::default(), + images: Default::default(), + metadata: Default::default(), + name, + package_dimensions: Default::default(), + shippable: Default::default(), + statement_descriptor: Default::default(), + tax_code: Default::default(), + type_: Default::default(), + unit_label: Default::default(), + url: Default::default(), + } + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object. +/// +/// This Price will be set as the default price for this product. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateProductDefaultPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Prices defined in each available currency option. + /// + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + &'a std::collections::HashMap< + stripe_types::Currency, + CreateProductDefaultPriceDataCurrencyOptions, + >, + >, + /// The recurring components of a price such as `interval` and `interval_count`. + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring: Option, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + /// + /// One of `unit_amount` or `unit_amount_decimal` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateProductDefaultPriceData<'a> { + pub fn new(currency: stripe_types::Currency) -> Self { + Self { + currency, + currency_options: Default::default(), + recurring: Default::default(), + tax_behavior: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + } + } +} +/// Prices defined in each available currency option. +/// +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Clone, Debug, Default, serde::Serialize)] +pub struct CreateProductDefaultPriceDataCurrencyOptions { + /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_unit_amount: Option, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// Each element represents a pricing tier. + /// + /// This parameter requires `billing_scheme` to be set to `tiered`. + /// See also the documentation for `billing_scheme`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers: Option>, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option, +} +impl CreateProductDefaultPriceDataCurrencyOptions { + pub fn new() -> Self { + Self::default() + } +} +/// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateProductDefaultPriceDataCurrencyOptionsCustomUnitAmount { + /// Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. + pub enabled: bool, + /// The maximum unit amount the customer can specify for this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option, + /// The minimum unit amount the customer can specify for this item. + /// + /// Must be at least the minimum charge amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option, + /// The starting unit amount which can be updated by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub preset: Option, +} +impl CreateProductDefaultPriceDataCurrencyOptionsCustomUnitAmount { + pub fn new(enabled: bool) -> Self { + Self { + enabled, + maximum: Default::default(), + minimum: Default::default(), + preset: Default::default(), + } + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Each element represents a pricing tier. +/// +/// This parameter requires `billing_scheme` to be set to `tiered`. +/// See also the documentation for `billing_scheme`. +#[derive(Clone, Debug, serde::Serialize)] +pub struct CreateProductDefaultPriceDataCurrencyOptionsTiers { + /// The flat billing amount for an entire tier, regardless of the number of units in the tier. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount: Option, + /// Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. + /// + /// Only one of `flat_amount` and `flat_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount_decimal: Option, + /// The per unit billing amount for each individual unit for which this tier applies. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option, + /// Specifies the upper bound of this tier. + /// + /// The lower bound of a tier is the upper bound of the previous tier adding one. + /// Use `inf` to define a fallback tier. + pub up_to: CreateProductDefaultPriceDataCurrencyOptionsTiersUpTo, +} +impl CreateProductDefaultPriceDataCurrencyOptionsTiers { + pub fn new(up_to: CreateProductDefaultPriceDataCurrencyOptionsTiersUpTo) -> Self { + Self { + flat_amount: Default::default(), + flat_amount_decimal: Default::default(), + unit_amount: Default::default(), + unit_amount_decimal: Default::default(), + up_to, + } + } +} +/// Specifies the upper bound of this tier. +/// +/// The lower bound of a tier is the upper bound of the previous tier adding one. +/// Use `inf` to define a fallback tier. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreateProductDefaultPriceDataCurrencyOptionsTiersUpTo { + Inf, + I64(i64), +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateProductDefaultPriceDataRecurring { + /// Specifies billing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + pub interval: CreateProductDefaultPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl CreateProductDefaultPriceDataRecurring { + pub fn new(interval: CreateProductDefaultPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: Default::default() } + } +} +/// Specifies billing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateProductDefaultPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl CreateProductDefaultPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use CreateProductDefaultPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreateProductDefaultPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateProductDefaultPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for CreateProductDefaultPriceDataRecurringInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateProductDefaultPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateProductDefaultPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateProductDefaultPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateProductDefaultPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateProductDefaultPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateProductDefaultPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateProductDefaultPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateProductDefaultPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreateProductDefaultPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateProductDefaultPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateProductDefaultPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateProductDefaultPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A list of up to 15 features for this product. +/// +/// These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateProductFeatures<'a> { + /// The feature's name. + /// + /// Up to 80 characters long. + pub name: &'a str, +} +impl<'a> CreateProductFeatures<'a> { + pub fn new(name: &'a str) -> Self { + Self { name } + } +} +/// The dimensions of this product for shipping purposes. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateProductPackageDimensions { + /// Height, in inches. + /// + /// Maximum precision is 2 decimal places. + pub height: f64, + /// Length, in inches. + /// + /// Maximum precision is 2 decimal places. + pub length: f64, + /// Weight, in ounces. + /// + /// Maximum precision is 2 decimal places. + pub weight: f64, + /// Width, in inches. + /// + /// Maximum precision is 2 decimal places. + pub width: f64, +} +impl CreateProductPackageDimensions { + pub fn new(height: f64, length: f64, weight: f64, width: f64) -> Self { + Self { height, length, weight, width } + } +} +/// The type of the product. +/// +/// Defaults to `service` if not explicitly specified, enabling use of this product with Subscriptions and Plans. +/// Set this parameter to `good` to use this product with Orders and SKUs. +/// On API versions before `2018-02-05`, this field defaults to `good` for compatibility reasons. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateProductType { + Good, + Service, +} +impl CreateProductType { + pub fn as_str(self) -> &'static str { + use CreateProductType::*; + match self { + Good => "good", + Service => "service", + } + } +} + +impl std::str::FromStr for CreateProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateProductType::*; + match s { + "good" => Ok(Good), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl AsRef for CreateProductType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateProduct<'a> { + /// Creates a new product object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/products", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveProduct<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveProduct<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveProduct<'a> { + /// Retrieves the details of an existing product. + /// + /// Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_types::product::ProductId, + ) -> stripe::Response { + client.get_query(&format!("/products/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateProduct<'a> { + /// Whether the product is available for purchase. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_price: Option<&'a str>, + /// The product's description, meant to be displayable to the customer. + /// + /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A list of up to 15 features for this product. + /// + /// These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option<&'a [UpdateProductFeatures<'a>]>, + /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub images: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The product's name, meant to be displayable to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// The dimensions of this product for shipping purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub package_dimensions: Option, + /// Whether this product is shipped (i.e., physical goods). + #[serde(skip_serializing_if = "Option::is_none")] + pub shippable: Option, + /// An arbitrary string to be displayed on your customer's credit card or bank statement. + /// + /// While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. + /// The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. + /// Non-ASCII characters are automatically stripped. It must contain at least one letter. + /// May only be set if `type=service`. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// A label that represents units of this product. + /// + /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. + /// May only be set if `type=service`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_label: Option<&'a str>, + /// A URL of a publicly-accessible webpage for this product. + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option<&'a str>, +} +impl<'a> UpdateProduct<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A list of up to 15 features for this product. +/// +/// These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateProductFeatures<'a> { + /// The feature's name. + /// + /// Up to 80 characters long. + pub name: &'a str, +} +impl<'a> UpdateProductFeatures<'a> { + pub fn new(name: &'a str) -> Self { + Self { name } + } +} +/// The dimensions of this product for shipping purposes. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateProductPackageDimensions { + /// Height, in inches. + /// + /// Maximum precision is 2 decimal places. + pub height: f64, + /// Length, in inches. + /// + /// Maximum precision is 2 decimal places. + pub length: f64, + /// Weight, in ounces. + /// + /// Maximum precision is 2 decimal places. + pub weight: f64, + /// Width, in inches. + /// + /// Maximum precision is 2 decimal places. + pub width: f64, +} +impl UpdateProductPackageDimensions { + pub fn new(height: f64, length: f64, weight: f64, width: f64) -> Self { + Self { height, length, weight, width } + } +} +impl<'a> UpdateProduct<'a> { + /// Updates the specific product by setting the values of the parameters passed. + /// + /// Any parameters not provided will be left unchanged. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_types::product::ProductId, + ) -> stripe::Response { + client.send_form(&format!("/products/{id}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListProduct<'a> { + /// Only return products that are active or inactive (e.g., pass `false` to list all inactive products). + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Only return products that were created during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Only return products with the given IDs. + /// + /// Cannot be used with [starting_after](https://stripe.com/docs/api#list_products-starting_after) or [ending_before](https://stripe.com/docs/api#list_products-ending_before). + #[serde(skip_serializing_if = "Option::is_none")] + pub ids: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return products that can be shipped (i.e., physical, not digital products). + #[serde(skip_serializing_if = "Option::is_none")] + pub shippable: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return products of this type. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// Only return products with the given url. + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option<&'a str>, +} +impl<'a> ListProduct<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Only return products of this type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListProductType { + Good, + Service, +} +impl ListProductType { + pub fn as_str(self) -> &'static str { + use ListProductType::*; + match self { + Good => "good", + Service => "service", + } + } +} + +impl std::str::FromStr for ListProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListProductType::*; + match s { + "good" => Ok(Good), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl AsRef for ListProductType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListProduct<'a> { + /// Returns a list of your products. + /// + /// The products are returned sorted by creation date, with the most recently created products appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/products", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/products", self) + } +} +impl<'a> stripe::PaginationParams for ListProduct<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteProduct {} +impl DeleteProduct { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteProduct { + /// Delete a product. + /// + /// Deleting a product is only possible if it has no prices associated with it. + /// Additionally, deleting a product with `type=good` is only possible if it has no SKUs associated with it. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_types::product::ProductId, + ) -> stripe::Response { + client.send_form(&format!("/products/{id}"), self, http_types::Method::Delete) + } +} diff --git a/generated/stripe_product/src/product_feature/mod.rs b/generated/stripe_product/src/product_feature/mod.rs new file mode 100644 index 000000000..79c2add8c --- /dev/null +++ b/generated/stripe_product/src/product_feature/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::product_feature::*; \ No newline at end of file diff --git a/generated/stripe_product/src/promotion_code/mod.rs b/generated/stripe_product/src/promotion_code/mod.rs new file mode 100644 index 000000000..ea879839b --- /dev/null +++ b/generated/stripe_product/src/promotion_code/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::promotion_code::*; +#[cfg(feature = "promotion_code")] +mod requests; +#[cfg(feature = "promotion_code")] +pub use requests::*; diff --git a/generated/stripe_product/src/promotion_code/requests.rs b/generated/stripe_product/src/promotion_code/requests.rs new file mode 100644 index 000000000..d7ffa1a86 --- /dev/null +++ b/generated/stripe_product/src/promotion_code/requests.rs @@ -0,0 +1,263 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePromotionCode<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePromotionCode<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePromotionCode<'a> { + /// Retrieves the promotion code with the given ID. + /// + /// In order to retrieve a promotion code by the customer-facing `code` use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired `code`. + pub fn send( + &self, + client: &stripe::Client, + promotion_code: &stripe_types::promotion_code::PromotionCodeId, + ) -> stripe::Response { + client.get_query(&format!("/promotion_codes/{promotion_code}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePromotionCode<'a> { + /// Whether the promotion code is currently active. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// The customer-facing code. + /// + /// Regardless of case, this code must be unique across all active promotion codes for a specific customer. + /// If left blank, we will generate one automatically. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option<&'a str>, + /// The coupon for this promotion code. + pub coupon: &'a str, + /// The customer that this promotion code can be used by. + /// + /// If not set, the promotion code can be used by all customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The timestamp at which this promotion code will expire. + /// + /// If the coupon has specified a `redeems_by`, then this value cannot be after the coupon's `redeems_by`. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// A positive integer specifying the number of times the promotion code can be redeemed. + /// + /// If the coupon has specified a `max_redemptions`, then this value cannot be greater than the coupon's `max_redemptions`. + #[serde(skip_serializing_if = "Option::is_none")] + pub max_redemptions: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Settings that restrict the redemption of the promotion code. + #[serde(skip_serializing_if = "Option::is_none")] + pub restrictions: Option>, +} +impl<'a> CreatePromotionCode<'a> { + pub fn new(coupon: &'a str) -> Self { + Self { + active: Default::default(), + code: Default::default(), + coupon, + customer: Default::default(), + expand: Default::default(), + expires_at: Default::default(), + max_redemptions: Default::default(), + metadata: Default::default(), + restrictions: Default::default(), + } + } +} +/// Settings that restrict the redemption of the promotion code. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePromotionCodeRestrictions<'a> { + /// Promotion codes defined in each available currency option. + /// + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + &'a std::collections::HashMap< + stripe_types::Currency, + CreatePromotionCodeRestrictionsCurrencyOptions, + >, + >, + /// A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_time_transaction: Option, + /// Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_amount: Option, + /// Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_amount_currency: Option, +} +impl<'a> CreatePromotionCodeRestrictions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Promotion codes defined in each available currency option. +/// +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePromotionCodeRestrictionsCurrencyOptions { + /// Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_amount: Option, +} +impl CreatePromotionCodeRestrictionsCurrencyOptions { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreatePromotionCode<'a> { + /// A promotion code points to a coupon. + /// + /// You can optionally restrict the code to a specific customer, redemption limit, and expiration date. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/promotion_codes", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePromotionCode<'a> { + /// Whether the promotion code is currently active. + /// + /// A promotion code can only be reactivated when the coupon is still valid and the promotion code is otherwise redeemable. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Settings that restrict the redemption of the promotion code. + #[serde(skip_serializing_if = "Option::is_none")] + pub restrictions: Option>, +} +impl<'a> UpdatePromotionCode<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings that restrict the redemption of the promotion code. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePromotionCodeRestrictions<'a> { + /// Promotion codes defined in each available currency option. + /// + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + &'a std::collections::HashMap< + stripe_types::Currency, + UpdatePromotionCodeRestrictionsCurrencyOptions, + >, + >, +} +impl<'a> UpdatePromotionCodeRestrictions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Promotion codes defined in each available currency option. +/// +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePromotionCodeRestrictionsCurrencyOptions { + /// Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_amount: Option, +} +impl UpdatePromotionCodeRestrictionsCurrencyOptions { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdatePromotionCode<'a> { + /// Updates the specified promotion code by setting the values of the parameters passed. + /// + /// Most fields are, by design, not editable. + pub fn send( + &self, + client: &stripe::Client, + promotion_code: &stripe_types::promotion_code::PromotionCodeId, + ) -> stripe::Response { + client.send_form( + &format!("/promotion_codes/{promotion_code}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPromotionCode<'a> { + /// Filter promotion codes by whether they are active. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Only return promotion codes that have this case-insensitive code. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option<&'a str>, + /// Only return promotion codes for this coupon. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// A filter on the list, based on the object `created` field. + /// + /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return promotion codes that are restricted to this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListPromotionCode<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPromotionCode<'a> { + /// Returns a list of your promotion codes. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/promotion_codes", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/promotion_codes", self) + } +} +impl<'a> stripe::PaginationParams for ListPromotionCode<'a> {} diff --git a/generated/stripe_product/src/promotion_code_currency_option/mod.rs b/generated/stripe_product/src/promotion_code_currency_option/mod.rs new file mode 100644 index 000000000..eea4e9b67 --- /dev/null +++ b/generated/stripe_product/src/promotion_code_currency_option/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::promotion_code_currency_option::*; \ No newline at end of file diff --git a/generated/stripe_product/src/promotion_codes_resource_restrictions/mod.rs b/generated/stripe_product/src/promotion_codes_resource_restrictions/mod.rs new file mode 100644 index 000000000..7a18fd9a3 --- /dev/null +++ b/generated/stripe_product/src/promotion_codes_resource_restrictions/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::promotion_codes_resource_restrictions::*; \ No newline at end of file diff --git a/generated/stripe_product/src/recurring/mod.rs b/generated/stripe_product/src/recurring/mod.rs new file mode 100644 index 000000000..246c536da --- /dev/null +++ b/generated/stripe_product/src/recurring/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::recurring::*; \ No newline at end of file diff --git a/generated/stripe_product/src/shipping_rate/mod.rs b/generated/stripe_product/src/shipping_rate/mod.rs new file mode 100644 index 000000000..87d9a3fda --- /dev/null +++ b/generated/stripe_product/src/shipping_rate/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::shipping_rate::*; +#[cfg(feature = "shipping_rate")] +mod requests; +#[cfg(feature = "shipping_rate")] +pub use requests::*; diff --git a/generated/stripe_product/src/shipping_rate/requests.rs b/generated/stripe_product/src/shipping_rate/requests.rs new file mode 100644 index 000000000..f80bc652b --- /dev/null +++ b/generated/stripe_product/src/shipping_rate/requests.rs @@ -0,0 +1,713 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListShippingRate<'a> { + /// Only return shipping rates that are active or inactive. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// A filter on the list, based on the object `created` field. + /// + /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return shipping rates for the given currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListShippingRate<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListShippingRate<'a> { + /// Returns a list of your shipping rates. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/shipping_rates", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/shipping_rates", self) + } +} +impl<'a> stripe::PaginationParams for ListShippingRate<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveShippingRate<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveShippingRate<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveShippingRate<'a> { + /// Returns the shipping rate object with the given ID. + pub fn send( + &self, + client: &stripe::Client, + shipping_rate_token: &str, + ) -> stripe::Response { + client.get_query(&format!("/shipping_rates/{shipping_rate_token}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateShippingRate<'a> { + /// The estimated range for how long shipping will take, meant to be displayable to the customer. + /// + /// This will appear on CheckoutSessions. + #[serde(skip_serializing_if = "Option::is_none")] + pub delivery_estimate: Option, + /// The name of the shipping rate, meant to be displayable to the customer. + /// + /// This will appear on CheckoutSessions. + pub display_name: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Describes a fixed amount to charge for shipping. + /// + /// Must be present if type is `fixed_amount`. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amount: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + /// + /// The Shipping tax code is `txcd_92010001`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// The type of calculation to use on the shipping rate. + /// + /// Can only be `fixed_amount` for now. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> CreateShippingRate<'a> { + pub fn new(display_name: &'a str) -> Self { + Self { + delivery_estimate: Default::default(), + display_name, + expand: Default::default(), + fixed_amount: Default::default(), + metadata: Default::default(), + tax_behavior: Default::default(), + tax_code: Default::default(), + type_: Default::default(), + } + } +} +/// The estimated range for how long shipping will take, meant to be displayable to the customer. +/// +/// This will appear on CheckoutSessions. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateShippingRateDeliveryEstimate { + /// The upper bound of the estimated range. + /// + /// If empty, represents no upper bound i.e., infinite. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option, + /// The lower bound of the estimated range. + /// + /// If empty, represents no lower bound. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option, +} +impl CreateShippingRateDeliveryEstimate { + pub fn new() -> Self { + Self::default() + } +} +/// The upper bound of the estimated range. +/// +/// If empty, represents no upper bound i.e., infinite. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateShippingRateDeliveryEstimateMaximum { + /// A unit of time. + pub unit: CreateShippingRateDeliveryEstimateMaximumUnit, + /// Must be greater than 0. + pub value: i64, +} +impl CreateShippingRateDeliveryEstimateMaximum { + pub fn new(unit: CreateShippingRateDeliveryEstimateMaximumUnit, value: i64) -> Self { + Self { unit, value } + } +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateShippingRateDeliveryEstimateMaximumUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl CreateShippingRateDeliveryEstimateMaximumUnit { + pub fn as_str(self) -> &'static str { + use CreateShippingRateDeliveryEstimateMaximumUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr for CreateShippingRateDeliveryEstimateMaximumUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateShippingRateDeliveryEstimateMaximumUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl AsRef for CreateShippingRateDeliveryEstimateMaximumUnit { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateShippingRateDeliveryEstimateMaximumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateShippingRateDeliveryEstimateMaximumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateShippingRateDeliveryEstimateMaximumUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The lower bound of the estimated range. +/// +/// If empty, represents no lower bound. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateShippingRateDeliveryEstimateMinimum { + /// A unit of time. + pub unit: CreateShippingRateDeliveryEstimateMinimumUnit, + /// Must be greater than 0. + pub value: i64, +} +impl CreateShippingRateDeliveryEstimateMinimum { + pub fn new(unit: CreateShippingRateDeliveryEstimateMinimumUnit, value: i64) -> Self { + Self { unit, value } + } +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateShippingRateDeliveryEstimateMinimumUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl CreateShippingRateDeliveryEstimateMinimumUnit { + pub fn as_str(self) -> &'static str { + use CreateShippingRateDeliveryEstimateMinimumUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr for CreateShippingRateDeliveryEstimateMinimumUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateShippingRateDeliveryEstimateMinimumUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl AsRef for CreateShippingRateDeliveryEstimateMinimumUnit { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateShippingRateDeliveryEstimateMinimumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateShippingRateDeliveryEstimateMinimumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateShippingRateDeliveryEstimateMinimumUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Describes a fixed amount to charge for shipping. +/// +/// Must be present if type is `fixed_amount`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateShippingRateFixedAmount<'a> { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Shipping rates defined in each available currency option. + /// + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + &'a std::collections::HashMap< + stripe_types::Currency, + CreateShippingRateFixedAmountCurrencyOptions, + >, + >, +} +impl<'a> CreateShippingRateFixedAmount<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { amount, currency, currency_options: Default::default() } + } +} +/// Shipping rates defined in each available currency option. +/// +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateShippingRateFixedAmountCurrencyOptions { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, +} +impl CreateShippingRateFixedAmountCurrencyOptions { + pub fn new(amount: i64) -> Self { + Self { amount, tax_behavior: Default::default() } + } +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateShippingRateTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateShippingRateTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateShippingRateTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateShippingRateTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateShippingRateTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CreateShippingRateTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateShippingRateTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateShippingRateTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateShippingRateTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of calculation to use on the shipping rate. +/// +/// Can only be `fixed_amount` for now. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateShippingRateType { + FixedAmount, +} +impl CreateShippingRateType { + pub fn as_str(self) -> &'static str { + use CreateShippingRateType::*; + match self { + FixedAmount => "fixed_amount", + } + } +} + +impl std::str::FromStr for CreateShippingRateType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateShippingRateType::*; + match s { + "fixed_amount" => Ok(FixedAmount), + _ => Err(()), + } + } +} +impl AsRef for CreateShippingRateType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateShippingRateType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateShippingRateType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateShippingRateType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateShippingRate<'a> { + /// Creates a new shipping rate object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/shipping_rates", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateShippingRate<'a> { + /// Whether the shipping rate can be used for new purchases. + /// + /// Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Describes a fixed amount to charge for shipping. + /// + /// Must be present if type is `fixed_amount`. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amount: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, +} +impl<'a> UpdateShippingRate<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Describes a fixed amount to charge for shipping. +/// +/// Must be present if type is `fixed_amount`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateShippingRateFixedAmount<'a> { + /// Shipping rates defined in each available currency option. + /// + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + &'a std::collections::HashMap< + stripe_types::Currency, + UpdateShippingRateFixedAmountCurrencyOptions, + >, + >, +} +impl<'a> UpdateShippingRateFixedAmount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Shipping rates defined in each available currency option. +/// +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateShippingRateFixedAmountCurrencyOptions { + /// A non-negative integer in cents representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, +} +impl UpdateShippingRateFixedAmountCurrencyOptions { + pub fn new() -> Self { + Self::default() + } +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateShippingRateTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateShippingRateTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateShippingRateTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateShippingRateTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateShippingRateTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for UpdateShippingRateTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateShippingRateTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateShippingRateTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateShippingRateTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateShippingRate<'a> { + /// Updates an existing shipping rate object. + pub fn send( + &self, + client: &stripe::Client, + shipping_rate_token: &str, + ) -> stripe::Response { + client.send_form( + &format!("/shipping_rates/{shipping_rate_token}"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_product/src/tax_product_resource_tax_code/mod.rs b/generated/stripe_product/src/tax_product_resource_tax_code/mod.rs new file mode 100644 index 000000000..fa41555d5 --- /dev/null +++ b/generated/stripe_product/src/tax_product_resource_tax_code/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::tax_product_resource_tax_code::*; +#[cfg(feature = "tax_product_resource_tax_code")] +mod requests; +#[cfg(feature = "tax_product_resource_tax_code")] +pub use requests::*; diff --git a/generated/stripe_product/src/tax_product_resource_tax_code/requests.rs b/generated/stripe_product/src/tax_product_resource_tax_code/requests.rs new file mode 100644 index 000000000..bb08bf3fd --- /dev/null +++ b/generated/stripe_product/src/tax_product_resource_tax_code/requests.rs @@ -0,0 +1,64 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTaxProductResourceTaxCode<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListTaxProductResourceTaxCode<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTaxProductResourceTaxCode<'a> { + /// A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/tax_codes", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/tax_codes", self) + } +} +impl<'a> stripe::PaginationParams for ListTaxProductResourceTaxCode<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTaxProductResourceTaxCode<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTaxProductResourceTaxCode<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTaxProductResourceTaxCode<'a> { + /// Retrieves the details of an existing tax code. + /// + /// Supply the unique tax code ID and Stripe will return the corresponding tax code information. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_types::tax_product_resource_tax_code::TaxCodeId, + ) -> stripe::Response { + client.get_query(&format!("/tax_codes/{id}"), self) + } +} diff --git a/generated/stripe_product/src/tax_rate/mod.rs b/generated/stripe_product/src/tax_rate/mod.rs new file mode 100644 index 000000000..454714747 --- /dev/null +++ b/generated/stripe_product/src/tax_rate/mod.rs @@ -0,0 +1,5 @@ +pub use stripe_types::tax_rate::*; +#[cfg(feature = "tax_rate")] +mod requests; +#[cfg(feature = "tax_rate")] +pub use requests::*; diff --git a/generated/stripe_product/src/tax_rate/requests.rs b/generated/stripe_product/src/tax_rate/requests.rs new file mode 100644 index 000000000..7ab0c5832 --- /dev/null +++ b/generated/stripe_product/src/tax_rate/requests.rs @@ -0,0 +1,376 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTaxRate<'a> { + /// Optional flag to filter by tax rates that are either active or inactive (archived). + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Optional range for filtering created date. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Optional flag to filter by tax rates that are inclusive (or those that are not inclusive). + #[serde(skip_serializing_if = "Option::is_none")] + pub inclusive: Option, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListTaxRate<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTaxRate<'a> { + /// Returns a list of your tax rates. + /// + /// Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/tax_rates", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/tax_rates", self) + } +} +impl<'a> stripe::PaginationParams for ListTaxRate<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTaxRate<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTaxRate<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTaxRate<'a> { + /// Retrieves a tax rate with the given ID. + pub fn send( + &self, + client: &stripe::Client, + tax_rate: &stripe_types::tax_rate::TaxRateId, + ) -> stripe::Response { + client.get_query(&format!("/tax_rates/{tax_rate}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRate<'a> { + /// Flag determining whether the tax rate is active or inactive (archived). + /// + /// Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// An arbitrary string attached to the tax rate for your internal use only. + /// + /// It will not be visible to your customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The display name of the tax rate, which will be shown to users. + pub display_name: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// This specifies if the tax rate is inclusive or exclusive. + pub inclusive: bool, + /// The jurisdiction for the tax rate. + /// + /// You can use this label field for tax reporting purposes. + /// It also appears on your customer’s invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub jurisdiction: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// This represents the tax rate percent out of 100. + pub percentage: f64, + /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. + /// + /// For example, "NY" for New York, United States. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// The high-level tax type, such as `vat` or `sales_tax`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_type: Option, +} +impl<'a> CreateTaxRate<'a> { + pub fn new(display_name: &'a str, inclusive: bool, percentage: f64) -> Self { + Self { + active: Default::default(), + country: Default::default(), + description: Default::default(), + display_name, + expand: Default::default(), + inclusive, + jurisdiction: Default::default(), + metadata: Default::default(), + percentage, + state: Default::default(), + tax_type: Default::default(), + } + } +} +/// The high-level tax type, such as `vat` or `sales_tax`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateTaxRateTaxType { + AmusementTax, + CommunicationsTax, + Gst, + Hst, + Igst, + Jct, + LeaseTax, + Pst, + Qst, + Rst, + SalesTax, + ServiceTax, + Vat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateTaxRateTaxType { + pub fn as_str(self) -> &'static str { + use CreateTaxRateTaxType::*; + match self { + AmusementTax => "amusement_tax", + CommunicationsTax => "communications_tax", + Gst => "gst", + Hst => "hst", + Igst => "igst", + Jct => "jct", + LeaseTax => "lease_tax", + Pst => "pst", + Qst => "qst", + Rst => "rst", + SalesTax => "sales_tax", + ServiceTax => "service_tax", + Vat => "vat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateTaxRateTaxType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRateTaxType::*; + match s { + "amusement_tax" => Ok(AmusementTax), + "communications_tax" => Ok(CommunicationsTax), + "gst" => Ok(Gst), + "hst" => Ok(Hst), + "igst" => Ok(Igst), + "jct" => Ok(Jct), + "lease_tax" => Ok(LeaseTax), + "pst" => Ok(Pst), + "qst" => Ok(Qst), + "rst" => Ok(Rst), + "sales_tax" => Ok(SalesTax), + "service_tax" => Ok(ServiceTax), + "vat" => Ok(Vat), + _ => Err(()), + } + } +} +impl AsRef for CreateTaxRateTaxType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTaxRateTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRateTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRateTaxType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateTaxRate<'a> { + /// Creates a new tax rate. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/tax_rates", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTaxRate<'a> { + /// Flag determining whether the tax rate is active or inactive (archived). + /// + /// Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// An arbitrary string attached to the tax rate for your internal use only. + /// + /// It will not be visible to your customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The display name of the tax rate, which will be shown to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_name: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The jurisdiction for the tax rate. + /// + /// You can use this label field for tax reporting purposes. + /// It also appears on your customer’s invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub jurisdiction: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. + /// + /// For example, "NY" for New York, United States. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// The high-level tax type, such as `vat` or `sales_tax`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_type: Option, +} +impl<'a> UpdateTaxRate<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The high-level tax type, such as `vat` or `sales_tax`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateTaxRateTaxType { + AmusementTax, + CommunicationsTax, + Gst, + Hst, + Igst, + Jct, + LeaseTax, + Pst, + Qst, + Rst, + SalesTax, + ServiceTax, + Vat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateTaxRateTaxType { + pub fn as_str(self) -> &'static str { + use UpdateTaxRateTaxType::*; + match self { + AmusementTax => "amusement_tax", + CommunicationsTax => "communications_tax", + Gst => "gst", + Hst => "hst", + Igst => "igst", + Jct => "jct", + LeaseTax => "lease_tax", + Pst => "pst", + Qst => "qst", + Rst => "rst", + SalesTax => "sales_tax", + ServiceTax => "service_tax", + Vat => "vat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateTaxRateTaxType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateTaxRateTaxType::*; + match s { + "amusement_tax" => Ok(AmusementTax), + "communications_tax" => Ok(CommunicationsTax), + "gst" => Ok(Gst), + "hst" => Ok(Hst), + "igst" => Ok(Igst), + "jct" => Ok(Jct), + "lease_tax" => Ok(LeaseTax), + "pst" => Ok(Pst), + "qst" => Ok(Qst), + "rst" => Ok(Rst), + "sales_tax" => Ok(SalesTax), + "service_tax" => Ok(ServiceTax), + "vat" => Ok(Vat), + _ => Err(()), + } + } +} +impl AsRef for UpdateTaxRateTaxType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateTaxRateTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateTaxRateTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateTaxRateTaxType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateTaxRate<'a> { + /// Updates an existing tax rate. + pub fn send( + &self, + client: &stripe::Client, + tax_rate: &stripe_types::tax_rate::TaxRateId, + ) -> stripe::Response { + client.send_form(&format!("/tax_rates/{tax_rate}"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_product/src/transform_quantity/mod.rs b/generated/stripe_product/src/transform_quantity/mod.rs new file mode 100644 index 000000000..79ab8d89b --- /dev/null +++ b/generated/stripe_product/src/transform_quantity/mod.rs @@ -0,0 +1 @@ +pub use stripe_types::transform_quantity::*; \ No newline at end of file diff --git a/generated/stripe_terminal/Cargo.toml b/generated/stripe_terminal/Cargo.toml new file mode 100644 index 000000000..cd5d0fa76 --- /dev/null +++ b/generated/stripe_terminal/Cargo.toml @@ -0,0 +1,47 @@ +[package] +name = "stripe_terminal" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + +[dependencies] +serde.workspace = true +http-types.workspace = true +smol_str.workspace = true +serde_json.workspace = true +async-stripe = {path = "../../async-stripe"} + +stripe_types = {path = "../../stripe_types"} + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +terminal_configuration_configuration = [] +terminal_connection_token = [] +terminal_location_location = [] +terminal_reader_reader = [] + +full = ["terminal_configuration_configuration", +"terminal_connection_token", +"terminal_location_location", +"terminal_reader_reader"] + diff --git a/generated/stripe_terminal/src/mod.rs b/generated/stripe_terminal/src/mod.rs new file mode 100644 index 000000000..ebc97652c --- /dev/null +++ b/generated/stripe_terminal/src/mod.rs @@ -0,0 +1,46 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::invalid_html_tags)] +extern crate self as stripe_terminal; +pub mod terminal_configuration_deleted_configuration; +pub use terminal_configuration_deleted_configuration::TerminalConfigurationDeletedConfiguration; +pub mod terminal_location_deleted_location; +pub use terminal_location_deleted_location::TerminalLocationDeletedLocation; +pub mod terminal_reader_deleted_reader; +pub use terminal_reader_deleted_reader::TerminalReaderDeletedReader; +pub mod terminal_configuration_configuration; +pub use terminal_configuration_configuration::TerminalConfigurationConfiguration; +pub mod terminal_connection_token; +pub use terminal_connection_token::TerminalConnectionToken; +pub mod terminal_location_location; +pub use terminal_location_location::TerminalLocationLocation; +pub mod terminal_reader_reader; +pub use terminal_reader_reader::TerminalReaderReader; +pub mod terminal_configuration_configuration_resource_currency_specific_config; +pub use terminal_configuration_configuration_resource_currency_specific_config::TerminalConfigurationConfigurationResourceCurrencySpecificConfig; +pub mod terminal_configuration_configuration_resource_device_type_specific_config; +pub use terminal_configuration_configuration_resource_device_type_specific_config::TerminalConfigurationConfigurationResourceDeviceTypeSpecificConfig; +pub mod terminal_configuration_configuration_resource_offline_config; +pub use terminal_configuration_configuration_resource_offline_config::TerminalConfigurationConfigurationResourceOfflineConfig; +pub mod terminal_configuration_configuration_resource_tipping; +pub use terminal_configuration_configuration_resource_tipping::TerminalConfigurationConfigurationResourceTipping; +pub mod terminal_reader_reader_resource_cart; +pub use terminal_reader_reader_resource_cart::TerminalReaderReaderResourceCart; +pub mod terminal_reader_reader_resource_line_item; +pub use terminal_reader_reader_resource_line_item::TerminalReaderReaderResourceLineItem; +pub mod terminal_reader_reader_resource_process_config; +pub use terminal_reader_reader_resource_process_config::TerminalReaderReaderResourceProcessConfig; +pub mod terminal_reader_reader_resource_process_payment_intent_action; +pub use terminal_reader_reader_resource_process_payment_intent_action::TerminalReaderReaderResourceProcessPaymentIntentAction; +pub mod terminal_reader_reader_resource_process_setup_config; +pub use terminal_reader_reader_resource_process_setup_config::TerminalReaderReaderResourceProcessSetupConfig; +pub mod terminal_reader_reader_resource_process_setup_intent_action; +pub use terminal_reader_reader_resource_process_setup_intent_action::TerminalReaderReaderResourceProcessSetupIntentAction; +pub mod terminal_reader_reader_resource_reader_action; +pub use terminal_reader_reader_resource_reader_action::TerminalReaderReaderResourceReaderAction; +pub mod terminal_reader_reader_resource_refund_payment_action; +pub use terminal_reader_reader_resource_refund_payment_action::TerminalReaderReaderResourceRefundPaymentAction; +pub mod terminal_reader_reader_resource_set_reader_display_action; +pub use terminal_reader_reader_resource_set_reader_display_action::TerminalReaderReaderResourceSetReaderDisplayAction; +pub mod terminal_reader_reader_resource_tipping_config; +pub use terminal_reader_reader_resource_tipping_config::TerminalReaderReaderResourceTippingConfig; diff --git a/generated/stripe_terminal/src/terminal_configuration_configuration/mod.rs b/generated/stripe_terminal/src/terminal_configuration_configuration/mod.rs new file mode 100644 index 000000000..1b0fb093d --- /dev/null +++ b/generated/stripe_terminal/src/terminal_configuration_configuration/mod.rs @@ -0,0 +1,33 @@ +/// A Configurations object represents how features should be configured for terminal readers. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalConfigurationConfiguration { + #[serde(skip_serializing_if = "Option::is_none")] + pub bbpos_wisepos_e: + Option, + /// Unique identifier for the object. + pub id: stripe_terminal::terminal_configuration_configuration::TerminalConfigurationId, + /// Whether this Configuration is the default for your account. + pub is_account_default: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tipping: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub verifone_p400: + Option, +} +impl stripe_types::Object for TerminalConfigurationConfiguration { + type Id = stripe_terminal::terminal_configuration_configuration::TerminalConfigurationId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TerminalConfigurationId, "tmc_"); +#[cfg(feature = "terminal_configuration_configuration")] +mod requests; +#[cfg(feature = "terminal_configuration_configuration")] +pub use requests::*; diff --git a/generated/stripe_terminal/src/terminal_configuration_configuration/requests.rs b/generated/stripe_terminal/src/terminal_configuration_configuration/requests.rs new file mode 100644 index 000000000..ce66269da --- /dev/null +++ b/generated/stripe_terminal/src/terminal_configuration_configuration/requests.rs @@ -0,0 +1,854 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfiguration<'a> { + /// An object containing device type specific settings for BBPOS WisePOS E readers. + #[serde(skip_serializing_if = "Option::is_none")] + pub bbpos_wisepos_e: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Configurations for collecting transactions offline. + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option, + /// Tipping configurations for readers supporting on-reader tips. + #[serde(skip_serializing_if = "Option::is_none")] + pub tipping: Option>, + /// An object containing device type specific settings for Verifone P400 readers. + #[serde(skip_serializing_if = "Option::is_none")] + pub verifone_p400: Option>, +} +impl<'a> CreateTerminalConfigurationConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An object containing device type specific settings for BBPOS WisePOS E readers. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationBbposWiseposE<'a> { + /// A File ID representing an image you would like displayed on the reader. + #[serde(skip_serializing_if = "Option::is_none")] + pub splashscreen: Option<&'a str>, +} +impl<'a> CreateTerminalConfigurationConfigurationBbposWiseposE<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configurations for collecting transactions offline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationOffline { + /// Determines whether to allow transactions to be collected while reader is offline. + /// + /// Defaults to false. + pub enabled: bool, +} +impl CreateTerminalConfigurationConfigurationOffline { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Tipping configurations for readers supporting on-reader tips. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationTipping<'a> { + /// Tipping configuration for AUD. + #[serde(skip_serializing_if = "Option::is_none")] + pub aud: Option>, + /// Tipping configuration for CAD. + #[serde(skip_serializing_if = "Option::is_none")] + pub cad: Option>, + /// Tipping configuration for CHF. + #[serde(skip_serializing_if = "Option::is_none")] + pub chf: Option>, + /// Tipping configuration for CZK. + #[serde(skip_serializing_if = "Option::is_none")] + pub czk: Option>, + /// Tipping configuration for DKK. + #[serde(skip_serializing_if = "Option::is_none")] + pub dkk: Option>, + /// Tipping configuration for EUR. + #[serde(skip_serializing_if = "Option::is_none")] + pub eur: Option>, + /// Tipping configuration for GBP. + #[serde(skip_serializing_if = "Option::is_none")] + pub gbp: Option>, + /// Tipping configuration for HKD. + #[serde(skip_serializing_if = "Option::is_none")] + pub hkd: Option>, + /// Tipping configuration for MYR. + #[serde(skip_serializing_if = "Option::is_none")] + pub myr: Option>, + /// Tipping configuration for NOK. + #[serde(skip_serializing_if = "Option::is_none")] + pub nok: Option>, + /// Tipping configuration for NZD. + #[serde(skip_serializing_if = "Option::is_none")] + pub nzd: Option>, + /// Tipping configuration for SEK. + #[serde(skip_serializing_if = "Option::is_none")] + pub sek: Option>, + /// Tipping configuration for SGD. + #[serde(skip_serializing_if = "Option::is_none")] + pub sgd: Option>, + /// Tipping configuration for USD. + #[serde(skip_serializing_if = "Option::is_none")] + pub usd: Option>, +} +impl<'a> CreateTerminalConfigurationConfigurationTipping<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for AUD. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationTippingAud<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> CreateTerminalConfigurationConfigurationTippingAud<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for CAD. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationTippingCad<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> CreateTerminalConfigurationConfigurationTippingCad<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for CHF. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationTippingChf<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> CreateTerminalConfigurationConfigurationTippingChf<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for CZK. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationTippingCzk<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> CreateTerminalConfigurationConfigurationTippingCzk<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for DKK. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationTippingDkk<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> CreateTerminalConfigurationConfigurationTippingDkk<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for EUR. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationTippingEur<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> CreateTerminalConfigurationConfigurationTippingEur<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for GBP. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationTippingGbp<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> CreateTerminalConfigurationConfigurationTippingGbp<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for HKD. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationTippingHkd<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> CreateTerminalConfigurationConfigurationTippingHkd<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for MYR. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationTippingMyr<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> CreateTerminalConfigurationConfigurationTippingMyr<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for NOK. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationTippingNok<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> CreateTerminalConfigurationConfigurationTippingNok<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for NZD. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationTippingNzd<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> CreateTerminalConfigurationConfigurationTippingNzd<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for SEK. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationTippingSek<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> CreateTerminalConfigurationConfigurationTippingSek<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for SGD. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationTippingSgd<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> CreateTerminalConfigurationConfigurationTippingSgd<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for USD. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationTippingUsd<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> CreateTerminalConfigurationConfigurationTippingUsd<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An object containing device type specific settings for Verifone P400 readers. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationConfigurationVerifoneP400<'a> { + /// A File ID representing an image you would like displayed on the reader. + #[serde(skip_serializing_if = "Option::is_none")] + pub splashscreen: Option<&'a str>, +} +impl<'a> CreateTerminalConfigurationConfigurationVerifoneP400<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateTerminalConfigurationConfiguration<'a> { + /// Creates a new `Configuration` object. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/terminal/configurations", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTerminalConfigurationConfiguration<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// if present, only return the account default or non-default configurations. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_account_default: Option, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListTerminalConfigurationConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTerminalConfigurationConfiguration<'a> { + /// Returns a list of `Configuration` objects. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> + { + client.get_query("/terminal/configurations", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/terminal/configurations", self) + } +} +impl<'a> stripe::PaginationParams for ListTerminalConfigurationConfiguration<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTerminalConfigurationConfiguration<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTerminalConfigurationConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTerminalConfigurationConfiguration<'a> { + /// Retrieves a `Configuration` object. + pub fn send( + &self, + client: &stripe::Client, + configuration: &str, + ) -> stripe::Response { + client.get_query(&format!("/terminal/configurations/{configuration}"), self) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum RetrieveReturned { + #[serde(rename = "terminal.configuration")] + TerminalConfigurationDeletedConfiguration( + stripe_terminal::TerminalConfigurationDeletedConfiguration, + ), +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfiguration<'a> { + /// An object containing device type specific settings for BBPOS WisePOS E readers. + #[serde(skip_serializing_if = "Option::is_none")] + pub bbpos_wisepos_e: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Configurations for collecting transactions offline. + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option, + /// Tipping configurations for readers supporting on-reader tips. + #[serde(skip_serializing_if = "Option::is_none")] + pub tipping: Option>, + /// An object containing device type specific settings for Verifone P400 readers. + #[serde(skip_serializing_if = "Option::is_none")] + pub verifone_p400: Option>, +} +impl<'a> UpdateTerminalConfigurationConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An object containing device type specific settings for BBPOS WisePOS E readers. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationBbposWiseposE<'a> { + /// A File ID representing an image you would like displayed on the reader. + #[serde(skip_serializing_if = "Option::is_none")] + pub splashscreen: Option<&'a str>, +} +impl<'a> UpdateTerminalConfigurationConfigurationBbposWiseposE<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configurations for collecting transactions offline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationOffline { + /// Determines whether to allow transactions to be collected while reader is offline. + /// + /// Defaults to false. + pub enabled: bool, +} +impl UpdateTerminalConfigurationConfigurationOffline { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Tipping configurations for readers supporting on-reader tips. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationTipping<'a> { + /// Tipping configuration for AUD. + #[serde(skip_serializing_if = "Option::is_none")] + pub aud: Option>, + /// Tipping configuration for CAD. + #[serde(skip_serializing_if = "Option::is_none")] + pub cad: Option>, + /// Tipping configuration for CHF. + #[serde(skip_serializing_if = "Option::is_none")] + pub chf: Option>, + /// Tipping configuration for CZK. + #[serde(skip_serializing_if = "Option::is_none")] + pub czk: Option>, + /// Tipping configuration for DKK. + #[serde(skip_serializing_if = "Option::is_none")] + pub dkk: Option>, + /// Tipping configuration for EUR. + #[serde(skip_serializing_if = "Option::is_none")] + pub eur: Option>, + /// Tipping configuration for GBP. + #[serde(skip_serializing_if = "Option::is_none")] + pub gbp: Option>, + /// Tipping configuration for HKD. + #[serde(skip_serializing_if = "Option::is_none")] + pub hkd: Option>, + /// Tipping configuration for MYR. + #[serde(skip_serializing_if = "Option::is_none")] + pub myr: Option>, + /// Tipping configuration for NOK. + #[serde(skip_serializing_if = "Option::is_none")] + pub nok: Option>, + /// Tipping configuration for NZD. + #[serde(skip_serializing_if = "Option::is_none")] + pub nzd: Option>, + /// Tipping configuration for SEK. + #[serde(skip_serializing_if = "Option::is_none")] + pub sek: Option>, + /// Tipping configuration for SGD. + #[serde(skip_serializing_if = "Option::is_none")] + pub sgd: Option>, + /// Tipping configuration for USD. + #[serde(skip_serializing_if = "Option::is_none")] + pub usd: Option>, +} +impl<'a> UpdateTerminalConfigurationConfigurationTipping<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for AUD. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationTippingAud<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> UpdateTerminalConfigurationConfigurationTippingAud<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for CAD. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationTippingCad<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> UpdateTerminalConfigurationConfigurationTippingCad<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for CHF. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationTippingChf<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> UpdateTerminalConfigurationConfigurationTippingChf<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for CZK. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationTippingCzk<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> UpdateTerminalConfigurationConfigurationTippingCzk<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for DKK. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationTippingDkk<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> UpdateTerminalConfigurationConfigurationTippingDkk<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for EUR. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationTippingEur<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> UpdateTerminalConfigurationConfigurationTippingEur<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for GBP. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationTippingGbp<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> UpdateTerminalConfigurationConfigurationTippingGbp<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for HKD. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationTippingHkd<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> UpdateTerminalConfigurationConfigurationTippingHkd<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for MYR. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationTippingMyr<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> UpdateTerminalConfigurationConfigurationTippingMyr<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for NOK. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationTippingNok<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> UpdateTerminalConfigurationConfigurationTippingNok<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for NZD. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationTippingNzd<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> UpdateTerminalConfigurationConfigurationTippingNzd<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for SEK. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationTippingSek<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> UpdateTerminalConfigurationConfigurationTippingSek<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for SGD. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationTippingSgd<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> UpdateTerminalConfigurationConfigurationTippingSgd<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for USD. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationTippingUsd<'a> { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> UpdateTerminalConfigurationConfigurationTippingUsd<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An object containing device type specific settings for Verifone P400 readers. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationConfigurationVerifoneP400<'a> { + /// A File ID representing an image you would like displayed on the reader. + #[serde(skip_serializing_if = "Option::is_none")] + pub splashscreen: Option<&'a str>, +} +impl<'a> UpdateTerminalConfigurationConfigurationVerifoneP400<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateTerminalConfigurationConfiguration<'a> { + /// Updates a new `Configuration` object. + pub fn send( + &self, + client: &stripe::Client, + configuration: &str, + ) -> stripe::Response { + client.send_form( + &format!("/terminal/configurations/{configuration}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum UpdateReturned { + #[serde(rename = "terminal.configuration")] + TerminalConfigurationDeletedConfiguration( + stripe_terminal::TerminalConfigurationDeletedConfiguration, + ), +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteTerminalConfigurationConfiguration {} +impl DeleteTerminalConfigurationConfiguration { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteTerminalConfigurationConfiguration { + /// Deletes a `Configuration` object. + pub fn send( + &self, + client: &stripe::Client, + configuration: &str, + ) -> stripe::Response { + client.send_form( + &format!("/terminal/configurations/{configuration}"), + self, + http_types::Method::Delete, + ) + } +} diff --git a/generated/stripe_terminal/src/terminal_configuration_configuration_resource_currency_specific_config/mod.rs b/generated/stripe_terminal/src/terminal_configuration_configuration_resource_currency_specific_config/mod.rs new file mode 100644 index 000000000..3d9f636a8 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_configuration_configuration_resource_currency_specific_config/mod.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TerminalConfigurationConfigurationResourceCurrencySpecificConfig { + /// Fixed amounts displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option>, + /// Percentages displayed when collecting a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} diff --git a/generated/stripe_terminal/src/terminal_configuration_configuration_resource_device_type_specific_config/mod.rs b/generated/stripe_terminal/src/terminal_configuration_configuration_resource_device_type_specific_config/mod.rs new file mode 100644 index 000000000..b57d74e86 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_configuration_configuration_resource_device_type_specific_config/mod.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TerminalConfigurationConfigurationResourceDeviceTypeSpecificConfig { + /// A File ID representing an image you would like displayed on the reader. + #[serde(skip_serializing_if = "Option::is_none")] + pub splashscreen: Option>, +} diff --git a/generated/stripe_terminal/src/terminal_configuration_configuration_resource_offline_config/mod.rs b/generated/stripe_terminal/src/terminal_configuration_configuration_resource_offline_config/mod.rs new file mode 100644 index 000000000..fb8bcdb65 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_configuration_configuration_resource_offline_config/mod.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TerminalConfigurationConfigurationResourceOfflineConfig { + /// Determines whether to allow transactions to be collected while reader is offline. + /// + /// Defaults to false. + pub enabled: Option, +} diff --git a/generated/stripe_terminal/src/terminal_configuration_configuration_resource_tipping/mod.rs b/generated/stripe_terminal/src/terminal_configuration_configuration_resource_tipping/mod.rs new file mode 100644 index 000000000..92a96136f --- /dev/null +++ b/generated/stripe_terminal/src/terminal_configuration_configuration_resource_tipping/mod.rs @@ -0,0 +1,45 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TerminalConfigurationConfigurationResourceTipping { + #[serde(skip_serializing_if = "Option::is_none")] + pub aud: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cad: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub chf: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub czk: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub dkk: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub eur: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub gbp: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub hkd: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub myr: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub nok: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub nzd: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sek: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sgd: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub usd: + Option, +} diff --git a/generated/stripe_terminal/src/terminal_configuration_deleted_configuration/mod.rs b/generated/stripe_terminal/src/terminal_configuration_deleted_configuration/mod.rs new file mode 100644 index 000000000..faa7a2fca --- /dev/null +++ b/generated/stripe_terminal/src/terminal_configuration_deleted_configuration/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalConfigurationDeletedConfiguration { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_terminal::terminal_configuration_configuration::TerminalConfigurationId, +} +impl stripe_types::Object for TerminalConfigurationDeletedConfiguration { + type Id = stripe_terminal::terminal_configuration_configuration::TerminalConfigurationId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/generated/stripe_terminal/src/terminal_connection_token/mod.rs b/generated/stripe_terminal/src/terminal_connection_token/mod.rs new file mode 100644 index 000000000..066568e5f --- /dev/null +++ b/generated/stripe_terminal/src/terminal_connection_token/mod.rs @@ -0,0 +1,20 @@ +/// A Connection Token is used by the Stripe Terminal SDK to connect to a reader. +/// +/// Related guide: [Fleet management](https://stripe.com/docs/terminal/fleet/locations) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalConnectionToken { + /// The id of the location that this connection token is scoped to. + /// + /// Note that location scoping only applies to internet-connected readers. + /// For more details, see [the docs on scoping connection tokens](https://stripe.com/docs/terminal/fleet/locations#connection-tokens). + #[serde(skip_serializing_if = "Option::is_none")] + pub location: Option, + /// Your application should pass this token to the Stripe Terminal SDK. + pub secret: String, +} +#[cfg(feature = "terminal_connection_token")] +mod requests; +#[cfg(feature = "terminal_connection_token")] +pub use requests::*; diff --git a/generated/stripe_terminal/src/terminal_connection_token/requests.rs b/generated/stripe_terminal/src/terminal_connection_token/requests.rs new file mode 100644 index 000000000..9e79bb23b --- /dev/null +++ b/generated/stripe_terminal/src/terminal_connection_token/requests.rs @@ -0,0 +1,29 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConnectionToken<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The id of the location that this connection token is scoped to. + /// + /// If specified the connection token will only be usable with readers assigned to that location, otherwise the connection token will be usable with all readers. + /// Note that location scoping only applies to internet-connected readers. + /// For more details, see [the docs on scoping connection tokens](https://stripe.com/docs/terminal/fleet/locations#connection-tokens). + #[serde(skip_serializing_if = "Option::is_none")] + pub location: Option<&'a str>, +} +impl<'a> CreateTerminalConnectionToken<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateTerminalConnectionToken<'a> { + /// To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. + /// + /// On your backend, add an endpoint that creates and returns a connection token. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/terminal/connection_tokens", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_terminal/src/terminal_location_deleted_location/mod.rs b/generated/stripe_terminal/src/terminal_location_deleted_location/mod.rs new file mode 100644 index 000000000..2230a49e3 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_location_deleted_location/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalLocationDeletedLocation { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_terminal::terminal_location_location::TerminalLocationId, +} +impl stripe_types::Object for TerminalLocationDeletedLocation { + type Id = stripe_terminal::terminal_location_location::TerminalLocationId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/generated/stripe_terminal/src/terminal_location_location/mod.rs b/generated/stripe_terminal/src/terminal_location_location/mod.rs new file mode 100644 index 000000000..4c699500d --- /dev/null +++ b/generated/stripe_terminal/src/terminal_location_location/mod.rs @@ -0,0 +1,33 @@ +/// A Location represents a grouping of readers. +/// +/// Related guide: [Fleet management](https://stripe.com/docs/terminal/fleet/locations) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalLocationLocation { + pub address: stripe_types::Address, + /// The ID of a configuration that will be used to customize all readers in this location. + #[serde(skip_serializing_if = "Option::is_none")] + pub configuration_overrides: Option, + /// The display name of the location. + pub display_name: String, + /// Unique identifier for the object. + pub id: stripe_terminal::terminal_location_location::TerminalLocationId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, +} +impl stripe_types::Object for TerminalLocationLocation { + type Id = stripe_terminal::terminal_location_location::TerminalLocationId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TerminalLocationId, "tml_"); +#[cfg(feature = "terminal_location_location")] +mod requests; +#[cfg(feature = "terminal_location_location")] +pub use requests::*; diff --git a/generated/stripe_terminal/src/terminal_location_location/requests.rs b/generated/stripe_terminal/src/terminal_location_location/requests.rs new file mode 100644 index 000000000..e4398cf5b --- /dev/null +++ b/generated/stripe_terminal/src/terminal_location_location/requests.rs @@ -0,0 +1,235 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTerminalLocationLocation<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTerminalLocationLocation<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTerminalLocationLocation<'a> { + /// Retrieves a `Location` object. + pub fn send( + &self, + client: &stripe::Client, + location: &str, + ) -> stripe::Response { + client.get_query(&format!("/terminal/locations/{location}"), self) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum RetrieveReturned { + #[serde(rename = "terminal.location")] + TerminalLocationDeletedLocation(stripe_terminal::TerminalLocationDeletedLocation), +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTerminalLocationLocation<'a> { + /// The full address of the location. + pub address: CreateTerminalLocationLocationAddress<'a>, + /// The ID of a configuration that will be used to customize all readers in this location. + #[serde(skip_serializing_if = "Option::is_none")] + pub configuration_overrides: Option<&'a str>, + /// A name for the location. + pub display_name: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> CreateTerminalLocationLocation<'a> { + pub fn new(address: CreateTerminalLocationLocationAddress<'a>, display_name: &'a str) -> Self { + Self { + address, + configuration_overrides: Default::default(), + display_name, + expand: Default::default(), + metadata: Default::default(), + } + } +} +/// The full address of the location. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTerminalLocationLocationAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: &'a str, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateTerminalLocationLocationAddress<'a> { + pub fn new(country: &'a str) -> Self { + Self { + city: Default::default(), + country, + line1: Default::default(), + line2: Default::default(), + postal_code: Default::default(), + state: Default::default(), + } + } +} +impl<'a> CreateTerminalLocationLocation<'a> { + /// Creates a new `Location` object. + /// For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/terminal/locations", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalLocationLocation<'a> { + /// The full address of the location. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The ID of a configuration that will be used to customize all readers in this location. + #[serde(skip_serializing_if = "Option::is_none")] + pub configuration_overrides: Option<&'a str>, + /// A name for the location. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_name: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateTerminalLocationLocation<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The full address of the location. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalLocationLocationAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateTerminalLocationLocationAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateTerminalLocationLocation<'a> { + /// Updates a `Location` object by setting the values of the parameters passed. + /// + /// Any parameters not provided will be left unchanged. + pub fn send( + &self, + client: &stripe::Client, + location: &str, + ) -> stripe::Response { + client.send_form(&format!("/terminal/locations/{location}"), self, http_types::Method::Post) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum UpdateReturned { + #[serde(rename = "terminal.location")] + TerminalLocationDeletedLocation(stripe_terminal::TerminalLocationDeletedLocation), +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTerminalLocationLocation<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListTerminalLocationLocation<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTerminalLocationLocation<'a> { + /// Returns a list of `Location` objects. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/terminal/locations", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/terminal/locations", self) + } +} +impl<'a> stripe::PaginationParams for ListTerminalLocationLocation<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteTerminalLocationLocation {} +impl DeleteTerminalLocationLocation { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteTerminalLocationLocation { + /// Deletes a `Location` object. + pub fn send( + &self, + client: &stripe::Client, + location: &str, + ) -> stripe::Response { + client.send_form( + &format!("/terminal/locations/{location}"), + self, + http_types::Method::Delete, + ) + } +} diff --git a/generated/stripe_terminal/src/terminal_reader_deleted_reader/mod.rs b/generated/stripe_terminal/src/terminal_reader_deleted_reader/mod.rs new file mode 100644 index 000000000..1d4d352fa --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_deleted_reader/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderDeletedReader { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_terminal::terminal_reader_reader::TerminalReaderId, +} +impl stripe_types::Object for TerminalReaderDeletedReader { + type Id = stripe_terminal::terminal_reader_reader::TerminalReaderId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader/mod.rs b/generated/stripe_terminal/src/terminal_reader_reader/mod.rs new file mode 100644 index 000000000..f1008c254 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader/mod.rs @@ -0,0 +1,115 @@ +/// A Reader represents a physical device for accepting payment details. +/// +/// Related guide: [Connecting to a reader](https://stripe.com/docs/terminal/payments/connect-reader) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReader { + /// The most recent action performed by the reader. + pub action: Option, + /// The current software version of the reader. + pub device_sw_version: Option, + /// Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, or `simulated_wisepos_e`. + pub device_type: TerminalReaderReaderDeviceType, + /// Unique identifier for the object. + pub id: stripe_terminal::terminal_reader_reader::TerminalReaderId, + /// The local IP address of the reader. + pub ip_address: Option, + /// Custom label given to the reader for easier identification. + pub label: String, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The location identifier of the reader. + pub location: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Serial number of the reader. + pub serial_number: String, + /// The networking status of the reader. + pub status: Option, +} +/// Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, or `simulated_wisepos_e`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TerminalReaderReaderDeviceType { + BbposChipper2x, + BbposWisepad3, + BbposWiseposE, + SimulatedWiseposE, + StripeM2, + VerifoneP400, +} +impl TerminalReaderReaderDeviceType { + pub fn as_str(self) -> &'static str { + use TerminalReaderReaderDeviceType::*; + match self { + BbposChipper2x => "bbpos_chipper2x", + BbposWisepad3 => "bbpos_wisepad3", + BbposWiseposE => "bbpos_wisepos_e", + SimulatedWiseposE => "simulated_wisepos_e", + StripeM2 => "stripe_m2", + VerifoneP400 => "verifone_P400", + } + } +} + +impl std::str::FromStr for TerminalReaderReaderDeviceType { + type Err = (); + fn from_str(s: &str) -> Result { + use TerminalReaderReaderDeviceType::*; + match s { + "bbpos_chipper2x" => Ok(BbposChipper2x), + "bbpos_wisepad3" => Ok(BbposWisepad3), + "bbpos_wisepos_e" => Ok(BbposWiseposE), + "simulated_wisepos_e" => Ok(SimulatedWiseposE), + "stripe_m2" => Ok(StripeM2), + "verifone_P400" => Ok(VerifoneP400), + _ => Err(()), + } + } +} +impl AsRef for TerminalReaderReaderDeviceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TerminalReaderReaderDeviceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TerminalReaderReaderDeviceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TerminalReaderReaderDeviceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TerminalReaderReaderDeviceType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TerminalReaderReaderDeviceType") + }) + } +} +impl stripe_types::Object for TerminalReaderReader { + type Id = stripe_terminal::terminal_reader_reader::TerminalReaderId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TerminalReaderId, "tmr_"); +#[cfg(feature = "terminal_reader_reader")] +mod requests; +#[cfg(feature = "terminal_reader_reader")] +pub use requests::*; diff --git a/generated/stripe_terminal/src/terminal_reader_reader/requests.rs b/generated/stripe_terminal/src/terminal_reader_reader/requests.rs new file mode 100644 index 000000000..3662438bd --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader/requests.rs @@ -0,0 +1,697 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalReaderReader<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The new label of the reader. + #[serde(skip_serializing_if = "Option::is_none")] + pub label: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateTerminalReaderReader<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateTerminalReaderReader<'a> { + /// Updates a `Reader` object by setting the values of the parameters passed. + /// + /// Any parameters not provided will be left unchanged. + pub fn send(&self, client: &stripe::Client, reader: &str) -> stripe::Response { + client.send_form(&format!("/terminal/readers/{reader}"), self, http_types::Method::Post) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum UpdateReturned { + #[serde(rename = "terminal.reader")] + TerminalReaderDeletedReader(stripe_terminal::TerminalReaderDeletedReader), +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTerminalReaderReader<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTerminalReaderReader<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTerminalReaderReader<'a> { + /// Retrieves a `Reader` object. + pub fn send( + &self, + client: &stripe::Client, + reader: &str, + ) -> stripe::Response { + client.get_query(&format!("/terminal/readers/{reader}"), self) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum RetrieveReturned { + #[serde(rename = "terminal.reader")] + TerminalReaderDeletedReader(stripe_terminal::TerminalReaderDeletedReader), +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTerminalReaderReader<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Custom label given to the reader for easier identification. + /// + /// If no label is specified, the registration code will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub label: Option<&'a str>, + /// The location to assign the reader to. + #[serde(skip_serializing_if = "Option::is_none")] + pub location: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A code generated by the reader used for registering to an account. + pub registration_code: &'a str, +} +impl<'a> CreateTerminalReaderReader<'a> { + pub fn new(registration_code: &'a str) -> Self { + Self { + expand: Default::default(), + label: Default::default(), + location: Default::default(), + metadata: Default::default(), + registration_code, + } + } +} +impl<'a> CreateTerminalReaderReader<'a> { + /// Creates a new `Reader` object. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/terminal/readers", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTerminalReaderReader<'a> { + /// Filters readers by device type. + #[serde(skip_serializing_if = "Option::is_none")] + pub device_type: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A location ID to filter the response list to only readers at the specific location. + #[serde(skip_serializing_if = "Option::is_none")] + pub location: Option<&'a str>, + /// Filters readers by serial number. + #[serde(skip_serializing_if = "Option::is_none")] + pub serial_number: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// A status filter to filter readers to only offline or online readers. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTerminalReaderReader<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Filters readers by device type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTerminalReaderReaderDeviceType { + BbposChipper2x, + BbposWisepad3, + BbposWiseposE, + SimulatedWiseposE, + StripeM2, + VerifoneP400, +} +impl ListTerminalReaderReaderDeviceType { + pub fn as_str(self) -> &'static str { + use ListTerminalReaderReaderDeviceType::*; + match self { + BbposChipper2x => "bbpos_chipper2x", + BbposWisepad3 => "bbpos_wisepad3", + BbposWiseposE => "bbpos_wisepos_e", + SimulatedWiseposE => "simulated_wisepos_e", + StripeM2 => "stripe_m2", + VerifoneP400 => "verifone_P400", + } + } +} + +impl std::str::FromStr for ListTerminalReaderReaderDeviceType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTerminalReaderReaderDeviceType::*; + match s { + "bbpos_chipper2x" => Ok(BbposChipper2x), + "bbpos_wisepad3" => Ok(BbposWisepad3), + "bbpos_wisepos_e" => Ok(BbposWiseposE), + "simulated_wisepos_e" => Ok(SimulatedWiseposE), + "stripe_m2" => Ok(StripeM2), + "verifone_P400" => Ok(VerifoneP400), + _ => Err(()), + } + } +} +impl AsRef for ListTerminalReaderReaderDeviceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListTerminalReaderReaderDeviceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTerminalReaderReaderDeviceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTerminalReaderReaderDeviceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A status filter to filter readers to only offline or online readers. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTerminalReaderReaderStatus { + Offline, + Online, +} +impl ListTerminalReaderReaderStatus { + pub fn as_str(self) -> &'static str { + use ListTerminalReaderReaderStatus::*; + match self { + Offline => "offline", + Online => "online", + } + } +} + +impl std::str::FromStr for ListTerminalReaderReaderStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTerminalReaderReaderStatus::*; + match s { + "offline" => Ok(Offline), + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl AsRef for ListTerminalReaderReaderStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListTerminalReaderReaderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTerminalReaderReaderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTerminalReaderReaderStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListTerminalReaderReader<'a> { + /// Returns a list of `Reader` objects. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/terminal/readers", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/terminal/readers", self) + } +} +impl<'a> stripe::PaginationParams for ListTerminalReaderReader<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteTerminalReaderReader {} +impl DeleteTerminalReaderReader { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteTerminalReaderReader { + /// Deletes a `Reader` object. + pub fn send( + &self, + client: &stripe::Client, + reader: &str, + ) -> stripe::Response { + client.send_form(&format!("/terminal/readers/{reader}"), self, http_types::Method::Delete) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ProcessPaymentIntentTerminalReaderReader<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// PaymentIntent ID. + pub payment_intent: &'a str, + /// Configuration overrides. + #[serde(skip_serializing_if = "Option::is_none")] + pub process_config: Option, +} +impl<'a> ProcessPaymentIntentTerminalReaderReader<'a> { + pub fn new(payment_intent: &'a str) -> Self { + Self { expand: Default::default(), payment_intent, process_config: Default::default() } + } +} +/// Configuration overrides. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ProcessPaymentIntentTerminalReaderReaderProcessConfig { + /// Override showing a tipping selection screen on this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub skip_tipping: Option, + /// Tipping configuration for this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub tipping: Option, +} +impl ProcessPaymentIntentTerminalReaderReaderProcessConfig { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for this transaction. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ProcessPaymentIntentTerminalReaderReaderProcessConfigTipping { + /// Amount used to calculate tip suggestions on tipping selection screen for this transaction. + /// + /// Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_eligible: Option, +} +impl ProcessPaymentIntentTerminalReaderReaderProcessConfigTipping { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ProcessPaymentIntentTerminalReaderReader<'a> { + /// Initiates a payment flow on a Reader. + pub fn send( + &self, + client: &stripe::Client, + reader: &str, + ) -> stripe::Response { + client.send_form( + &format!("/terminal/readers/{reader}/process_payment_intent"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ProcessSetupIntentTerminalReaderReader<'a> { + /// Customer Consent Collected. + pub customer_consent_collected: bool, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Configuration overrides. + #[serde(skip_serializing_if = "Option::is_none")] + pub process_config: Option<&'a serde_json::Value>, + /// SetupIntent ID. + pub setup_intent: &'a str, +} +impl<'a> ProcessSetupIntentTerminalReaderReader<'a> { + pub fn new(customer_consent_collected: bool, setup_intent: &'a str) -> Self { + Self { + customer_consent_collected, + expand: Default::default(), + process_config: Default::default(), + setup_intent, + } + } +} +impl<'a> ProcessSetupIntentTerminalReaderReader<'a> { + /// Initiates a setup intent flow on a Reader. + pub fn send( + &self, + client: &stripe::Client, + reader: &str, + ) -> stripe::Response { + client.send_form( + &format!("/terminal/readers/{reader}/process_setup_intent"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelActionTerminalReaderReader<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelActionTerminalReaderReader<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelActionTerminalReaderReader<'a> { + /// Cancels the current reader action. + pub fn send( + &self, + client: &stripe::Client, + reader: &str, + ) -> stripe::Response { + client.send_form( + &format!("/terminal/readers/{reader}/cancel_action"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SetReaderDisplayTerminalReaderReader<'a> { + /// Cart. + #[serde(skip_serializing_if = "Option::is_none")] + pub cart: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Type. + #[serde(rename = "type")] + pub type_: SetReaderDisplayTerminalReaderReaderType, +} +impl<'a> SetReaderDisplayTerminalReaderReader<'a> { + pub fn new(type_: SetReaderDisplayTerminalReaderReaderType) -> Self { + Self { cart: Default::default(), expand: Default::default(), type_ } + } +} +/// Cart. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SetReaderDisplayTerminalReaderReaderCart<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Array of line items that were purchased. + pub line_items: &'a [SetReaderDisplayTerminalReaderReaderCartLineItems<'a>], + /// The amount of tax in cents. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax: Option, + /// Total balance of cart due in cents. + pub total: i64, +} +impl<'a> SetReaderDisplayTerminalReaderReaderCart<'a> { + pub fn new( + currency: stripe_types::Currency, + line_items: &'a [SetReaderDisplayTerminalReaderReaderCartLineItems<'a>], + total: i64, + ) -> Self { + Self { currency, line_items, tax: Default::default(), total } + } +} +/// Array of line items that were purchased. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SetReaderDisplayTerminalReaderReaderCartLineItems<'a> { + /// The price of the item in cents. + pub amount: i64, + /// The description or name of the item. + pub description: &'a str, + /// The quantity of the line item being purchased. + pub quantity: u64, +} +impl<'a> SetReaderDisplayTerminalReaderReaderCartLineItems<'a> { + pub fn new(amount: i64, description: &'a str, quantity: u64) -> Self { + Self { amount, description, quantity } + } +} +/// Type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetReaderDisplayTerminalReaderReaderType { + Cart, +} +impl SetReaderDisplayTerminalReaderReaderType { + pub fn as_str(self) -> &'static str { + use SetReaderDisplayTerminalReaderReaderType::*; + match self { + Cart => "cart", + } + } +} + +impl std::str::FromStr for SetReaderDisplayTerminalReaderReaderType { + type Err = (); + fn from_str(s: &str) -> Result { + use SetReaderDisplayTerminalReaderReaderType::*; + match s { + "cart" => Ok(Cart), + _ => Err(()), + } + } +} +impl AsRef for SetReaderDisplayTerminalReaderReaderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetReaderDisplayTerminalReaderReaderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetReaderDisplayTerminalReaderReaderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetReaderDisplayTerminalReaderReaderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> SetReaderDisplayTerminalReaderReader<'a> { + /// Sets reader display to show cart details. + pub fn send( + &self, + client: &stripe::Client, + reader: &str, + ) -> stripe::Response { + client.send_form( + &format!("/terminal/readers/{reader}/set_reader_display"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RefundPaymentTerminalReaderReader<'a> { + /// A positive integer in __cents__ representing how much of this charge to refund. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// ID of the Charge to refund. + #[serde(skip_serializing_if = "Option::is_none")] + pub charge: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// ID of the PaymentIntent to refund. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option<&'a str>, + /// Boolean indicating whether the application fee should be refunded when refunding this charge. + /// + /// If a full charge refund is given, the full application fee will be refunded. + /// Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. + /// An application fee can be refunded only by the application that created the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_application_fee: Option, + /// Boolean indicating whether the transfer should be reversed when refunding this charge. + /// + /// The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). + /// A transfer can be reversed only by the application that created the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_transfer: Option, +} +impl<'a> RefundPaymentTerminalReaderReader<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RefundPaymentTerminalReaderReader<'a> { + /// Initiates a refund on a Reader. + pub fn send( + &self, + client: &stripe::Client, + reader: &str, + ) -> stripe::Response { + client.send_form( + &format!("/terminal/readers/{reader}/refund_payment"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PresentPaymentMethodTerminalReaderReader<'a> { + /// Simulated on-reader tip amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tip: Option, + /// Simulated data for the card_present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Simulated data for the interac_present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option>, + /// Simulated payment type. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> PresentPaymentMethodTerminalReaderReader<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Simulated data for the card_present payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PresentPaymentMethodTerminalReaderReaderCardPresent<'a> { + /// The card number, as a string without any separators. + #[serde(skip_serializing_if = "Option::is_none")] + pub number: Option<&'a str>, +} +impl<'a> PresentPaymentMethodTerminalReaderReaderCardPresent<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Simulated data for the interac_present payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PresentPaymentMethodTerminalReaderReaderInteracPresent<'a> { + /// Card Number. + #[serde(skip_serializing_if = "Option::is_none")] + pub number: Option<&'a str>, +} +impl<'a> PresentPaymentMethodTerminalReaderReaderInteracPresent<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Simulated payment type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PresentPaymentMethodTerminalReaderReaderType { + CardPresent, + InteracPresent, +} +impl PresentPaymentMethodTerminalReaderReaderType { + pub fn as_str(self) -> &'static str { + use PresentPaymentMethodTerminalReaderReaderType::*; + match self { + CardPresent => "card_present", + InteracPresent => "interac_present", + } + } +} + +impl std::str::FromStr for PresentPaymentMethodTerminalReaderReaderType { + type Err = (); + fn from_str(s: &str) -> Result { + use PresentPaymentMethodTerminalReaderReaderType::*; + match s { + "card_present" => Ok(CardPresent), + "interac_present" => Ok(InteracPresent), + _ => Err(()), + } + } +} +impl AsRef for PresentPaymentMethodTerminalReaderReaderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PresentPaymentMethodTerminalReaderReaderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PresentPaymentMethodTerminalReaderReaderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PresentPaymentMethodTerminalReaderReaderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> PresentPaymentMethodTerminalReaderReader<'a> { + /// Presents a payment method on a simulated reader. + /// + /// Can be used to simulate accepting a payment, saving a card or refunding a transaction. + pub fn send( + &self, + client: &stripe::Client, + reader: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/terminal/readers/{reader}/present_payment_method"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_cart/mod.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_cart/mod.rs new file mode 100644 index 000000000..b531a7b07 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_cart/mod.rs @@ -0,0 +1,18 @@ +/// Represents a cart to be displayed on the reader. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceCart { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// List of line items in the cart. + pub line_items: Vec, + /// Tax amount for the entire cart. + /// + /// A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub tax: Option, + /// Total amount for the entire cart, including tax. + /// + /// A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub total: i64, +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_line_item/mod.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_line_item/mod.rs new file mode 100644 index 000000000..810c24afa --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_line_item/mod.rs @@ -0,0 +1,12 @@ +/// Represents a line item to be displayed on the reader. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceLineItem { + /// The amount of the line item. + /// + /// A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Description of the line item. + pub description: String, + /// The quantity of the line item. + pub quantity: u64, +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_process_config/mod.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_process_config/mod.rs new file mode 100644 index 000000000..ed02380ca --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_process_config/mod.rs @@ -0,0 +1,9 @@ +/// Represents a per-transaction override of a reader configuration. +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceProcessConfig { + /// Override showing a tipping selection screen on this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub skip_tipping: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tipping: Option, +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_process_payment_intent_action/mod.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_process_payment_intent_action/mod.rs new file mode 100644 index 000000000..638bb64ad --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_process_payment_intent_action/mod.rs @@ -0,0 +1,8 @@ +/// Represents a reader action to process a payment intent. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceProcessPaymentIntentAction { + /// Most recent PaymentIntent processed by the reader. + pub payment_intent: stripe_types::Expandable, + #[serde(skip_serializing_if = "Option::is_none")] + pub process_config: Option, +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_process_setup_config/mod.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_process_setup_config/mod.rs new file mode 100644 index 000000000..65a98e262 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_process_setup_config/mod.rs @@ -0,0 +1,3 @@ +/// Represents a per-setup override of a reader configuration. +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceProcessSetupConfig {} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_process_setup_intent_action/mod.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_process_setup_intent_action/mod.rs new file mode 100644 index 000000000..b268b6b15 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_process_setup_intent_action/mod.rs @@ -0,0 +1,13 @@ +/// Represents a reader action to process a setup intent. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceProcessSetupIntentAction { + /// ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. + /// + /// Only present if it was possible to generate a card PaymentMethod. + #[serde(skip_serializing_if = "Option::is_none")] + pub generated_card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub process_config: Option, + /// Most recent SetupIntent processed by the reader. + pub setup_intent: stripe_types::Expandable, +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_reader_action/mod.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_reader_action/mod.rs new file mode 100644 index 000000000..52665a2d0 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_reader_action/mod.rs @@ -0,0 +1,157 @@ +/// Represents an action performed by the reader. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceReaderAction { + /// Failure code, only set if status is `failed`. + pub failure_code: Option, + /// Detailed failure message, only set if status is `failed`. + pub failure_message: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub process_payment_intent: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub process_setup_intent: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_payment: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub set_reader_display: + Option, + /// Status of the action performed by the reader. + pub status: TerminalReaderReaderResourceReaderActionStatus, + /// Type of action performed by the reader. + #[serde(rename = "type")] + pub type_: TerminalReaderReaderResourceReaderActionType, +} +/// Status of the action performed by the reader. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TerminalReaderReaderResourceReaderActionStatus { + Failed, + InProgress, + Succeeded, +} +impl TerminalReaderReaderResourceReaderActionStatus { + pub fn as_str(self) -> &'static str { + use TerminalReaderReaderResourceReaderActionStatus::*; + match self { + Failed => "failed", + InProgress => "in_progress", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for TerminalReaderReaderResourceReaderActionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TerminalReaderReaderResourceReaderActionStatus::*; + match s { + "failed" => Ok(Failed), + "in_progress" => Ok(InProgress), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl AsRef for TerminalReaderReaderResourceReaderActionStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TerminalReaderReaderResourceReaderActionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TerminalReaderReaderResourceReaderActionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TerminalReaderReaderResourceReaderActionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TerminalReaderReaderResourceReaderActionStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TerminalReaderReaderResourceReaderActionStatus", + ) + }) + } +} +/// Type of action performed by the reader. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TerminalReaderReaderResourceReaderActionType { + ProcessPaymentIntent, + ProcessSetupIntent, + RefundPayment, + SetReaderDisplay, +} +impl TerminalReaderReaderResourceReaderActionType { + pub fn as_str(self) -> &'static str { + use TerminalReaderReaderResourceReaderActionType::*; + match self { + ProcessPaymentIntent => "process_payment_intent", + ProcessSetupIntent => "process_setup_intent", + RefundPayment => "refund_payment", + SetReaderDisplay => "set_reader_display", + } + } +} + +impl std::str::FromStr for TerminalReaderReaderResourceReaderActionType { + type Err = (); + fn from_str(s: &str) -> Result { + use TerminalReaderReaderResourceReaderActionType::*; + match s { + "process_payment_intent" => Ok(ProcessPaymentIntent), + "process_setup_intent" => Ok(ProcessSetupIntent), + "refund_payment" => Ok(RefundPayment), + "set_reader_display" => Ok(SetReaderDisplay), + _ => Err(()), + } + } +} +impl AsRef for TerminalReaderReaderResourceReaderActionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TerminalReaderReaderResourceReaderActionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TerminalReaderReaderResourceReaderActionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TerminalReaderReaderResourceReaderActionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TerminalReaderReaderResourceReaderActionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TerminalReaderReaderResourceReaderActionType", + ) + }) + } +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_refund_payment_action/mod.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_refund_payment_action/mod.rs new file mode 100644 index 000000000..7669af770 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_refund_payment_action/mod.rs @@ -0,0 +1,102 @@ +/// Represents a reader action to refund a payment. +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceRefundPaymentAction { + /// The amount being refunded. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Charge that is being refunded. + #[serde(skip_serializing_if = "Option::is_none")] + pub charge: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option>, + /// Payment intent that is being refunded. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option>, + /// The reason for the refund. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// Unique identifier for the refund object. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund: Option>, + /// Boolean indicating whether the application fee should be refunded when refunding this charge. + /// + /// If a full charge refund is given, the full application fee will be refunded. + /// Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. + /// An application fee can be refunded only by the application that created the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_application_fee: Option, + /// Boolean indicating whether the transfer should be reversed when refunding this charge. + /// + /// The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). + /// A transfer can be reversed only by the application that created the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_transfer: Option, +} +/// The reason for the refund. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TerminalReaderReaderResourceRefundPaymentActionReason { + Duplicate, + Fraudulent, + RequestedByCustomer, +} +impl TerminalReaderReaderResourceRefundPaymentActionReason { + pub fn as_str(self) -> &'static str { + use TerminalReaderReaderResourceRefundPaymentActionReason::*; + match self { + Duplicate => "duplicate", + Fraudulent => "fraudulent", + RequestedByCustomer => "requested_by_customer", + } + } +} + +impl std::str::FromStr for TerminalReaderReaderResourceRefundPaymentActionReason { + type Err = (); + fn from_str(s: &str) -> Result { + use TerminalReaderReaderResourceRefundPaymentActionReason::*; + match s { + "duplicate" => Ok(Duplicate), + "fraudulent" => Ok(Fraudulent), + "requested_by_customer" => Ok(RequestedByCustomer), + _ => Err(()), + } + } +} +impl AsRef for TerminalReaderReaderResourceRefundPaymentActionReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TerminalReaderReaderResourceRefundPaymentActionReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TerminalReaderReaderResourceRefundPaymentActionReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TerminalReaderReaderResourceRefundPaymentActionReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TerminalReaderReaderResourceRefundPaymentActionReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TerminalReaderReaderResourceRefundPaymentActionReason", + ) + }) + } +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_set_reader_display_action/mod.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_set_reader_display_action/mod.rs new file mode 100644 index 000000000..be38af6bb --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_set_reader_display_action/mod.rs @@ -0,0 +1,68 @@ +/// Represents a reader action to set the reader display. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceSetReaderDisplayAction { + /// Cart object to be displayed by the reader. + pub cart: Option, + /// Type of information to be displayed by the reader. + #[serde(rename = "type")] + pub type_: TerminalReaderReaderResourceSetReaderDisplayActionType, +} +/// Type of information to be displayed by the reader. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TerminalReaderReaderResourceSetReaderDisplayActionType { + Cart, +} +impl TerminalReaderReaderResourceSetReaderDisplayActionType { + pub fn as_str(self) -> &'static str { + use TerminalReaderReaderResourceSetReaderDisplayActionType::*; + match self { + Cart => "cart", + } + } +} + +impl std::str::FromStr for TerminalReaderReaderResourceSetReaderDisplayActionType { + type Err = (); + fn from_str(s: &str) -> Result { + use TerminalReaderReaderResourceSetReaderDisplayActionType::*; + match s { + "cart" => Ok(Cart), + _ => Err(()), + } + } +} +impl AsRef for TerminalReaderReaderResourceSetReaderDisplayActionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TerminalReaderReaderResourceSetReaderDisplayActionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TerminalReaderReaderResourceSetReaderDisplayActionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TerminalReaderReaderResourceSetReaderDisplayActionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TerminalReaderReaderResourceSetReaderDisplayActionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TerminalReaderReaderResourceSetReaderDisplayActionType", + ) + }) + } +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_tipping_config/mod.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_tipping_config/mod.rs new file mode 100644 index 000000000..4200acca8 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_tipping_config/mod.rs @@ -0,0 +1,9 @@ +/// Represents a per-transaction tipping configuration. +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceTippingConfig { + /// Amount used to calculate tip suggestions on tipping selection screen for this transaction. + /// + /// Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_eligible: Option, +} diff --git a/generated/stripe_treasury/.rustfmt.toml b/generated/stripe_treasury/.rustfmt.toml new file mode 100644 index 000000000..8338ff044 --- /dev/null +++ b/generated/stripe_treasury/.rustfmt.toml @@ -0,0 +1,7 @@ + +use_small_heuristics = "Max" +reorder_imports = true +group_imports = "StdExternalCrate" +error_on_line_overflow = true +max_width = 260 + \ No newline at end of file diff --git a/generated/stripe_treasury/Cargo.toml b/generated/stripe_treasury/Cargo.toml new file mode 100644 index 000000000..f270468cb --- /dev/null +++ b/generated/stripe_treasury/Cargo.toml @@ -0,0 +1,59 @@ +[package] +name = "stripe_treasury" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + +[dependencies] +serde.workspace = true +http-types.workspace = true +smol_str.workspace = true +serde_json.workspace = true +async-stripe = {path = "../../async-stripe"} + +stripe_types = {path = "../../stripe_types"} + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +treasury_financial_accounts_resource_financial_account = [] +treasury_inbound_transfers_resource_inbound_transfer = [] +treasury_outbound_payments_resource_outbound_payment = [] +treasury_outbound_transfers_resource_outbound_transfer = [] +treasury_received_credits_resource_credit_reversal = [] +treasury_received_credits_resource_received_credit = [] +treasury_received_debits_resource_debit_reversal = [] +treasury_received_debits_resource_received_debit = [] +treasury_transactions_resource_transaction = [] +treasury_transactions_resource_transaction_entry = [] + +full = ["treasury_financial_accounts_resource_financial_account", +"treasury_inbound_transfers_resource_inbound_transfer", +"treasury_outbound_payments_resource_outbound_payment", +"treasury_outbound_transfers_resource_outbound_transfer", +"treasury_received_credits_resource_credit_reversal", +"treasury_received_credits_resource_received_credit", +"treasury_received_debits_resource_debit_reversal", +"treasury_received_debits_resource_received_debit", +"treasury_transactions_resource_transaction", +"treasury_transactions_resource_transaction_entry"] + diff --git a/generated/stripe_treasury/src/inbound_transfers/mod.rs b/generated/stripe_treasury/src/inbound_transfers/mod.rs new file mode 100644 index 000000000..54a3088e4 --- /dev/null +++ b/generated/stripe_treasury/src/inbound_transfers/mod.rs @@ -0,0 +1,65 @@ +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InboundTransfers { + pub billing_details: stripe_treasury::TreasurySharedResourceBillingDetails, + /// The type of the payment method used in the InboundTransfer. + #[serde(rename = "type")] + pub type_: InboundTransfersType, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} +/// The type of the payment method used in the InboundTransfer. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InboundTransfersType { + UsBankAccount, +} +impl InboundTransfersType { + pub fn as_str(self) -> &'static str { + use InboundTransfersType::*; + match self { + UsBankAccount => "us_bank_account", + } + } +} + +impl std::str::FromStr for InboundTransfersType { + type Err = (); + fn from_str(s: &str) -> Result { + use InboundTransfersType::*; + match s { + "us_bank_account" => Ok(UsBankAccount), + _ => Err(()), + } + } +} +impl AsRef for InboundTransfersType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InboundTransfersType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InboundTransfersType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InboundTransfersType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InboundTransfersType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for InboundTransfersType")) + } +} diff --git a/generated/stripe_treasury/src/inbound_transfers_payment_method_details_us_bank_account/mod.rs b/generated/stripe_treasury/src/inbound_transfers_payment_method_details_us_bank_account/mod.rs new file mode 100644 index 000000000..189d0f689 --- /dev/null +++ b/generated/stripe_treasury/src/inbound_transfers_payment_method_details_us_bank_account/mod.rs @@ -0,0 +1,194 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InboundTransfersPaymentMethodDetailsUsBankAccount { + /// Account holder type: individual or company. + pub account_holder_type: Option, + /// Account type: checkings or savings. + /// + /// Defaults to checking if omitted. + pub account_type: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Uniquely identifies this particular bank account. + /// + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// The US bank account network used to debit funds. + pub network: InboundTransfersPaymentMethodDetailsUsBankAccountNetwork, + /// Routing number of the bank account. + pub routing_number: Option, +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + Company, + Individual, +} +impl InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType")) + } +} +/// Account type: checkings or savings. +/// +/// Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + Checking, + Savings, +} +impl InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use InboundTransfersPaymentMethodDetailsUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use InboundTransfersPaymentMethodDetailsUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl AsRef for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType")) + } +} +/// The US bank account network used to debit funds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + Ach, +} +impl InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + pub fn as_str(self) -> &'static str { + use InboundTransfersPaymentMethodDetailsUsBankAccountNetwork::*; + match self { + Ach => "ach", + } + } +} + +impl std::str::FromStr for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use InboundTransfersPaymentMethodDetailsUsBankAccountNetwork::*; + match s { + "ach" => Ok(Ach), + _ => Err(()), + } + } +} +impl AsRef for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork")) + } +} diff --git a/generated/stripe_treasury/src/mod.rs b/generated/stripe_treasury/src/mod.rs new file mode 100644 index 000000000..8d12ac378 --- /dev/null +++ b/generated/stripe_treasury/src/mod.rs @@ -0,0 +1,114 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::invalid_html_tags)] +extern crate self as stripe_treasury; +pub mod inbound_transfers; +pub use inbound_transfers::InboundTransfers; +pub mod inbound_transfers_payment_method_details_us_bank_account; +pub use inbound_transfers_payment_method_details_us_bank_account::InboundTransfersPaymentMethodDetailsUsBankAccount; +pub mod outbound_payments_payment_method_details; +pub use outbound_payments_payment_method_details::OutboundPaymentsPaymentMethodDetails; +pub mod outbound_payments_payment_method_details_financial_account; +pub use outbound_payments_payment_method_details_financial_account::OutboundPaymentsPaymentMethodDetailsFinancialAccount; +pub mod outbound_payments_payment_method_details_us_bank_account; +pub use outbound_payments_payment_method_details_us_bank_account::OutboundPaymentsPaymentMethodDetailsUsBankAccount; +pub mod outbound_transfers_payment_method_details; +pub use outbound_transfers_payment_method_details::OutboundTransfersPaymentMethodDetails; +pub mod outbound_transfers_payment_method_details_us_bank_account; +pub use outbound_transfers_payment_method_details_us_bank_account::OutboundTransfersPaymentMethodDetailsUsBankAccount; +pub mod treasury_transactions_resource_flow_details; +pub use treasury_transactions_resource_flow_details::TreasuryTransactionsResourceFlowDetails; +pub mod received_payment_method_details_financial_account; +pub use received_payment_method_details_financial_account::ReceivedPaymentMethodDetailsFinancialAccount; +pub mod treasury_transactions_resource_balance_impact; +pub use treasury_transactions_resource_balance_impact::TreasuryTransactionsResourceBalanceImpact; +pub mod treasury_transactions_resource_abstract_transaction_resource_status_transitions; +pub use treasury_transactions_resource_abstract_transaction_resource_status_transitions::TreasuryTransactionsResourceAbstractTransactionResourceStatusTransitions; +pub mod treasury_shared_resource_initiating_payment_method_details_us_bank_account; +pub use treasury_shared_resource_initiating_payment_method_details_us_bank_account::TreasurySharedResourceInitiatingPaymentMethodDetailsUsBankAccount; +pub mod treasury_received_credits_resource_credit_reversal; +pub use treasury_received_credits_resource_credit_reversal::TreasuryReceivedCreditsResourceCreditReversal; +pub mod treasury_received_debits_resource_debit_reversal; +pub use treasury_received_debits_resource_debit_reversal::TreasuryReceivedDebitsResourceDebitReversal; +pub mod treasury_financial_accounts_resource_financial_account; +pub use treasury_financial_accounts_resource_financial_account::TreasuryFinancialAccountsResourceFinancialAccount; +pub mod treasury_financial_accounts_resource_financial_account_features; +pub use treasury_financial_accounts_resource_financial_account_features::TreasuryFinancialAccountsResourceFinancialAccountFeatures; +pub mod treasury_inbound_transfers_resource_inbound_transfer; +pub use treasury_inbound_transfers_resource_inbound_transfer::TreasuryInboundTransfersResourceInboundTransfer; +pub mod treasury_outbound_payments_resource_outbound_payment; +pub use treasury_outbound_payments_resource_outbound_payment::TreasuryOutboundPaymentsResourceOutboundPayment; +pub mod treasury_outbound_transfers_resource_outbound_transfer; +pub use treasury_outbound_transfers_resource_outbound_transfer::TreasuryOutboundTransfersResourceOutboundTransfer; +pub mod treasury_received_credits_resource_received_credit; +pub use treasury_received_credits_resource_received_credit::TreasuryReceivedCreditsResourceReceivedCredit; +pub mod treasury_received_debits_resource_received_debit; +pub use treasury_received_debits_resource_received_debit::TreasuryReceivedDebitsResourceReceivedDebit; +pub mod treasury_transactions_resource_transaction; +pub use treasury_transactions_resource_transaction::TreasuryTransactionsResourceTransaction; +pub mod treasury_transactions_resource_transaction_entry; +pub use treasury_transactions_resource_transaction_entry::TreasuryTransactionsResourceTransactionEntry; +pub mod treasury_financial_accounts_resource_aba_record; +pub use treasury_financial_accounts_resource_aba_record::TreasuryFinancialAccountsResourceAbaRecord; +pub mod treasury_financial_accounts_resource_aba_toggle_settings; +pub use treasury_financial_accounts_resource_aba_toggle_settings::TreasuryFinancialAccountsResourceAbaToggleSettings; +pub mod treasury_financial_accounts_resource_ach_toggle_settings; +pub use treasury_financial_accounts_resource_ach_toggle_settings::TreasuryFinancialAccountsResourceAchToggleSettings; +pub mod treasury_financial_accounts_resource_balance; +pub use treasury_financial_accounts_resource_balance::TreasuryFinancialAccountsResourceBalance; +pub mod treasury_financial_accounts_resource_closed_status_details; +pub use treasury_financial_accounts_resource_closed_status_details::TreasuryFinancialAccountsResourceClosedStatusDetails; +pub mod treasury_financial_accounts_resource_financial_address; +pub use treasury_financial_accounts_resource_financial_address::TreasuryFinancialAccountsResourceFinancialAddress; +pub mod treasury_financial_accounts_resource_financial_addresses_features; +pub use treasury_financial_accounts_resource_financial_addresses_features::TreasuryFinancialAccountsResourceFinancialAddressesFeatures; +pub mod treasury_financial_accounts_resource_inbound_transfers; +pub use treasury_financial_accounts_resource_inbound_transfers::TreasuryFinancialAccountsResourceInboundTransfers; +pub mod treasury_financial_accounts_resource_outbound_payments; +pub use treasury_financial_accounts_resource_outbound_payments::TreasuryFinancialAccountsResourceOutboundPayments; +pub mod treasury_financial_accounts_resource_outbound_transfers; +pub use treasury_financial_accounts_resource_outbound_transfers::TreasuryFinancialAccountsResourceOutboundTransfers; +pub mod treasury_financial_accounts_resource_platform_restrictions; +pub use treasury_financial_accounts_resource_platform_restrictions::TreasuryFinancialAccountsResourcePlatformRestrictions; +pub mod treasury_financial_accounts_resource_status_details; +pub use treasury_financial_accounts_resource_status_details::TreasuryFinancialAccountsResourceStatusDetails; +pub mod treasury_financial_accounts_resource_toggle_settings; +pub use treasury_financial_accounts_resource_toggle_settings::TreasuryFinancialAccountsResourceToggleSettings; +pub mod treasury_financial_accounts_resource_toggles_setting_status_details; +pub use treasury_financial_accounts_resource_toggles_setting_status_details::TreasuryFinancialAccountsResourceTogglesSettingStatusDetails; +pub mod treasury_inbound_transfers_resource_failure_details; +pub use treasury_inbound_transfers_resource_failure_details::TreasuryInboundTransfersResourceFailureDetails; +pub mod treasury_inbound_transfers_resource_inbound_transfer_resource_linked_flows; +pub use treasury_inbound_transfers_resource_inbound_transfer_resource_linked_flows::TreasuryInboundTransfersResourceInboundTransferResourceLinkedFlows; +pub mod treasury_inbound_transfers_resource_inbound_transfer_resource_status_transitions; +pub use treasury_inbound_transfers_resource_inbound_transfer_resource_status_transitions::TreasuryInboundTransfersResourceInboundTransferResourceStatusTransitions; +pub mod treasury_outbound_payments_resource_outbound_payment_resource_end_user_details; +pub use treasury_outbound_payments_resource_outbound_payment_resource_end_user_details::TreasuryOutboundPaymentsResourceOutboundPaymentResourceEndUserDetails; +pub mod treasury_outbound_payments_resource_outbound_payment_resource_status_transitions; +pub use treasury_outbound_payments_resource_outbound_payment_resource_status_transitions::TreasuryOutboundPaymentsResourceOutboundPaymentResourceStatusTransitions; +pub mod treasury_outbound_payments_resource_returned_status; +pub use treasury_outbound_payments_resource_returned_status::TreasuryOutboundPaymentsResourceReturnedStatus; +pub mod treasury_outbound_transfers_resource_returned_details; +pub use treasury_outbound_transfers_resource_returned_details::TreasuryOutboundTransfersResourceReturnedDetails; +pub mod treasury_outbound_transfers_resource_status_transitions; +pub use treasury_outbound_transfers_resource_status_transitions::TreasuryOutboundTransfersResourceStatusTransitions; +pub mod treasury_received_credits_resource_linked_flows; +pub use treasury_received_credits_resource_linked_flows::TreasuryReceivedCreditsResourceLinkedFlows; +pub mod treasury_received_credits_resource_reversal_details; +pub use treasury_received_credits_resource_reversal_details::TreasuryReceivedCreditsResourceReversalDetails; +pub mod treasury_received_credits_resource_source_flows_details; +pub use treasury_received_credits_resource_source_flows_details::TreasuryReceivedCreditsResourceSourceFlowsDetails; +pub mod treasury_received_credits_resource_status_transitions; +pub use treasury_received_credits_resource_status_transitions::TreasuryReceivedCreditsResourceStatusTransitions; +pub mod treasury_received_debits_resource_debit_reversal_linked_flows; +pub use treasury_received_debits_resource_debit_reversal_linked_flows::TreasuryReceivedDebitsResourceDebitReversalLinkedFlows; +pub mod treasury_received_debits_resource_linked_flows; +pub use treasury_received_debits_resource_linked_flows::TreasuryReceivedDebitsResourceLinkedFlows; +pub mod treasury_received_debits_resource_reversal_details; +pub use treasury_received_debits_resource_reversal_details::TreasuryReceivedDebitsResourceReversalDetails; +pub mod treasury_received_debits_resource_status_transitions; +pub use treasury_received_debits_resource_status_transitions::TreasuryReceivedDebitsResourceStatusTransitions; +pub mod treasury_shared_resource_billing_details; +pub use treasury_shared_resource_billing_details::TreasurySharedResourceBillingDetails; +pub mod treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details; +pub use treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details::TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails; diff --git a/generated/stripe_treasury/src/outbound_payments_payment_method_details/mod.rs b/generated/stripe_treasury/src/outbound_payments_payment_method_details/mod.rs new file mode 100644 index 000000000..0fbcb89db --- /dev/null +++ b/generated/stripe_treasury/src/outbound_payments_payment_method_details/mod.rs @@ -0,0 +1,69 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct OutboundPaymentsPaymentMethodDetails { + pub billing_details: stripe_treasury::TreasurySharedResourceBillingDetails, + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_account: Option, + /// The type of the payment method used in the OutboundPayment. + #[serde(rename = "type")] + pub type_: OutboundPaymentsPaymentMethodDetailsType, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} +/// The type of the payment method used in the OutboundPayment. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundPaymentsPaymentMethodDetailsType { + FinancialAccount, + UsBankAccount, +} +impl OutboundPaymentsPaymentMethodDetailsType { + pub fn as_str(self) -> &'static str { + use OutboundPaymentsPaymentMethodDetailsType::*; + match self { + FinancialAccount => "financial_account", + UsBankAccount => "us_bank_account", + } + } +} + +impl std::str::FromStr for OutboundPaymentsPaymentMethodDetailsType { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundPaymentsPaymentMethodDetailsType::*; + match s { + "financial_account" => Ok(FinancialAccount), + "us_bank_account" => Ok(UsBankAccount), + _ => Err(()), + } + } +} +impl AsRef for OutboundPaymentsPaymentMethodDetailsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundPaymentsPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundPaymentsPaymentMethodDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for OutboundPaymentsPaymentMethodDetailsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for OutboundPaymentsPaymentMethodDetailsType")) + } +} diff --git a/generated/stripe_treasury/src/outbound_payments_payment_method_details_financial_account/mod.rs b/generated/stripe_treasury/src/outbound_payments_payment_method_details_financial_account/mod.rs new file mode 100644 index 000000000..e12a72486 --- /dev/null +++ b/generated/stripe_treasury/src/outbound_payments_payment_method_details_financial_account/mod.rs @@ -0,0 +1,62 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct OutboundPaymentsPaymentMethodDetailsFinancialAccount { + /// Token of the FinancialAccount. + pub id: String, + /// The rails used to send funds. + pub network: OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork, +} +/// The rails used to send funds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { + Stripe, +} +impl OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { + pub fn as_str(self) -> &'static str { + use OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork::*; + match self { + Stripe => "stripe", + } + } +} + +impl std::str::FromStr for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork::*; + match s { + "stripe" => Ok(Stripe), + _ => Err(()), + } + } +} +impl AsRef for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork")) + } +} diff --git a/generated/stripe_treasury/src/outbound_payments_payment_method_details_us_bank_account/mod.rs b/generated/stripe_treasury/src/outbound_payments_payment_method_details_us_bank_account/mod.rs new file mode 100644 index 000000000..52110d07e --- /dev/null +++ b/generated/stripe_treasury/src/outbound_payments_payment_method_details_us_bank_account/mod.rs @@ -0,0 +1,197 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct OutboundPaymentsPaymentMethodDetailsUsBankAccount { + /// Account holder type: individual or company. + pub account_holder_type: Option, + /// Account type: checkings or savings. + /// + /// Defaults to checking if omitted. + pub account_type: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Uniquely identifies this particular bank account. + /// + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// The US bank account network used to send funds. + pub network: OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork, + /// Routing number of the bank account. + pub routing_number: Option, +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { + Company, + Individual, +} +impl OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType")) + } +} +/// Account type: checkings or savings. +/// +/// Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { + Checking, + Savings, +} +impl OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl AsRef for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType")) + } +} +/// The US bank account network used to send funds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { + Ach, + UsDomesticWire, +} +impl OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { + pub fn as_str(self) -> &'static str { + use OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl AsRef for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork")) + } +} diff --git a/generated/stripe_treasury/src/outbound_transfers_payment_method_details/mod.rs b/generated/stripe_treasury/src/outbound_transfers_payment_method_details/mod.rs new file mode 100644 index 000000000..328f4691a --- /dev/null +++ b/generated/stripe_treasury/src/outbound_transfers_payment_method_details/mod.rs @@ -0,0 +1,64 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct OutboundTransfersPaymentMethodDetails { + pub billing_details: stripe_treasury::TreasurySharedResourceBillingDetails, + /// The type of the payment method used in the OutboundTransfer. + #[serde(rename = "type")] + pub type_: OutboundTransfersPaymentMethodDetailsType, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} +/// The type of the payment method used in the OutboundTransfer. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundTransfersPaymentMethodDetailsType { + UsBankAccount, +} +impl OutboundTransfersPaymentMethodDetailsType { + pub fn as_str(self) -> &'static str { + use OutboundTransfersPaymentMethodDetailsType::*; + match self { + UsBankAccount => "us_bank_account", + } + } +} + +impl std::str::FromStr for OutboundTransfersPaymentMethodDetailsType { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundTransfersPaymentMethodDetailsType::*; + match s { + "us_bank_account" => Ok(UsBankAccount), + _ => Err(()), + } + } +} +impl AsRef for OutboundTransfersPaymentMethodDetailsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for OutboundTransfersPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundTransfersPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundTransfersPaymentMethodDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for OutboundTransfersPaymentMethodDetailsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for OutboundTransfersPaymentMethodDetailsType")) + } +} diff --git a/generated/stripe_treasury/src/outbound_transfers_payment_method_details_us_bank_account/mod.rs b/generated/stripe_treasury/src/outbound_transfers_payment_method_details_us_bank_account/mod.rs new file mode 100644 index 000000000..4f4aae94b --- /dev/null +++ b/generated/stripe_treasury/src/outbound_transfers_payment_method_details_us_bank_account/mod.rs @@ -0,0 +1,197 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct OutboundTransfersPaymentMethodDetailsUsBankAccount { + /// Account holder type: individual or company. + pub account_holder_type: Option, + /// Account type: checkings or savings. + /// + /// Defaults to checking if omitted. + pub account_type: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Uniquely identifies this particular bank account. + /// + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// The US bank account network used to send funds. + pub network: OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork, + /// Routing number of the bank account. + pub routing_number: Option, +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + Company, + Individual, +} +impl OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType")) + } +} +/// Account type: checkings or savings. +/// +/// Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + Checking, + Savings, +} +impl OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl AsRef for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType")) + } +} +/// The US bank account network used to send funds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + Ach, + UsDomesticWire, +} +impl OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + pub fn as_str(self) -> &'static str { + use OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl AsRef for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork")) + } +} diff --git a/generated/stripe_treasury/src/received_payment_method_details_financial_account/mod.rs b/generated/stripe_treasury/src/received_payment_method_details_financial_account/mod.rs new file mode 100644 index 000000000..37ad16ad0 --- /dev/null +++ b/generated/stripe_treasury/src/received_payment_method_details_financial_account/mod.rs @@ -0,0 +1,66 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ReceivedPaymentMethodDetailsFinancialAccount { + /// The FinancialAccount ID. + pub id: String, + /// The rails the ReceivedCredit was sent over. + /// + /// A FinancialAccount can only send funds over `stripe`. + pub network: ReceivedPaymentMethodDetailsFinancialAccountNetwork, +} +/// The rails the ReceivedCredit was sent over. +/// +/// A FinancialAccount can only send funds over `stripe`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ReceivedPaymentMethodDetailsFinancialAccountNetwork { + Stripe, +} +impl ReceivedPaymentMethodDetailsFinancialAccountNetwork { + pub fn as_str(self) -> &'static str { + use ReceivedPaymentMethodDetailsFinancialAccountNetwork::*; + match self { + Stripe => "stripe", + } + } +} + +impl std::str::FromStr for ReceivedPaymentMethodDetailsFinancialAccountNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use ReceivedPaymentMethodDetailsFinancialAccountNetwork::*; + match s { + "stripe" => Ok(Stripe), + _ => Err(()), + } + } +} +impl AsRef for ReceivedPaymentMethodDetailsFinancialAccountNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ReceivedPaymentMethodDetailsFinancialAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ReceivedPaymentMethodDetailsFinancialAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ReceivedPaymentMethodDetailsFinancialAccountNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ReceivedPaymentMethodDetailsFinancialAccountNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ReceivedPaymentMethodDetailsFinancialAccountNetwork")) + } +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_aba_record/mod.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_aba_record/mod.rs new file mode 100644 index 000000000..807093226 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_aba_record/mod.rs @@ -0,0 +1,16 @@ +/// ABA Records contain U.S. +/// +/// bank account details per the ABA format. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceAbaRecord { + /// The name of the person or business that owns the bank account. + pub account_holder_name: String, + /// The account number. + pub account_number: Option, + /// The last four characters of the account number. + pub account_number_last4: String, + /// Name of the bank. + pub bank_name: String, + /// Routing number for the account. + pub routing_number: String, +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_aba_toggle_settings/mod.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_aba_toggle_settings/mod.rs new file mode 100644 index 000000000..4e5e9ceb7 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_aba_toggle_settings/mod.rs @@ -0,0 +1,71 @@ +/// Toggle settings for enabling/disabling the ABA address feature. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceAbaToggleSettings { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, + /// Whether the Feature is operational. + pub status: TreasuryFinancialAccountsResourceAbaToggleSettingsStatus, + /// Additional details; includes at least one entry when the status is not `active`. + pub status_details: Vec, +} +/// Whether the Feature is operational. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { + Active, + Pending, + Restricted, +} +impl TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceAbaToggleSettingsStatus::*; + match self { + Active => "active", + Pending => "pending", + Restricted => "restricted", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceAbaToggleSettingsStatus::*; + match s { + "active" => Ok(Active), + "pending" => Ok(Pending), + "restricted" => Ok(Restricted), + _ => Err(()), + } + } +} +impl AsRef for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus")) + } +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_ach_toggle_settings/mod.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_ach_toggle_settings/mod.rs new file mode 100644 index 000000000..373d57a62 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_ach_toggle_settings/mod.rs @@ -0,0 +1,71 @@ +/// Toggle settings for enabling/disabling an ACH specific feature. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceAchToggleSettings { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, + /// Whether the Feature is operational. + pub status: TreasuryFinancialAccountsResourceAchToggleSettingsStatus, + /// Additional details; includes at least one entry when the status is not `active`. + pub status_details: Vec, +} +/// Whether the Feature is operational. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceAchToggleSettingsStatus { + Active, + Pending, + Restricted, +} +impl TreasuryFinancialAccountsResourceAchToggleSettingsStatus { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceAchToggleSettingsStatus::*; + match self { + Active => "active", + Pending => "pending", + Restricted => "restricted", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceAchToggleSettingsStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceAchToggleSettingsStatus::*; + match s { + "active" => Ok(Active), + "pending" => Ok(Pending), + "restricted" => Ok(Restricted), + _ => Err(()), + } + } +} +impl AsRef for TreasuryFinancialAccountsResourceAchToggleSettingsStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceAchToggleSettingsStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceAchToggleSettingsStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceAchToggleSettingsStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceAchToggleSettingsStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourceAchToggleSettingsStatus")) + } +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_balance/mod.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_balance/mod.rs new file mode 100644 index 000000000..9d371975e --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_balance/mod.rs @@ -0,0 +1,10 @@ +/// Balance information for the FinancialAccount. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceBalance { + /// Funds the user can spend right now. + pub cash: std::collections::HashMap, + /// Funds not spendable yet, but will become available at a later time. + pub inbound_pending: std::collections::HashMap, + /// Funds in the account, but not spendable because they are being held for pending outbound flows. + pub outbound_pending: std::collections::HashMap, +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_closed_status_details/mod.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_closed_status_details/mod.rs new file mode 100644 index 000000000..804d4d671 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_closed_status_details/mod.rs @@ -0,0 +1,66 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceClosedStatusDetails { + /// The array that contains reasons for a FinancialAccount closure. + pub reasons: Vec, +} +/// The array that contains reasons for a FinancialAccount closure. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { + AccountRejected, + ClosedByPlatform, + Other, +} +impl TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceClosedStatusDetailsReasons::*; + match self { + AccountRejected => "account_rejected", + ClosedByPlatform => "closed_by_platform", + Other => "other", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceClosedStatusDetailsReasons::*; + match s { + "account_rejected" => Ok(AccountRejected), + "closed_by_platform" => Ok(ClosedByPlatform), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl AsRef for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons")) + } +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_account/mod.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_account/mod.rs new file mode 100644 index 000000000..e17d67dff --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_account/mod.rs @@ -0,0 +1,358 @@ +/// Stripe Treasury provides users with a container for money called a FinancialAccount that is separate from their Payments balance. +/// FinancialAccounts serve as the source and destination of Treasury’s money movement APIs. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceFinancialAccount { + /// The array of paths to active Features in the Features hash. + #[serde(skip_serializing_if = "Option::is_none")] + pub active_features: Option>, + pub balance: stripe_treasury::TreasuryFinancialAccountsResourceBalance, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: String, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option, + /// The set of credentials that resolve to a FinancialAccount. + pub financial_addresses: Vec, + /// Unique identifier for the object. + pub id: stripe_treasury::treasury_financial_accounts_resource_financial_account::TreasuryFinancialAccountId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// The array of paths to pending Features in the Features hash. + #[serde(skip_serializing_if = "Option::is_none")] + pub pending_features: Option>, + /// The set of functionalities that the platform can restrict on the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub platform_restrictions: Option, + /// The array of paths to restricted Features in the Features hash. + #[serde(skip_serializing_if = "Option::is_none")] + pub restricted_features: Option>, + /// The enum specifying what state the account is in. + pub status: TreasuryFinancialAccountsResourceFinancialAccountStatus, + pub status_details: stripe_treasury::TreasuryFinancialAccountsResourceStatusDetails, + /// The currencies the FinancialAccount can hold a balance in. + /// + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + pub supported_currencies: Vec, +} +/// The array of paths to active Features in the Features hash. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceFinancialAccountActiveFeatures { + CardIssuing, + DepositInsurance, + FinancialAddressesAba, + InboundTransfersAch, + IntraStripeFlows, + OutboundPaymentsAch, + OutboundPaymentsUsDomesticWire, + OutboundTransfersAch, + OutboundTransfersUsDomesticWire, + RemoteDepositCapture, +} +impl TreasuryFinancialAccountsResourceFinancialAccountActiveFeatures { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceFinancialAccountActiveFeatures::*; + match self { + CardIssuing => "card_issuing", + DepositInsurance => "deposit_insurance", + FinancialAddressesAba => "financial_addresses.aba", + InboundTransfersAch => "inbound_transfers.ach", + IntraStripeFlows => "intra_stripe_flows", + OutboundPaymentsAch => "outbound_payments.ach", + OutboundPaymentsUsDomesticWire => "outbound_payments.us_domestic_wire", + OutboundTransfersAch => "outbound_transfers.ach", + OutboundTransfersUsDomesticWire => "outbound_transfers.us_domestic_wire", + RemoteDepositCapture => "remote_deposit_capture", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceFinancialAccountActiveFeatures { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceFinancialAccountActiveFeatures::*; + match s { + "card_issuing" => Ok(CardIssuing), + "deposit_insurance" => Ok(DepositInsurance), + "financial_addresses.aba" => Ok(FinancialAddressesAba), + "inbound_transfers.ach" => Ok(InboundTransfersAch), + "intra_stripe_flows" => Ok(IntraStripeFlows), + "outbound_payments.ach" => Ok(OutboundPaymentsAch), + "outbound_payments.us_domestic_wire" => Ok(OutboundPaymentsUsDomesticWire), + "outbound_transfers.ach" => Ok(OutboundTransfersAch), + "outbound_transfers.us_domestic_wire" => Ok(OutboundTransfersUsDomesticWire), + "remote_deposit_capture" => Ok(RemoteDepositCapture), + _ => Err(()), + } + } +} +impl AsRef for TreasuryFinancialAccountsResourceFinancialAccountActiveFeatures { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceFinancialAccountActiveFeatures { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceFinancialAccountActiveFeatures { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceFinancialAccountActiveFeatures { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceFinancialAccountActiveFeatures { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourceFinancialAccountActiveFeatures")) + } +} +/// The array of paths to pending Features in the Features hash. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceFinancialAccountPendingFeatures { + CardIssuing, + DepositInsurance, + FinancialAddressesAba, + InboundTransfersAch, + IntraStripeFlows, + OutboundPaymentsAch, + OutboundPaymentsUsDomesticWire, + OutboundTransfersAch, + OutboundTransfersUsDomesticWire, + RemoteDepositCapture, +} +impl TreasuryFinancialAccountsResourceFinancialAccountPendingFeatures { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceFinancialAccountPendingFeatures::*; + match self { + CardIssuing => "card_issuing", + DepositInsurance => "deposit_insurance", + FinancialAddressesAba => "financial_addresses.aba", + InboundTransfersAch => "inbound_transfers.ach", + IntraStripeFlows => "intra_stripe_flows", + OutboundPaymentsAch => "outbound_payments.ach", + OutboundPaymentsUsDomesticWire => "outbound_payments.us_domestic_wire", + OutboundTransfersAch => "outbound_transfers.ach", + OutboundTransfersUsDomesticWire => "outbound_transfers.us_domestic_wire", + RemoteDepositCapture => "remote_deposit_capture", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceFinancialAccountPendingFeatures { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceFinancialAccountPendingFeatures::*; + match s { + "card_issuing" => Ok(CardIssuing), + "deposit_insurance" => Ok(DepositInsurance), + "financial_addresses.aba" => Ok(FinancialAddressesAba), + "inbound_transfers.ach" => Ok(InboundTransfersAch), + "intra_stripe_flows" => Ok(IntraStripeFlows), + "outbound_payments.ach" => Ok(OutboundPaymentsAch), + "outbound_payments.us_domestic_wire" => Ok(OutboundPaymentsUsDomesticWire), + "outbound_transfers.ach" => Ok(OutboundTransfersAch), + "outbound_transfers.us_domestic_wire" => Ok(OutboundTransfersUsDomesticWire), + "remote_deposit_capture" => Ok(RemoteDepositCapture), + _ => Err(()), + } + } +} +impl AsRef for TreasuryFinancialAccountsResourceFinancialAccountPendingFeatures { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceFinancialAccountPendingFeatures { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceFinancialAccountPendingFeatures { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceFinancialAccountPendingFeatures { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceFinancialAccountPendingFeatures { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourceFinancialAccountPendingFeatures")) + } +} +/// The array of paths to restricted Features in the Features hash. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceFinancialAccountRestrictedFeatures { + CardIssuing, + DepositInsurance, + FinancialAddressesAba, + InboundTransfersAch, + IntraStripeFlows, + OutboundPaymentsAch, + OutboundPaymentsUsDomesticWire, + OutboundTransfersAch, + OutboundTransfersUsDomesticWire, + RemoteDepositCapture, +} +impl TreasuryFinancialAccountsResourceFinancialAccountRestrictedFeatures { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceFinancialAccountRestrictedFeatures::*; + match self { + CardIssuing => "card_issuing", + DepositInsurance => "deposit_insurance", + FinancialAddressesAba => "financial_addresses.aba", + InboundTransfersAch => "inbound_transfers.ach", + IntraStripeFlows => "intra_stripe_flows", + OutboundPaymentsAch => "outbound_payments.ach", + OutboundPaymentsUsDomesticWire => "outbound_payments.us_domestic_wire", + OutboundTransfersAch => "outbound_transfers.ach", + OutboundTransfersUsDomesticWire => "outbound_transfers.us_domestic_wire", + RemoteDepositCapture => "remote_deposit_capture", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceFinancialAccountRestrictedFeatures { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceFinancialAccountRestrictedFeatures::*; + match s { + "card_issuing" => Ok(CardIssuing), + "deposit_insurance" => Ok(DepositInsurance), + "financial_addresses.aba" => Ok(FinancialAddressesAba), + "inbound_transfers.ach" => Ok(InboundTransfersAch), + "intra_stripe_flows" => Ok(IntraStripeFlows), + "outbound_payments.ach" => Ok(OutboundPaymentsAch), + "outbound_payments.us_domestic_wire" => Ok(OutboundPaymentsUsDomesticWire), + "outbound_transfers.ach" => Ok(OutboundTransfersAch), + "outbound_transfers.us_domestic_wire" => Ok(OutboundTransfersUsDomesticWire), + "remote_deposit_capture" => Ok(RemoteDepositCapture), + _ => Err(()), + } + } +} +impl AsRef for TreasuryFinancialAccountsResourceFinancialAccountRestrictedFeatures { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceFinancialAccountRestrictedFeatures { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceFinancialAccountRestrictedFeatures { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceFinancialAccountRestrictedFeatures { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceFinancialAccountRestrictedFeatures { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourceFinancialAccountRestrictedFeatures")) + } +} +/// The enum specifying what state the account is in. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceFinancialAccountStatus { + Closed, + Open, +} +impl TreasuryFinancialAccountsResourceFinancialAccountStatus { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceFinancialAccountStatus::*; + match self { + Closed => "closed", + Open => "open", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceFinancialAccountStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceFinancialAccountStatus::*; + match s { + "closed" => Ok(Closed), + "open" => Ok(Open), + _ => Err(()), + } + } +} +impl AsRef for TreasuryFinancialAccountsResourceFinancialAccountStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceFinancialAccountStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceFinancialAccountStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceFinancialAccountStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceFinancialAccountStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourceFinancialAccountStatus")) + } +} +impl stripe_types::Object for TreasuryFinancialAccountsResourceFinancialAccount { + type Id = stripe_treasury::treasury_financial_accounts_resource_financial_account::TreasuryFinancialAccountId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TreasuryFinancialAccountId); +#[cfg(feature = "treasury_financial_accounts_resource_financial_account")] +mod requests; +#[cfg(feature = "treasury_financial_accounts_resource_financial_account")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_account/requests.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_account/requests.rs new file mode 100644 index 000000000..b1cf8e79e --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_account/requests.rs @@ -0,0 +1,941 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountsResourceFinancialAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Encodes whether a FinancialAccount has access to a particular feature. + /// + /// Stripe or the platform can control features via the requested field. + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The set of functionalities that the platform can restrict on the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub platform_restrictions: Option, + /// The currencies the FinancialAccount can hold a balance in. + pub supported_currencies: &'a [&'a str], +} +impl<'a> CreateTreasuryFinancialAccountsResourceFinancialAccount<'a> { + pub fn new(supported_currencies: &'a [&'a str]) -> Self { + Self { expand: Default::default(), features: Default::default(), metadata: Default::default(), platform_restrictions: Default::default(), supported_currencies } + } +} +/// Encodes whether a FinancialAccount has access to a particular feature. +/// +/// Stripe or the platform can control features via the requested field. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountsResourceFinancialAccountFeatures { + /// Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option, + /// Represents whether this FinancialAccount is eligible for deposit insurance. + /// + /// Various factors determine the insurance amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub deposit_insurance: Option, + /// Contains Features that add FinancialAddresses to the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_addresses: Option, + /// Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. + #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_transfers: Option, + /// Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). + #[serde(skip_serializing_if = "Option::is_none")] + pub intra_stripe_flows: Option, + /// Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_payments: Option, + /// Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_transfers: Option, +} +impl CreateTreasuryFinancialAccountsResourceFinancialAccountFeatures { + pub fn new() -> Self { + Self::default() + } +} +/// Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesCardIssuing { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesCardIssuing { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Represents whether this FinancialAccount is eligible for deposit insurance. +/// +/// Various factors determine the insurance amount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesDepositInsurance { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesDepositInsurance { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains Features that add FinancialAddresses to the FinancialAccount. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesFinancialAddresses { + /// Adds an ABA FinancialAddress to the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub aba: Option, +} +impl CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesFinancialAddresses { + pub fn new() -> Self { + Self::default() + } +} +/// Adds an ABA FinancialAddress to the FinancialAccount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesFinancialAddressesAba { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesFinancialAddressesAba { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesInboundTransfers { + /// Enables ACH Debits via the InboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, +} +impl CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesInboundTransfers { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH Debits via the InboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesInboundTransfersAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesInboundTransfersAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesIntraStripeFlows { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesIntraStripeFlows { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundPayments { + /// Enables ACH transfers via the OutboundPayments API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + /// Enables US domestic wire transfers via the OutboundPayments API. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: Option, +} +impl CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundPayments { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH transfers via the OutboundPayments API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundPaymentsAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundPaymentsAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Enables US domestic wire transfers via the OutboundPayments API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundPaymentsUsDomesticWire { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundPaymentsUsDomesticWire { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundTransfers { + /// Enables ACH transfers via the OutboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + /// Enables US domestic wire transfers via the OutboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: Option, +} +impl CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundTransfers { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH transfers via the OutboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundTransfersAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundTransfersAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Enables US domestic wire transfers via the OutboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundTransfersUsDomesticWire { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundTransfersUsDomesticWire { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// The set of functionalities that the platform can restrict on the FinancialAccount. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictions { + /// Restricts all inbound money movement. + #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_flows: Option, + /// Restricts all outbound money movement. + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_flows: Option, +} +impl CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictions { + pub fn new() -> Self { + Self::default() + } +} +/// Restricts all inbound money movement. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows { + Restricted, + Unrestricted, +} +impl CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows { + pub fn as_str(self) -> &'static str { + use CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows::*; + match self { + Restricted => "restricted", + Unrestricted => "unrestricted", + } + } +} + +impl std::str::FromStr for CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows::*; + match s { + "restricted" => Ok(Restricted), + "unrestricted" => Ok(Unrestricted), + _ => Err(()), + } + } +} +impl AsRef for CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Restricts all outbound money movement. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows { + Restricted, + Unrestricted, +} +impl CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows { + pub fn as_str(self) -> &'static str { + use CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows::*; + match self { + Restricted => "restricted", + Unrestricted => "unrestricted", + } + } +} + +impl std::str::FromStr for CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows::*; + match s { + "restricted" => Ok(Restricted), + "unrestricted" => Ok(Unrestricted), + _ => Err(()), + } + } +} +impl AsRef for CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateTreasuryFinancialAccountsResourceFinancialAccount<'a> { + /// Creates a new FinancialAccount. + /// + /// For now, each connected account can only have one FinancialAccount. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/treasury/financial_accounts", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountsResourceFinancialAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Encodes whether a FinancialAccount has access to a particular feature, with a status enum and associated `status_details`. + /// + /// Stripe or the platform may control features via the requested field. + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The set of functionalities that the platform can restrict on the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub platform_restrictions: Option, +} +impl<'a> UpdateTreasuryFinancialAccountsResourceFinancialAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Encodes whether a FinancialAccount has access to a particular feature, with a status enum and associated `status_details`. +/// +/// Stripe or the platform may control features via the requested field. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountsResourceFinancialAccountFeatures { + /// Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option, + /// Represents whether this FinancialAccount is eligible for deposit insurance. + /// + /// Various factors determine the insurance amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub deposit_insurance: Option, + /// Contains Features that add FinancialAddresses to the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_addresses: Option, + /// Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. + #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_transfers: Option, + /// Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). + #[serde(skip_serializing_if = "Option::is_none")] + pub intra_stripe_flows: Option, + /// Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_payments: Option, + /// Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_transfers: Option, +} +impl UpdateTreasuryFinancialAccountsResourceFinancialAccountFeatures { + pub fn new() -> Self { + Self::default() + } +} +/// Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesCardIssuing { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesCardIssuing { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Represents whether this FinancialAccount is eligible for deposit insurance. +/// +/// Various factors determine the insurance amount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesDepositInsurance { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesDepositInsurance { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains Features that add FinancialAddresses to the FinancialAccount. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesFinancialAddresses { + /// Adds an ABA FinancialAddress to the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub aba: Option, +} +impl UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesFinancialAddresses { + pub fn new() -> Self { + Self::default() + } +} +/// Adds an ABA FinancialAddress to the FinancialAccount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesFinancialAddressesAba { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesFinancialAddressesAba { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesInboundTransfers { + /// Enables ACH Debits via the InboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, +} +impl UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesInboundTransfers { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH Debits via the InboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesInboundTransfersAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesInboundTransfersAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesIntraStripeFlows { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesIntraStripeFlows { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundPayments { + /// Enables ACH transfers via the OutboundPayments API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + /// Enables US domestic wire transfers via the OutboundPayments API. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: Option, +} +impl UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundPayments { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH transfers via the OutboundPayments API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundPaymentsAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundPaymentsAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Enables US domestic wire transfers via the OutboundPayments API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundPaymentsUsDomesticWire { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundPaymentsUsDomesticWire { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundTransfers { + /// Enables ACH transfers via the OutboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + /// Enables US domestic wire transfers via the OutboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: Option, +} +impl UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundTransfers { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH transfers via the OutboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundTransfersAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundTransfersAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Enables US domestic wire transfers via the OutboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundTransfersUsDomesticWire { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountsResourceFinancialAccountFeaturesOutboundTransfersUsDomesticWire { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// The set of functionalities that the platform can restrict on the FinancialAccount. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictions { + /// Restricts all inbound money movement. + #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_flows: Option, + /// Restricts all outbound money movement. + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_flows: Option, +} +impl UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictions { + pub fn new() -> Self { + Self::default() + } +} +/// Restricts all inbound money movement. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows { + Restricted, + Unrestricted, +} +impl UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows { + pub fn as_str(self) -> &'static str { + use UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows::*; + match self { + Restricted => "restricted", + Unrestricted => "unrestricted", + } + } +} + +impl std::str::FromStr for UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows::*; + match s { + "restricted" => Ok(Restricted), + "unrestricted" => Ok(Unrestricted), + _ => Err(()), + } + } +} +impl AsRef for UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsInboundFlows { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Restricts all outbound money movement. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows { + Restricted, + Unrestricted, +} +impl UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows { + pub fn as_str(self) -> &'static str { + use UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows::*; + match self { + Restricted => "restricted", + Unrestricted => "unrestricted", + } + } +} + +impl std::str::FromStr for UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows::*; + match s { + "restricted" => Ok(Restricted), + "unrestricted" => Ok(Unrestricted), + _ => Err(()), + } + } +} +impl AsRef for UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateTreasuryFinancialAccountsResourceFinancialAccountPlatformRestrictionsOutboundFlows { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateTreasuryFinancialAccountsResourceFinancialAccount<'a> { + /// Updates the details of a FinancialAccount. + pub fn send(&self, client: &stripe::Client, financial_account: &str) -> stripe::Response { + client.send_form(&format!("/treasury/financial_accounts/{financial_account}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccount<'a> { + /// Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option, + /// Represents whether this FinancialAccount is eligible for deposit insurance. + /// + /// Various factors determine the insurance amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub deposit_insurance: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Contains Features that add FinancialAddresses to the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_addresses: Option, + /// Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. + #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_transfers: Option, + /// Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). + #[serde(skip_serializing_if = "Option::is_none")] + pub intra_stripe_flows: Option, + /// Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_payments: Option, + /// Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_transfers: Option, +} +impl<'a> UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountCardIssuing { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountCardIssuing { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Represents whether this FinancialAccount is eligible for deposit insurance. +/// +/// Various factors determine the insurance amount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountDepositInsurance { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountDepositInsurance { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains Features that add FinancialAddresses to the FinancialAccount. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountFinancialAddresses { + /// Adds an ABA FinancialAddress to the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub aba: Option, +} +impl UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountFinancialAddresses { + pub fn new() -> Self { + Self::default() + } +} +/// Adds an ABA FinancialAddress to the FinancialAccount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountFinancialAddressesAba { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountFinancialAddressesAba { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountInboundTransfers { + /// Enables ACH Debits via the InboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, +} +impl UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountInboundTransfers { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH Debits via the InboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountInboundTransfersAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountInboundTransfersAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountIntraStripeFlows { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountIntraStripeFlows { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountOutboundPayments { + /// Enables ACH transfers via the OutboundPayments API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + /// Enables US domestic wire transfers via the OutboundPayments API. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: Option, +} +impl UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountOutboundPayments { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH transfers via the OutboundPayments API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountOutboundPaymentsAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountOutboundPaymentsAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Enables US domestic wire transfers via the OutboundPayments API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountOutboundPaymentsUsDomesticWire { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountOutboundPaymentsUsDomesticWire { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountOutboundTransfers { + /// Enables ACH transfers via the OutboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + /// Enables US domestic wire transfers via the OutboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: Option, +} +impl UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountOutboundTransfers { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH transfers via the OutboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountOutboundTransfersAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountOutboundTransfersAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Enables US domestic wire transfers via the OutboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountOutboundTransfersUsDomesticWire { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccountOutboundTransfersUsDomesticWire { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +impl<'a> UpdateFeaturesTreasuryFinancialAccountsResourceFinancialAccount<'a> { + /// Updates the Features associated with a FinancialAccount. + pub fn send(&self, client: &stripe::Client, financial_account: &str) -> stripe::Response { + client.send_form(&format!("/treasury/financial_accounts/{financial_account}/features"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTreasuryFinancialAccountsResourceFinancialAccount<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// An object ID cursor for use in pagination. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit ranging from 1 to 100 (defaults to 10). + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// An object ID cursor for use in pagination. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListTreasuryFinancialAccountsResourceFinancialAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTreasuryFinancialAccountsResourceFinancialAccount<'a> { + /// Returns a list of FinancialAccounts. + pub fn send(&self, client: &stripe::Client) -> stripe::Response> { + client.get_query("/treasury/financial_accounts", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/treasury/financial_accounts", self) + } +} +impl<'a> stripe::PaginationParams for ListTreasuryFinancialAccountsResourceFinancialAccount<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryFinancialAccountsResourceFinancialAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryFinancialAccountsResourceFinancialAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryFinancialAccountsResourceFinancialAccount<'a> { + /// Retrieves the details of a FinancialAccount. + pub fn send(&self, client: &stripe::Client, financial_account: &str) -> stripe::Response { + client.get_query(&format!("/treasury/financial_accounts/{financial_account}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveFeaturesTreasuryFinancialAccountsResourceFinancialAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveFeaturesTreasuryFinancialAccountsResourceFinancialAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveFeaturesTreasuryFinancialAccountsResourceFinancialAccount<'a> { + /// Retrieves Features information associated with the FinancialAccount. + pub fn send(&self, client: &stripe::Client, financial_account: &str) -> stripe::Response { + client.get_query(&format!("/treasury/financial_accounts/{financial_account}/features"), self) + } +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_account_features/mod.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_account_features/mod.rs new file mode 100644 index 000000000..ff616026f --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_account_features/mod.rs @@ -0,0 +1,19 @@ +/// Encodes whether a FinancialAccount has access to a particular Feature, with a `status` enum and associated `status_details`. +/// Stripe or the platform can control Features via the requested field. +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceFinancialAccountFeatures { + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub deposit_insurance: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_addresses: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_transfers: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub intra_stripe_flows: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_payments: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_transfers: Option, +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_address/mod.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_address/mod.rs new file mode 100644 index 000000000..03032e125 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_address/mod.rs @@ -0,0 +1,125 @@ +/// FinancialAddresses contain identifying information that resolves to a FinancialAccount. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceFinancialAddress { + #[serde(skip_serializing_if = "Option::is_none")] + pub aba: Option, + /// The list of networks that the address supports. + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_networks: Option>, + /// The type of financial address. + #[serde(rename = "type")] + pub type_: TreasuryFinancialAccountsResourceFinancialAddressType, +} +/// The list of networks that the address supports. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { + Ach, + UsDomesticWire, +} +impl TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl AsRef for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks")) + } +} +/// The type of financial address. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceFinancialAddressType { + Aba, +} +impl TreasuryFinancialAccountsResourceFinancialAddressType { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceFinancialAddressType::*; + match self { + Aba => "aba", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceFinancialAddressType { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceFinancialAddressType::*; + match s { + "aba" => Ok(Aba), + _ => Err(()), + } + } +} +impl AsRef for TreasuryFinancialAccountsResourceFinancialAddressType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceFinancialAddressType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceFinancialAddressType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceFinancialAddressType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceFinancialAddressType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourceFinancialAddressType")) + } +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_addresses_features/mod.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_addresses_features/mod.rs new file mode 100644 index 000000000..f9fa53536 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_addresses_features/mod.rs @@ -0,0 +1,6 @@ +/// Settings related to Financial Addresses features on a Financial Account. +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceFinancialAddressesFeatures { + #[serde(skip_serializing_if = "Option::is_none")] + pub aba: Option, +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_inbound_transfers/mod.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_inbound_transfers/mod.rs new file mode 100644 index 000000000..666a4f695 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_inbound_transfers/mod.rs @@ -0,0 +1,6 @@ +/// InboundTransfers contains inbound transfers features for a FinancialAccount. +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceInboundTransfers { + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_outbound_payments/mod.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_outbound_payments/mod.rs new file mode 100644 index 000000000..3410baa42 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_outbound_payments/mod.rs @@ -0,0 +1,8 @@ +/// Settings related to Outbound Payments features on a Financial Account. +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceOutboundPayments { + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: Option, +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_outbound_transfers/mod.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_outbound_transfers/mod.rs new file mode 100644 index 000000000..c9a0abe03 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_outbound_transfers/mod.rs @@ -0,0 +1,8 @@ +/// OutboundTransfers contains outbound transfers features for a FinancialAccount. +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceOutboundTransfers { + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: Option, +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_platform_restrictions/mod.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_platform_restrictions/mod.rs new file mode 100644 index 000000000..0cfad1997 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_platform_restrictions/mod.rs @@ -0,0 +1,124 @@ +/// Restrictions that a Connect Platform has placed on this FinancialAccount. +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourcePlatformRestrictions { + /// Restricts all inbound money movement. + pub inbound_flows: Option, + /// Restricts all outbound money movement. + pub outbound_flows: Option, +} +/// Restricts all inbound money movement. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { + Restricted, + Unrestricted, +} +impl TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows::*; + match self { + Restricted => "restricted", + Unrestricted => "unrestricted", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows::*; + match s { + "restricted" => Ok(Restricted), + "unrestricted" => Ok(Unrestricted), + _ => Err(()), + } + } +} +impl AsRef for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows")) + } +} +/// Restricts all outbound money movement. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { + Restricted, + Unrestricted, +} +impl TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows::*; + match self { + Restricted => "restricted", + Unrestricted => "unrestricted", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows::*; + match s { + "restricted" => Ok(Restricted), + "unrestricted" => Ok(Unrestricted), + _ => Err(()), + } + } +} +impl AsRef for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows")) + } +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_status_details/mod.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_status_details/mod.rs new file mode 100644 index 000000000..27fe25e16 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_status_details/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceStatusDetails { + /// Details related to the closure of this FinancialAccount. + pub closed: Option, +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_toggle_settings/mod.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_toggle_settings/mod.rs new file mode 100644 index 000000000..bb0630735 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_toggle_settings/mod.rs @@ -0,0 +1,71 @@ +/// Toggle settings for enabling/disabling a feature. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceToggleSettings { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, + /// Whether the Feature is operational. + pub status: TreasuryFinancialAccountsResourceToggleSettingsStatus, + /// Additional details; includes at least one entry when the status is not `active`. + pub status_details: Vec, +} +/// Whether the Feature is operational. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceToggleSettingsStatus { + Active, + Pending, + Restricted, +} +impl TreasuryFinancialAccountsResourceToggleSettingsStatus { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceToggleSettingsStatus::*; + match self { + Active => "active", + Pending => "pending", + Restricted => "restricted", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceToggleSettingsStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceToggleSettingsStatus::*; + match s { + "active" => Ok(Active), + "pending" => Ok(Pending), + "restricted" => Ok(Restricted), + _ => Err(()), + } + } +} +impl AsRef for TreasuryFinancialAccountsResourceToggleSettingsStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceToggleSettingsStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceToggleSettingsStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceToggleSettingsStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceToggleSettingsStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourceToggleSettingsStatus")) + } +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_toggles_setting_status_details/mod.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_toggles_setting_status_details/mod.rs new file mode 100644 index 000000000..5e83bfbf2 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_toggles_setting_status_details/mod.rs @@ -0,0 +1,209 @@ +/// Additional details on the FinancialAccount Features information. +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceTogglesSettingStatusDetails { + /// Represents the reason why the status is `pending` or `restricted`. + pub code: TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode, + /// Represents what the user should do, if anything, to activate the Feature. + pub resolution: Option, + /// The `platform_restrictions` that are restricting this Feature. + #[serde(skip_serializing_if = "Option::is_none")] + pub restriction: Option, +} +/// Represents the reason why the status is `pending` or `restricted`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { + Activating, + CapabilityNotRequested, + FinancialAccountClosed, + RejectedOther, + RejectedUnsupportedBusiness, + RequirementsPastDue, + RequirementsPendingVerification, + RestrictedByPlatform, + RestrictedOther, +} +impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::*; + match self { + Activating => "activating", + CapabilityNotRequested => "capability_not_requested", + FinancialAccountClosed => "financial_account_closed", + RejectedOther => "rejected_other", + RejectedUnsupportedBusiness => "rejected_unsupported_business", + RequirementsPastDue => "requirements_past_due", + RequirementsPendingVerification => "requirements_pending_verification", + RestrictedByPlatform => "restricted_by_platform", + RestrictedOther => "restricted_other", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::*; + match s { + "activating" => Ok(Activating), + "capability_not_requested" => Ok(CapabilityNotRequested), + "financial_account_closed" => Ok(FinancialAccountClosed), + "rejected_other" => Ok(RejectedOther), + "rejected_unsupported_business" => Ok(RejectedUnsupportedBusiness), + "requirements_past_due" => Ok(RequirementsPastDue), + "requirements_pending_verification" => Ok(RequirementsPendingVerification), + "restricted_by_platform" => Ok(RestrictedByPlatform), + "restricted_other" => Ok(RestrictedOther), + _ => Err(()), + } + } +} +impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode")) + } +} +/// Represents what the user should do, if anything, to activate the Feature. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { + ContactStripe, + ProvideInformation, + RemoveRestriction, +} +impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::*; + match self { + ContactStripe => "contact_stripe", + ProvideInformation => "provide_information", + RemoveRestriction => "remove_restriction", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::*; + match s { + "contact_stripe" => Ok(ContactStripe), + "provide_information" => Ok(ProvideInformation), + "remove_restriction" => Ok(RemoveRestriction), + _ => Err(()), + } + } +} +impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution")) + } +} +/// The `platform_restrictions` that are restricting this Feature. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { + InboundFlows, + OutboundFlows, +} +impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction::*; + match self { + InboundFlows => "inbound_flows", + OutboundFlows => "outbound_flows", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction::*; + match s { + "inbound_flows" => Ok(InboundFlows), + "outbound_flows" => Ok(OutboundFlows), + _ => Err(()), + } + } +} +impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction")) + } +} diff --git a/generated/stripe_treasury/src/treasury_inbound_transfers_resource_failure_details/mod.rs b/generated/stripe_treasury/src/treasury_inbound_transfers_resource_failure_details/mod.rs new file mode 100644 index 000000000..82eb3a30f --- /dev/null +++ b/generated/stripe_treasury/src/treasury_inbound_transfers_resource_failure_details/mod.rs @@ -0,0 +1,100 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryInboundTransfersResourceFailureDetails { + /// Reason for the failure. + pub code: TreasuryInboundTransfersResourceFailureDetailsCode, +} +/// Reason for the failure. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum TreasuryInboundTransfersResourceFailureDetailsCode { + AccountClosed, + AccountFrozen, + BankAccountRestricted, + BankOwnershipChanged, + DebitNotAuthorized, + IncorrectAccountHolderAddress, + IncorrectAccountHolderName, + IncorrectAccountHolderTaxId, + InsufficientFunds, + InvalidAccountNumber, + InvalidCurrency, + NoAccount, + Other, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl TreasuryInboundTransfersResourceFailureDetailsCode { + pub fn as_str(self) -> &'static str { + use TreasuryInboundTransfersResourceFailureDetailsCode::*; + match self { + AccountClosed => "account_closed", + AccountFrozen => "account_frozen", + BankAccountRestricted => "bank_account_restricted", + BankOwnershipChanged => "bank_ownership_changed", + DebitNotAuthorized => "debit_not_authorized", + IncorrectAccountHolderAddress => "incorrect_account_holder_address", + IncorrectAccountHolderName => "incorrect_account_holder_name", + IncorrectAccountHolderTaxId => "incorrect_account_holder_tax_id", + InsufficientFunds => "insufficient_funds", + InvalidAccountNumber => "invalid_account_number", + InvalidCurrency => "invalid_currency", + NoAccount => "no_account", + Other => "other", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for TreasuryInboundTransfersResourceFailureDetailsCode { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryInboundTransfersResourceFailureDetailsCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_frozen" => Ok(AccountFrozen), + "bank_account_restricted" => Ok(BankAccountRestricted), + "bank_ownership_changed" => Ok(BankOwnershipChanged), + "debit_not_authorized" => Ok(DebitNotAuthorized), + "incorrect_account_holder_address" => Ok(IncorrectAccountHolderAddress), + "incorrect_account_holder_name" => Ok(IncorrectAccountHolderName), + "incorrect_account_holder_tax_id" => Ok(IncorrectAccountHolderTaxId), + "insufficient_funds" => Ok(InsufficientFunds), + "invalid_account_number" => Ok(InvalidAccountNumber), + "invalid_currency" => Ok(InvalidCurrency), + "no_account" => Ok(NoAccount), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl AsRef for TreasuryInboundTransfersResourceFailureDetailsCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryInboundTransfersResourceFailureDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryInboundTransfersResourceFailureDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryInboundTransfersResourceFailureDetailsCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryInboundTransfersResourceFailureDetailsCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(TreasuryInboundTransfersResourceFailureDetailsCode::Unknown)) + } +} diff --git a/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer/mod.rs b/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer/mod.rs new file mode 100644 index 000000000..2fab597c5 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer/mod.rs @@ -0,0 +1,137 @@ +/// Use [InboundTransfers](https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. +/// +/// The funds will be transferred via an ACH debit. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryInboundTransfersResourceInboundTransfer { + /// Amount (in cents) transferred. + pub amount: i64, + /// Returns `true` if the InboundTransfer is able to be canceled. + pub cancelable: bool, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// Details about this InboundTransfer's failure. + /// + /// Only set when status is `failed`. + pub failure_details: Option, + /// The FinancialAccount that received the funds. + pub financial_account: String, + /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + pub hosted_regulatory_receipt_url: Option, + /// Unique identifier for the object. + pub id: stripe_treasury::treasury_inbound_transfers_resource_inbound_transfer::TreasuryInboundTransferId, + pub linked_flows: stripe_treasury::TreasuryInboundTransfersResourceInboundTransferResourceLinkedFlows, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The origin payment method to be debited for an InboundTransfer. + pub origin_payment_method: String, + /// Details about the PaymentMethod for an InboundTransfer. + pub origin_payment_method_details: Option, + /// Returns `true` if the funds for an InboundTransfer were returned after the InboundTransfer went to the `succeeded` state. + pub returned: Option, + /// Statement descriptor shown when funds are debited from the source. + /// + /// Not all payment networks support `statement_descriptor`. + pub statement_descriptor: String, + /// Status of the InboundTransfer: `processing`, `succeeded`, `failed`, and `canceled`. + /// + /// An InboundTransfer is `processing` if it is created and pending. + /// The status changes to `succeeded` once the funds have been "confirmed" and a `transaction` is created and posted. + /// The status changes to `failed` if the transfer fails. + pub status: TreasuryInboundTransfersResourceInboundTransferStatus, + pub status_transitions: stripe_treasury::TreasuryInboundTransfersResourceInboundTransferResourceStatusTransitions, + /// The Transaction associated with this object. + pub transaction: Option>, +} +/// Status of the InboundTransfer: `processing`, `succeeded`, `failed`, and `canceled`. +/// +/// An InboundTransfer is `processing` if it is created and pending. +/// The status changes to `succeeded` once the funds have been "confirmed" and a `transaction` is created and posted. +/// The status changes to `failed` if the transfer fails. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryInboundTransfersResourceInboundTransferStatus { + Canceled, + Failed, + Processing, + Succeeded, +} +impl TreasuryInboundTransfersResourceInboundTransferStatus { + pub fn as_str(self) -> &'static str { + use TreasuryInboundTransfersResourceInboundTransferStatus::*; + match self { + Canceled => "canceled", + Failed => "failed", + Processing => "processing", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for TreasuryInboundTransfersResourceInboundTransferStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryInboundTransfersResourceInboundTransferStatus::*; + match s { + "canceled" => Ok(Canceled), + "failed" => Ok(Failed), + "processing" => Ok(Processing), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl AsRef for TreasuryInboundTransfersResourceInboundTransferStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryInboundTransfersResourceInboundTransferStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryInboundTransfersResourceInboundTransferStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryInboundTransfersResourceInboundTransferStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryInboundTransfersResourceInboundTransferStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryInboundTransfersResourceInboundTransferStatus")) + } +} +impl stripe_types::Object for TreasuryInboundTransfersResourceInboundTransfer { + type Id = stripe_treasury::treasury_inbound_transfers_resource_inbound_transfer::TreasuryInboundTransferId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TreasuryInboundTransferId); +#[cfg(feature = "treasury_inbound_transfers_resource_inbound_transfer")] +mod requests; +#[cfg(feature = "treasury_inbound_transfers_resource_inbound_transfer")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer/requests.rs b/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer/requests.rs new file mode 100644 index 000000000..f43d1b4b0 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer/requests.rs @@ -0,0 +1,338 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelTreasuryInboundTransfersResourceInboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelTreasuryInboundTransfersResourceInboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelTreasuryInboundTransfersResourceInboundTransfer<'a> { + /// Cancels an InboundTransfer. + pub fn send(&self, client: &stripe::Client, inbound_transfer: &str) -> stripe::Response { + client.send_form(&format!("/treasury/inbound_transfers/{inbound_transfer}/cancel"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryInboundTransfersResourceInboundTransfer<'a> { + /// Amount (in cents) to be transferred. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The FinancialAccount to send funds to. + pub financial_account: &'a str, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The origin payment method to be debited for the InboundTransfer. + pub origin_payment_method: &'a str, + /// The complete description that appears on your customers' statements. + /// + /// Maximum 10 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, +} +impl<'a> CreateTreasuryInboundTransfersResourceInboundTransfer<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency, financial_account: &'a str, origin_payment_method: &'a str) -> Self { + Self { amount, currency, description: Default::default(), expand: Default::default(), financial_account, metadata: Default::default(), origin_payment_method, statement_descriptor: Default::default() } + } +} +impl<'a> CreateTreasuryInboundTransfersResourceInboundTransfer<'a> { + /// Creates an InboundTransfer. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/treasury/inbound_transfers", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryInboundTransfersResourceInboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryInboundTransfersResourceInboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryInboundTransfersResourceInboundTransfer<'a> { + /// Retrieves the details of an existing InboundTransfer. + pub fn send(&self, client: &stripe::Client, id: &stripe_treasury::treasury_inbound_transfers_resource_inbound_transfer::TreasuryInboundTransferId) -> stripe::Response { + client.get_query(&format!("/treasury/inbound_transfers/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryInboundTransfersResourceInboundTransfer<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Returns objects associated with this FinancialAccount. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return InboundTransfers that have the given status: `processing`, `succeeded`, `failed` or `canceled`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTreasuryInboundTransfersResourceInboundTransfer<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { ending_before: Default::default(), expand: Default::default(), financial_account, limit: Default::default(), starting_after: Default::default(), status: Default::default() } + } +} +/// Only return InboundTransfers that have the given status: `processing`, `succeeded`, `failed` or `canceled`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTreasuryInboundTransfersResourceInboundTransferStatus { + Canceled, + Failed, + Processing, + Succeeded, +} +impl ListTreasuryInboundTransfersResourceInboundTransferStatus { + pub fn as_str(self) -> &'static str { + use ListTreasuryInboundTransfersResourceInboundTransferStatus::*; + match self { + Canceled => "canceled", + Failed => "failed", + Processing => "processing", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for ListTreasuryInboundTransfersResourceInboundTransferStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTreasuryInboundTransfersResourceInboundTransferStatus::*; + match s { + "canceled" => Ok(Canceled), + "failed" => Ok(Failed), + "processing" => Ok(Processing), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl AsRef for ListTreasuryInboundTransfersResourceInboundTransferStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListTreasuryInboundTransfersResourceInboundTransferStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTreasuryInboundTransfersResourceInboundTransferStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTreasuryInboundTransfersResourceInboundTransferStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListTreasuryInboundTransfersResourceInboundTransfer<'a> { + /// Returns a list of InboundTransfers sent from the specified FinancialAccount. + pub fn send(&self, client: &stripe::Client) -> stripe::Response> { + client.get_query("/treasury/inbound_transfers", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/treasury/inbound_transfers", self) + } +} +impl<'a> stripe::PaginationParams for ListTreasuryInboundTransfersResourceInboundTransfer<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct SucceedTreasuryInboundTransfersResourceInboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> SucceedTreasuryInboundTransfersResourceInboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> SucceedTreasuryInboundTransfersResourceInboundTransfer<'a> { + /// Transitions a test mode created InboundTransfer to the `succeeded` status. + /// + /// The InboundTransfer must already be in the `processing` state. + pub fn send(&self, client: &stripe::Client, id: &stripe_treasury::treasury_inbound_transfers_resource_inbound_transfer::TreasuryInboundTransferId) -> stripe::Response { + client.send_form(&format!("/test_helpers/treasury/inbound_transfers/{id}/succeed"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct FailTreasuryInboundTransfersResourceInboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Details about a failed InboundTransfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub failure_details: Option, +} +impl<'a> FailTreasuryInboundTransfersResourceInboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details about a failed InboundTransfer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct FailTreasuryInboundTransfersResourceInboundTransferFailureDetails { + /// Reason for the failure. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option, +} +impl FailTreasuryInboundTransfersResourceInboundTransferFailureDetails { + pub fn new() -> Self { + Self::default() + } +} +/// Reason for the failure. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum FailTreasuryInboundTransfersResourceInboundTransferFailureDetailsCode { + AccountClosed, + AccountFrozen, + BankAccountRestricted, + BankOwnershipChanged, + DebitNotAuthorized, + IncorrectAccountHolderAddress, + IncorrectAccountHolderName, + IncorrectAccountHolderTaxId, + InsufficientFunds, + InvalidAccountNumber, + InvalidCurrency, + NoAccount, + Other, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl FailTreasuryInboundTransfersResourceInboundTransferFailureDetailsCode { + pub fn as_str(self) -> &'static str { + use FailTreasuryInboundTransfersResourceInboundTransferFailureDetailsCode::*; + match self { + AccountClosed => "account_closed", + AccountFrozen => "account_frozen", + BankAccountRestricted => "bank_account_restricted", + BankOwnershipChanged => "bank_ownership_changed", + DebitNotAuthorized => "debit_not_authorized", + IncorrectAccountHolderAddress => "incorrect_account_holder_address", + IncorrectAccountHolderName => "incorrect_account_holder_name", + IncorrectAccountHolderTaxId => "incorrect_account_holder_tax_id", + InsufficientFunds => "insufficient_funds", + InvalidAccountNumber => "invalid_account_number", + InvalidCurrency => "invalid_currency", + NoAccount => "no_account", + Other => "other", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for FailTreasuryInboundTransfersResourceInboundTransferFailureDetailsCode { + type Err = (); + fn from_str(s: &str) -> Result { + use FailTreasuryInboundTransfersResourceInboundTransferFailureDetailsCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_frozen" => Ok(AccountFrozen), + "bank_account_restricted" => Ok(BankAccountRestricted), + "bank_ownership_changed" => Ok(BankOwnershipChanged), + "debit_not_authorized" => Ok(DebitNotAuthorized), + "incorrect_account_holder_address" => Ok(IncorrectAccountHolderAddress), + "incorrect_account_holder_name" => Ok(IncorrectAccountHolderName), + "incorrect_account_holder_tax_id" => Ok(IncorrectAccountHolderTaxId), + "insufficient_funds" => Ok(InsufficientFunds), + "invalid_account_number" => Ok(InvalidAccountNumber), + "invalid_currency" => Ok(InvalidCurrency), + "no_account" => Ok(NoAccount), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl AsRef for FailTreasuryInboundTransfersResourceInboundTransferFailureDetailsCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for FailTreasuryInboundTransfersResourceInboundTransferFailureDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FailTreasuryInboundTransfersResourceInboundTransferFailureDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FailTreasuryInboundTransfersResourceInboundTransferFailureDetailsCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> FailTreasuryInboundTransfersResourceInboundTransfer<'a> { + /// Transitions a test mode created InboundTransfer to the `failed` status. + /// + /// The InboundTransfer must already be in the `processing` state. + pub fn send(&self, client: &stripe::Client, id: &stripe_treasury::treasury_inbound_transfers_resource_inbound_transfer::TreasuryInboundTransferId) -> stripe::Response { + client.send_form(&format!("/test_helpers/treasury/inbound_transfers/{id}/fail"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReturnInboundTransferTreasuryInboundTransfersResourceInboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ReturnInboundTransferTreasuryInboundTransfersResourceInboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ReturnInboundTransferTreasuryInboundTransfersResourceInboundTransfer<'a> { + /// Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. + /// + /// The InboundTransfer must already be in the `succeeded` state. + pub fn send(&self, client: &stripe::Client, id: &stripe_treasury::treasury_inbound_transfers_resource_inbound_transfer::TreasuryInboundTransferId) -> stripe::Response { + client.send_form(&format!("/test_helpers/treasury/inbound_transfers/{id}/return"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer_resource_linked_flows/mod.rs b/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer_resource_linked_flows/mod.rs new file mode 100644 index 000000000..cb81ee4fa --- /dev/null +++ b/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer_resource_linked_flows/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryInboundTransfersResourceInboundTransferResourceLinkedFlows { + /// If funds for this flow were returned after the flow went to the `succeeded` state, this field contains a reference to the ReceivedDebit return. + pub received_debit: Option, +} diff --git a/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer_resource_status_transitions/mod.rs b/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer_resource_status_transitions/mod.rs new file mode 100644 index 000000000..2f044fd44 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer_resource_status_transitions/mod.rs @@ -0,0 +1,10 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryInboundTransfersResourceInboundTransferResourceStatusTransitions { + /// Timestamp describing when an InboundTransfer changed status to `canceled`. + #[serde(skip_serializing_if = "Option::is_none")] + pub canceled_at: Option, + /// Timestamp describing when an InboundTransfer changed status to `failed`. + pub failed_at: Option, + /// Timestamp describing when an InboundTransfer changed status to `succeeded`. + pub succeeded_at: Option, +} diff --git a/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment/mod.rs b/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment/mod.rs new file mode 100644 index 000000000..752631b07 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment/mod.rs @@ -0,0 +1,144 @@ +/// Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). +/// +/// To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. +/// These methods can only be called on test mode objects. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryOutboundPaymentsResourceOutboundPayment { + /// Amount (in cents) transferred. + pub amount: i64, + /// Returns `true` if the object can be canceled, and `false` otherwise. + pub cancelable: bool, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the [customer](https://stripe.com/docs/api/customers) to whom an OutboundPayment is sent. + pub customer: Option, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// The PaymentMethod via which an OutboundPayment is sent. + /// + /// This field can be empty if the OutboundPayment was created using `destination_payment_method_data`. + pub destination_payment_method: Option, + /// Details about the PaymentMethod for an OutboundPayment. + pub destination_payment_method_details: Option, + /// Details about the end user. + pub end_user_details: Option, + /// The date when funds are expected to arrive in the destination account. + pub expected_arrival_date: stripe_types::Timestamp, + /// The FinancialAccount that funds were pulled from. + pub financial_account: String, + /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + pub hosted_regulatory_receipt_url: Option, + /// Unique identifier for the object. + pub id: stripe_treasury::treasury_outbound_payments_resource_outbound_payment::TreasuryOutboundPaymentId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Details about a returned OutboundPayment. + /// + /// Only set when the status is `returned`. + pub returned_details: Option, + /// The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer). + pub statement_descriptor: String, + /// Current status of the OutboundPayment: `processing`, `failed`, `posted`, `returned`, `canceled`. + /// + /// An OutboundPayment is `processing` if it has been created and is pending. + /// The status changes to `posted` once the OutboundPayment has been "confirmed" and funds have left the account, or to `failed` or `canceled`. + /// If an OutboundPayment fails to arrive at its destination, its status will change to `returned`. + pub status: TreasuryOutboundPaymentsResourceOutboundPaymentStatus, + pub status_transitions: stripe_treasury::TreasuryOutboundPaymentsResourceOutboundPaymentResourceStatusTransitions, + /// The Transaction associated with this object. + pub transaction: stripe_types::Expandable, +} +/// Current status of the OutboundPayment: `processing`, `failed`, `posted`, `returned`, `canceled`. +/// +/// An OutboundPayment is `processing` if it has been created and is pending. +/// The status changes to `posted` once the OutboundPayment has been "confirmed" and funds have left the account, or to `failed` or `canceled`. +/// If an OutboundPayment fails to arrive at its destination, its status will change to `returned`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryOutboundPaymentsResourceOutboundPaymentStatus { + Canceled, + Failed, + Posted, + Processing, + Returned, +} +impl TreasuryOutboundPaymentsResourceOutboundPaymentStatus { + pub fn as_str(self) -> &'static str { + use TreasuryOutboundPaymentsResourceOutboundPaymentStatus::*; + match self { + Canceled => "canceled", + Failed => "failed", + Posted => "posted", + Processing => "processing", + Returned => "returned", + } + } +} + +impl std::str::FromStr for TreasuryOutboundPaymentsResourceOutboundPaymentStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryOutboundPaymentsResourceOutboundPaymentStatus::*; + match s { + "canceled" => Ok(Canceled), + "failed" => Ok(Failed), + "posted" => Ok(Posted), + "processing" => Ok(Processing), + "returned" => Ok(Returned), + _ => Err(()), + } + } +} +impl AsRef for TreasuryOutboundPaymentsResourceOutboundPaymentStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryOutboundPaymentsResourceOutboundPaymentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryOutboundPaymentsResourceOutboundPaymentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryOutboundPaymentsResourceOutboundPaymentStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryOutboundPaymentsResourceOutboundPaymentStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryOutboundPaymentsResourceOutboundPaymentStatus")) + } +} +impl stripe_types::Object for TreasuryOutboundPaymentsResourceOutboundPayment { + type Id = stripe_treasury::treasury_outbound_payments_resource_outbound_payment::TreasuryOutboundPaymentId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TreasuryOutboundPaymentId); +#[cfg(feature = "treasury_outbound_payments_resource_outbound_payment")] +mod requests; +#[cfg(feature = "treasury_outbound_payments_resource_outbound_payment")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment/requests.rs b/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment/requests.rs new file mode 100644 index 000000000..87fbdce06 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment/requests.rs @@ -0,0 +1,728 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + /// Amount (in cents) to be transferred. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the customer to whom the OutboundPayment is sent. + /// + /// Must match the Customer attached to the `destination_payment_method` passed in. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The PaymentMethod to use as the payment instrument for the OutboundPayment. + /// + /// Exclusive with `destination_payment_method_data`. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination_payment_method: Option<&'a str>, + /// Hash used to generate the PaymentMethod to be used for this OutboundPayment. + /// + /// Exclusive with `destination_payment_method`. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination_payment_method_data: Option>, + /// Payment method-specific configuration for this OutboundPayment. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination_payment_method_options: Option, + /// End user details. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_user_details: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The FinancialAccount to pull funds from. + pub financial_account: &'a str, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The description that appears on the receiving end for this OutboundPayment (for example, bank statement for external bank transfer). + /// + /// Maximum 10 characters for `ach` payments, 140 characters for `wire` payments, or 500 characters for `stripe` network transfers. + /// The default value is `payment`. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, +} +impl<'a> CreateTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency, financial_account: &'a str) -> Self { + Self { + amount, + currency, + customer: Default::default(), + description: Default::default(), + destination_payment_method: Default::default(), + destination_payment_method_data: Default::default(), + destination_payment_method_options: Default::default(), + end_user_details: Default::default(), + expand: Default::default(), + financial_account, + metadata: Default::default(), + statement_descriptor: Default::default(), + } + } +} +/// Hash used to generate the PaymentMethod to be used for this OutboundPayment. +/// +/// Exclusive with `destination_payment_method`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodData<'a> { + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: Option>, + /// Required if type is set to `financial_account`. + /// + /// The FinancialAccount ID to send funds to. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_account: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The type of the PaymentMethod. + /// + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + pub type_: CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataType, + /// Required hash if type is set to `us_bank_account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, +} +impl<'a> CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodData<'a> { + pub fn new(type_: CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataType) -> Self { + Self { billing_details: Default::default(), financial_account: Default::default(), metadata: Default::default(), type_, us_bank_account: Default::default() } + } +} +/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataBillingDetails<'a> { + /// Billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Billing phone number (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataBillingDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataBillingDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataBillingDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of the PaymentMethod. +/// +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataType { + FinancialAccount, + UsBankAccount, +} +impl CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataType { + pub fn as_str(self) -> &'static str { + use CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataType::*; + match self { + FinancialAccount => "financial_account", + UsBankAccount => "us_bank_account", + } + } +} + +impl std::str::FromStr for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataType::*; + match s { + "financial_account" => Ok(FinancialAccount), + "us_bank_account" => Ok(UsBankAccount), + _ => Err(()), + } + } +} +impl AsRef for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Required hash if type is set to `us_bank_account`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccount<'a> { + /// Account holder type: individual or company. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// Account number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Account type: checkings or savings. + /// + /// Defaults to checking if omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// The ID of a Financial Connections Account to use as a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections_account: Option<&'a str>, + /// Routing number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType { + Company, + Individual, +} +impl CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Account type: checkings or savings. +/// +/// Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountType { + Checking, + Savings, +} +impl CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl AsRef for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment method-specific configuration for this OutboundPayment. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodOptions { + /// Optional fields for `us_bank_account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} +impl CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodOptions { + pub fn new() -> Self { + Self::default() + } +} +/// Optional fields for `us_bank_account`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodOptionsUsBankAccount { + /// The US bank account network that must be used for this OutboundPayment. + /// + /// If not set, we will default to the PaymentMethod's preferred network. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, +} +impl CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodOptionsUsBankAccount { + pub fn new() -> Self { + Self::default() + } +} +/// The US bank account network that must be used for this OutboundPayment. +/// +/// If not set, we will default to the PaymentMethod's preferred network. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodOptionsUsBankAccountNetwork { + Ach, + UsDomesticWire, +} +impl CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodOptionsUsBankAccountNetwork { + pub fn as_str(self) -> &'static str { + use CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodOptionsUsBankAccountNetwork::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodOptionsUsBankAccountNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodOptionsUsBankAccountNetwork::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl AsRef for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodOptionsUsBankAccountNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodOptionsUsBankAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodOptionsUsBankAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryOutboundPaymentsResourceOutboundPaymentDestinationPaymentMethodOptionsUsBankAccountNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// End user details. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryOutboundPaymentsResourceOutboundPaymentEndUserDetails<'a> { + /// IP address of the user initiating the OutboundPayment. + /// + /// Must be supplied if `present` is set to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_address: Option<&'a str>, + /// `True` if the OutboundPayment creation request is being made on behalf of an end user by a platform. + /// + /// Otherwise, `false`. + pub present: bool, +} +impl<'a> CreateTreasuryOutboundPaymentsResourceOutboundPaymentEndUserDetails<'a> { + pub fn new(present: bool) -> Self { + Self { ip_address: Default::default(), present } + } +} +impl<'a> CreateTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + /// Creates an OutboundPayment. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/treasury/outbound_payments", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + /// Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list. + pub fn send(&self, client: &stripe::Client, id: &stripe_treasury::treasury_outbound_payments_resource_outbound_payment::TreasuryOutboundPaymentId) -> stripe::Response { + client.get_query(&format!("/treasury/outbound_payments/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + /// Only return OutboundPayments sent to this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Returns objects associated with this FinancialAccount. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return OutboundPayments that have the given status: `processing`, `failed`, `posted`, `returned`, or `canceled`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { customer: Default::default(), ending_before: Default::default(), expand: Default::default(), financial_account, limit: Default::default(), starting_after: Default::default(), status: Default::default() } + } +} +/// Only return OutboundPayments that have the given status: `processing`, `failed`, `posted`, `returned`, or `canceled`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTreasuryOutboundPaymentsResourceOutboundPaymentStatus { + Canceled, + Failed, + Posted, + Processing, + Returned, +} +impl ListTreasuryOutboundPaymentsResourceOutboundPaymentStatus { + pub fn as_str(self) -> &'static str { + use ListTreasuryOutboundPaymentsResourceOutboundPaymentStatus::*; + match self { + Canceled => "canceled", + Failed => "failed", + Posted => "posted", + Processing => "processing", + Returned => "returned", + } + } +} + +impl std::str::FromStr for ListTreasuryOutboundPaymentsResourceOutboundPaymentStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTreasuryOutboundPaymentsResourceOutboundPaymentStatus::*; + match s { + "canceled" => Ok(Canceled), + "failed" => Ok(Failed), + "posted" => Ok(Posted), + "processing" => Ok(Processing), + "returned" => Ok(Returned), + _ => Err(()), + } + } +} +impl AsRef for ListTreasuryOutboundPaymentsResourceOutboundPaymentStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListTreasuryOutboundPaymentsResourceOutboundPaymentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTreasuryOutboundPaymentsResourceOutboundPaymentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTreasuryOutboundPaymentsResourceOutboundPaymentStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + /// Returns a list of OutboundPayments sent from the specified FinancialAccount. + pub fn send(&self, client: &stripe::Client) -> stripe::Response> { + client.get_query("/treasury/outbound_payments", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/treasury/outbound_payments", self) + } +} +impl<'a> stripe::PaginationParams for ListTreasuryOutboundPaymentsResourceOutboundPayment<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + /// Cancel an OutboundPayment. + pub fn send(&self, client: &stripe::Client, id: &stripe_treasury::treasury_outbound_payments_resource_outbound_payment::TreasuryOutboundPaymentId) -> stripe::Response { + client.send_form(&format!("/treasury/outbound_payments/{id}/cancel"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct FailTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> FailTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> FailTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + /// Transitions a test mode created OutboundPayment to the `failed` status. + /// + /// The OutboundPayment must already be in the `processing` state. + pub fn send(&self, client: &stripe::Client, id: &stripe_treasury::treasury_outbound_payments_resource_outbound_payment::TreasuryOutboundPaymentId) -> stripe::Response { + client.send_form(&format!("/test_helpers/treasury/outbound_payments/{id}/fail"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PostTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> PostTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> PostTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + /// Transitions a test mode created OutboundPayment to the `posted` status. + /// + /// The OutboundPayment must already be in the `processing` state. + pub fn send(&self, client: &stripe::Client, id: &stripe_treasury::treasury_outbound_payments_resource_outbound_payment::TreasuryOutboundPaymentId) -> stripe::Response { + client.send_form(&format!("/test_helpers/treasury/outbound_payments/{id}/post"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReturnOutboundPaymentTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Optional hash to set the the return code. + #[serde(skip_serializing_if = "Option::is_none")] + pub returned_details: Option, +} +impl<'a> ReturnOutboundPaymentTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Optional hash to set the the return code. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReturnOutboundPaymentTreasuryOutboundPaymentsResourceOutboundPaymentReturnedDetails { + /// The return code to be set on the OutboundPayment object. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option, +} +impl ReturnOutboundPaymentTreasuryOutboundPaymentsResourceOutboundPaymentReturnedDetails { + pub fn new() -> Self { + Self::default() + } +} +/// The return code to be set on the OutboundPayment object. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ReturnOutboundPaymentTreasuryOutboundPaymentsResourceOutboundPaymentReturnedDetailsCode { + AccountClosed, + AccountFrozen, + BankAccountRestricted, + BankOwnershipChanged, + Declined, + IncorrectAccountHolderName, + InvalidAccountNumber, + InvalidCurrency, + NoAccount, + Other, +} +impl ReturnOutboundPaymentTreasuryOutboundPaymentsResourceOutboundPaymentReturnedDetailsCode { + pub fn as_str(self) -> &'static str { + use ReturnOutboundPaymentTreasuryOutboundPaymentsResourceOutboundPaymentReturnedDetailsCode::*; + match self { + AccountClosed => "account_closed", + AccountFrozen => "account_frozen", + BankAccountRestricted => "bank_account_restricted", + BankOwnershipChanged => "bank_ownership_changed", + Declined => "declined", + IncorrectAccountHolderName => "incorrect_account_holder_name", + InvalidAccountNumber => "invalid_account_number", + InvalidCurrency => "invalid_currency", + NoAccount => "no_account", + Other => "other", + } + } +} + +impl std::str::FromStr for ReturnOutboundPaymentTreasuryOutboundPaymentsResourceOutboundPaymentReturnedDetailsCode { + type Err = (); + fn from_str(s: &str) -> Result { + use ReturnOutboundPaymentTreasuryOutboundPaymentsResourceOutboundPaymentReturnedDetailsCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_frozen" => Ok(AccountFrozen), + "bank_account_restricted" => Ok(BankAccountRestricted), + "bank_ownership_changed" => Ok(BankOwnershipChanged), + "declined" => Ok(Declined), + "incorrect_account_holder_name" => Ok(IncorrectAccountHolderName), + "invalid_account_number" => Ok(InvalidAccountNumber), + "invalid_currency" => Ok(InvalidCurrency), + "no_account" => Ok(NoAccount), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl AsRef for ReturnOutboundPaymentTreasuryOutboundPaymentsResourceOutboundPaymentReturnedDetailsCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ReturnOutboundPaymentTreasuryOutboundPaymentsResourceOutboundPaymentReturnedDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ReturnOutboundPaymentTreasuryOutboundPaymentsResourceOutboundPaymentReturnedDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ReturnOutboundPaymentTreasuryOutboundPaymentsResourceOutboundPaymentReturnedDetailsCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ReturnOutboundPaymentTreasuryOutboundPaymentsResourceOutboundPayment<'a> { + /// Transitions a test mode created OutboundPayment to the `returned` status. + /// + /// The OutboundPayment must already be in the `processing` state. + pub fn send(&self, client: &stripe::Client, id: &stripe_treasury::treasury_outbound_payments_resource_outbound_payment::TreasuryOutboundPaymentId) -> stripe::Response { + client.send_form(&format!("/test_helpers/treasury/outbound_payments/{id}/return"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment_resource_end_user_details/mod.rs b/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment_resource_end_user_details/mod.rs new file mode 100644 index 000000000..0099fe4f6 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment_resource_end_user_details/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryOutboundPaymentsResourceOutboundPaymentResourceEndUserDetails { + /// IP address of the user initiating the OutboundPayment. + /// + /// Set if `present` is set to `true`. + /// IP address collection is required for risk and compliance reasons. + /// This will be used to help determine if the OutboundPayment is authorized or should be blocked. + pub ip_address: Option, + /// `true` if the OutboundPayment creation request is being made on behalf of an end user by a platform. + /// + /// Otherwise, `false`. + pub present: bool, +} diff --git a/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment_resource_status_transitions/mod.rs b/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment_resource_status_transitions/mod.rs new file mode 100644 index 000000000..7a1a3d797 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment_resource_status_transitions/mod.rs @@ -0,0 +1,11 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryOutboundPaymentsResourceOutboundPaymentResourceStatusTransitions { + /// Timestamp describing when an OutboundPayment changed status to `canceled`. + pub canceled_at: Option, + /// Timestamp describing when an OutboundPayment changed status to `failed`. + pub failed_at: Option, + /// Timestamp describing when an OutboundPayment changed status to `posted`. + pub posted_at: Option, + /// Timestamp describing when an OutboundPayment changed status to `returned`. + pub returned_at: Option, +} diff --git a/generated/stripe_treasury/src/treasury_outbound_payments_resource_returned_status/mod.rs b/generated/stripe_treasury/src/treasury_outbound_payments_resource_returned_status/mod.rs new file mode 100644 index 000000000..c9bdf49f8 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_payments_resource_returned_status/mod.rs @@ -0,0 +1,89 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryOutboundPaymentsResourceReturnedStatus { + /// Reason for the return. + pub code: TreasuryOutboundPaymentsResourceReturnedStatusCode, + /// The Transaction associated with this object. + pub transaction: stripe_types::Expandable, +} +/// Reason for the return. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryOutboundPaymentsResourceReturnedStatusCode { + AccountClosed, + AccountFrozen, + BankAccountRestricted, + BankOwnershipChanged, + Declined, + IncorrectAccountHolderName, + InvalidAccountNumber, + InvalidCurrency, + NoAccount, + Other, +} +impl TreasuryOutboundPaymentsResourceReturnedStatusCode { + pub fn as_str(self) -> &'static str { + use TreasuryOutboundPaymentsResourceReturnedStatusCode::*; + match self { + AccountClosed => "account_closed", + AccountFrozen => "account_frozen", + BankAccountRestricted => "bank_account_restricted", + BankOwnershipChanged => "bank_ownership_changed", + Declined => "declined", + IncorrectAccountHolderName => "incorrect_account_holder_name", + InvalidAccountNumber => "invalid_account_number", + InvalidCurrency => "invalid_currency", + NoAccount => "no_account", + Other => "other", + } + } +} + +impl std::str::FromStr for TreasuryOutboundPaymentsResourceReturnedStatusCode { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryOutboundPaymentsResourceReturnedStatusCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_frozen" => Ok(AccountFrozen), + "bank_account_restricted" => Ok(BankAccountRestricted), + "bank_ownership_changed" => Ok(BankOwnershipChanged), + "declined" => Ok(Declined), + "incorrect_account_holder_name" => Ok(IncorrectAccountHolderName), + "invalid_account_number" => Ok(InvalidAccountNumber), + "invalid_currency" => Ok(InvalidCurrency), + "no_account" => Ok(NoAccount), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl AsRef for TreasuryOutboundPaymentsResourceReturnedStatusCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryOutboundPaymentsResourceReturnedStatusCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryOutboundPaymentsResourceReturnedStatusCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryOutboundPaymentsResourceReturnedStatusCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryOutboundPaymentsResourceReturnedStatusCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryOutboundPaymentsResourceReturnedStatusCode")) + } +} diff --git a/generated/stripe_treasury/src/treasury_outbound_transfers_resource_outbound_transfer/mod.rs b/generated/stripe_treasury/src/treasury_outbound_transfers_resource_outbound_transfer/mod.rs new file mode 100644 index 000000000..6e3b400ad --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_transfers_resource_outbound_transfer/mod.rs @@ -0,0 +1,138 @@ +/// Use OutboundTransfers to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. +/// +/// To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. +/// You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. +/// These methods can only be called on test mode objects. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryOutboundTransfersResourceOutboundTransfer { + /// Amount (in cents) transferred. + pub amount: i64, + /// Returns `true` if the object can be canceled, and `false` otherwise. + pub cancelable: bool, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// The PaymentMethod used as the payment instrument for an OutboundTransfer. + pub destination_payment_method: Option, + pub destination_payment_method_details: stripe_treasury::OutboundTransfersPaymentMethodDetails, + /// The date when funds are expected to arrive in the destination account. + pub expected_arrival_date: stripe_types::Timestamp, + /// The FinancialAccount that funds were pulled from. + pub financial_account: String, + /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + pub hosted_regulatory_receipt_url: Option, + /// Unique identifier for the object. + pub id: stripe_treasury::treasury_outbound_transfers_resource_outbound_transfer::TreasuryOutboundTransferId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Details about a returned OutboundTransfer. + /// + /// Only set when the status is `returned`. + pub returned_details: Option, + /// Information about the OutboundTransfer to be sent to the recipient account. + pub statement_descriptor: String, + /// Current status of the OutboundTransfer: `processing`, `failed`, `canceled`, `posted`, `returned`. + /// + /// An OutboundTransfer is `processing` if it has been created and is pending. + /// The status changes to `posted` once the OutboundTransfer has been "confirmed" and funds have left the account, or to `failed` or `canceled`. + /// If an OutboundTransfer fails to arrive at its destination, its status will change to `returned`. + pub status: TreasuryOutboundTransfersResourceOutboundTransferStatus, + pub status_transitions: stripe_treasury::TreasuryOutboundTransfersResourceStatusTransitions, + /// The Transaction associated with this object. + pub transaction: stripe_types::Expandable, +} +/// Current status of the OutboundTransfer: `processing`, `failed`, `canceled`, `posted`, `returned`. +/// +/// An OutboundTransfer is `processing` if it has been created and is pending. +/// The status changes to `posted` once the OutboundTransfer has been "confirmed" and funds have left the account, or to `failed` or `canceled`. +/// If an OutboundTransfer fails to arrive at its destination, its status will change to `returned`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryOutboundTransfersResourceOutboundTransferStatus { + Canceled, + Failed, + Posted, + Processing, + Returned, +} +impl TreasuryOutboundTransfersResourceOutboundTransferStatus { + pub fn as_str(self) -> &'static str { + use TreasuryOutboundTransfersResourceOutboundTransferStatus::*; + match self { + Canceled => "canceled", + Failed => "failed", + Posted => "posted", + Processing => "processing", + Returned => "returned", + } + } +} + +impl std::str::FromStr for TreasuryOutboundTransfersResourceOutboundTransferStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryOutboundTransfersResourceOutboundTransferStatus::*; + match s { + "canceled" => Ok(Canceled), + "failed" => Ok(Failed), + "posted" => Ok(Posted), + "processing" => Ok(Processing), + "returned" => Ok(Returned), + _ => Err(()), + } + } +} +impl AsRef for TreasuryOutboundTransfersResourceOutboundTransferStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryOutboundTransfersResourceOutboundTransferStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryOutboundTransfersResourceOutboundTransferStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryOutboundTransfersResourceOutboundTransferStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryOutboundTransfersResourceOutboundTransferStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryOutboundTransfersResourceOutboundTransferStatus")) + } +} +impl stripe_types::Object for TreasuryOutboundTransfersResourceOutboundTransfer { + type Id = stripe_treasury::treasury_outbound_transfers_resource_outbound_transfer::TreasuryOutboundTransferId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TreasuryOutboundTransferId); +#[cfg(feature = "treasury_outbound_transfers_resource_outbound_transfer")] +mod requests; +#[cfg(feature = "treasury_outbound_transfers_resource_outbound_transfer")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_outbound_transfers_resource_outbound_transfer/requests.rs b/generated/stripe_treasury/src/treasury_outbound_transfers_resource_outbound_transfer/requests.rs new file mode 100644 index 000000000..8f5116630 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_transfers_resource_outbound_transfer/requests.rs @@ -0,0 +1,418 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + /// Amount (in cents) to be transferred. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The PaymentMethod to use as the payment instrument for the OutboundTransfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination_payment_method: Option<&'a str>, + /// Hash describing payment method configuration details. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination_payment_method_options: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The FinancialAccount to pull funds from. + pub financial_account: &'a str, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Statement descriptor to be shown on the receiving end of an OutboundTransfer. + /// + /// Maximum 10 characters for `ach` transfers or 140 characters for `wire` transfers. + /// The default value is `transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, +} +impl<'a> CreateTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency, financial_account: &'a str) -> Self { + Self { + amount, + currency, + description: Default::default(), + destination_payment_method: Default::default(), + destination_payment_method_options: Default::default(), + expand: Default::default(), + financial_account, + metadata: Default::default(), + statement_descriptor: Default::default(), + } + } +} +/// Hash describing payment method configuration details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryOutboundTransfersResourceOutboundTransferDestinationPaymentMethodOptions { + /// Optional fields for `us_bank_account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} +impl CreateTreasuryOutboundTransfersResourceOutboundTransferDestinationPaymentMethodOptions { + pub fn new() -> Self { + Self::default() + } +} +/// Optional fields for `us_bank_account`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryOutboundTransfersResourceOutboundTransferDestinationPaymentMethodOptionsUsBankAccount { + /// Designate the OutboundTransfer as using a US bank account network configuration. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, +} +impl CreateTreasuryOutboundTransfersResourceOutboundTransferDestinationPaymentMethodOptionsUsBankAccount { + pub fn new() -> Self { + Self::default() + } +} +/// Designate the OutboundTransfer as using a US bank account network configuration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryOutboundTransfersResourceOutboundTransferDestinationPaymentMethodOptionsUsBankAccountNetwork { + Ach, + UsDomesticWire, +} +impl CreateTreasuryOutboundTransfersResourceOutboundTransferDestinationPaymentMethodOptionsUsBankAccountNetwork { + pub fn as_str(self) -> &'static str { + use CreateTreasuryOutboundTransfersResourceOutboundTransferDestinationPaymentMethodOptionsUsBankAccountNetwork::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for CreateTreasuryOutboundTransfersResourceOutboundTransferDestinationPaymentMethodOptionsUsBankAccountNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryOutboundTransfersResourceOutboundTransferDestinationPaymentMethodOptionsUsBankAccountNetwork::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl AsRef for CreateTreasuryOutboundTransfersResourceOutboundTransferDestinationPaymentMethodOptionsUsBankAccountNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTreasuryOutboundTransfersResourceOutboundTransferDestinationPaymentMethodOptionsUsBankAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryOutboundTransfersResourceOutboundTransferDestinationPaymentMethodOptionsUsBankAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryOutboundTransfersResourceOutboundTransferDestinationPaymentMethodOptionsUsBankAccountNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + /// Creates an OutboundTransfer. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/treasury/outbound_transfers", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + /// Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list. + pub fn send(&self, client: &stripe::Client, outbound_transfer: &str) -> stripe::Response { + client.get_query(&format!("/treasury/outbound_transfers/{outbound_transfer}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Returns objects associated with this FinancialAccount. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return OutboundTransfers that have the given status: `processing`, `canceled`, `failed`, `posted`, or `returned`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { ending_before: Default::default(), expand: Default::default(), financial_account, limit: Default::default(), starting_after: Default::default(), status: Default::default() } + } +} +/// Only return OutboundTransfers that have the given status: `processing`, `canceled`, `failed`, `posted`, or `returned`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTreasuryOutboundTransfersResourceOutboundTransferStatus { + Canceled, + Failed, + Posted, + Processing, + Returned, +} +impl ListTreasuryOutboundTransfersResourceOutboundTransferStatus { + pub fn as_str(self) -> &'static str { + use ListTreasuryOutboundTransfersResourceOutboundTransferStatus::*; + match self { + Canceled => "canceled", + Failed => "failed", + Posted => "posted", + Processing => "processing", + Returned => "returned", + } + } +} + +impl std::str::FromStr for ListTreasuryOutboundTransfersResourceOutboundTransferStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTreasuryOutboundTransfersResourceOutboundTransferStatus::*; + match s { + "canceled" => Ok(Canceled), + "failed" => Ok(Failed), + "posted" => Ok(Posted), + "processing" => Ok(Processing), + "returned" => Ok(Returned), + _ => Err(()), + } + } +} +impl AsRef for ListTreasuryOutboundTransfersResourceOutboundTransferStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListTreasuryOutboundTransfersResourceOutboundTransferStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTreasuryOutboundTransfersResourceOutboundTransferStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTreasuryOutboundTransfersResourceOutboundTransferStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + /// Returns a list of OutboundTransfers sent from the specified FinancialAccount. + pub fn send(&self, client: &stripe::Client) -> stripe::Response> { + client.get_query("/treasury/outbound_transfers", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/treasury/outbound_transfers", self) + } +} +impl<'a> stripe::PaginationParams for ListTreasuryOutboundTransfersResourceOutboundTransfer<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + /// An OutboundTransfer can be canceled if the funds have not yet been paid out. + pub fn send(&self, client: &stripe::Client, outbound_transfer: &str) -> stripe::Response { + client.send_form(&format!("/treasury/outbound_transfers/{outbound_transfer}/cancel"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct FailTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> FailTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> FailTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + /// Transitions a test mode created OutboundTransfer to the `failed` status. + /// + /// The OutboundTransfer must already be in the `processing` state. + pub fn send(&self, client: &stripe::Client, outbound_transfer: &str) -> stripe::Response { + client.send_form(&format!("/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PostTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> PostTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> PostTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + /// Transitions a test mode created OutboundTransfer to the `posted` status. + /// + /// The OutboundTransfer must already be in the `processing` state. + pub fn send(&self, client: &stripe::Client, outbound_transfer: &str) -> stripe::Response { + client.send_form(&format!("/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReturnOutboundTransferTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Details about a returned OutboundTransfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub returned_details: Option, +} +impl<'a> ReturnOutboundTransferTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details about a returned OutboundTransfer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReturnOutboundTransferTreasuryOutboundTransfersResourceOutboundTransferReturnedDetails { + /// Reason for the return. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option, +} +impl ReturnOutboundTransferTreasuryOutboundTransfersResourceOutboundTransferReturnedDetails { + pub fn new() -> Self { + Self::default() + } +} +/// Reason for the return. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ReturnOutboundTransferTreasuryOutboundTransfersResourceOutboundTransferReturnedDetailsCode { + AccountClosed, + AccountFrozen, + BankAccountRestricted, + BankOwnershipChanged, + Declined, + IncorrectAccountHolderName, + InvalidAccountNumber, + InvalidCurrency, + NoAccount, + Other, +} +impl ReturnOutboundTransferTreasuryOutboundTransfersResourceOutboundTransferReturnedDetailsCode { + pub fn as_str(self) -> &'static str { + use ReturnOutboundTransferTreasuryOutboundTransfersResourceOutboundTransferReturnedDetailsCode::*; + match self { + AccountClosed => "account_closed", + AccountFrozen => "account_frozen", + BankAccountRestricted => "bank_account_restricted", + BankOwnershipChanged => "bank_ownership_changed", + Declined => "declined", + IncorrectAccountHolderName => "incorrect_account_holder_name", + InvalidAccountNumber => "invalid_account_number", + InvalidCurrency => "invalid_currency", + NoAccount => "no_account", + Other => "other", + } + } +} + +impl std::str::FromStr for ReturnOutboundTransferTreasuryOutboundTransfersResourceOutboundTransferReturnedDetailsCode { + type Err = (); + fn from_str(s: &str) -> Result { + use ReturnOutboundTransferTreasuryOutboundTransfersResourceOutboundTransferReturnedDetailsCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_frozen" => Ok(AccountFrozen), + "bank_account_restricted" => Ok(BankAccountRestricted), + "bank_ownership_changed" => Ok(BankOwnershipChanged), + "declined" => Ok(Declined), + "incorrect_account_holder_name" => Ok(IncorrectAccountHolderName), + "invalid_account_number" => Ok(InvalidAccountNumber), + "invalid_currency" => Ok(InvalidCurrency), + "no_account" => Ok(NoAccount), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl AsRef for ReturnOutboundTransferTreasuryOutboundTransfersResourceOutboundTransferReturnedDetailsCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ReturnOutboundTransferTreasuryOutboundTransfersResourceOutboundTransferReturnedDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ReturnOutboundTransferTreasuryOutboundTransfersResourceOutboundTransferReturnedDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ReturnOutboundTransferTreasuryOutboundTransfersResourceOutboundTransferReturnedDetailsCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ReturnOutboundTransferTreasuryOutboundTransfersResourceOutboundTransfer<'a> { + /// Transitions a test mode created OutboundTransfer to the `returned` status. + /// + /// The OutboundTransfer must already be in the `processing` state. + pub fn send(&self, client: &stripe::Client, outbound_transfer: &str) -> stripe::Response { + client.send_form(&format!("/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_treasury/src/treasury_outbound_transfers_resource_returned_details/mod.rs b/generated/stripe_treasury/src/treasury_outbound_transfers_resource_returned_details/mod.rs new file mode 100644 index 000000000..218e75ae7 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_transfers_resource_returned_details/mod.rs @@ -0,0 +1,89 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryOutboundTransfersResourceReturnedDetails { + /// Reason for the return. + pub code: TreasuryOutboundTransfersResourceReturnedDetailsCode, + /// The Transaction associated with this object. + pub transaction: stripe_types::Expandable, +} +/// Reason for the return. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryOutboundTransfersResourceReturnedDetailsCode { + AccountClosed, + AccountFrozen, + BankAccountRestricted, + BankOwnershipChanged, + Declined, + IncorrectAccountHolderName, + InvalidAccountNumber, + InvalidCurrency, + NoAccount, + Other, +} +impl TreasuryOutboundTransfersResourceReturnedDetailsCode { + pub fn as_str(self) -> &'static str { + use TreasuryOutboundTransfersResourceReturnedDetailsCode::*; + match self { + AccountClosed => "account_closed", + AccountFrozen => "account_frozen", + BankAccountRestricted => "bank_account_restricted", + BankOwnershipChanged => "bank_ownership_changed", + Declined => "declined", + IncorrectAccountHolderName => "incorrect_account_holder_name", + InvalidAccountNumber => "invalid_account_number", + InvalidCurrency => "invalid_currency", + NoAccount => "no_account", + Other => "other", + } + } +} + +impl std::str::FromStr for TreasuryOutboundTransfersResourceReturnedDetailsCode { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryOutboundTransfersResourceReturnedDetailsCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_frozen" => Ok(AccountFrozen), + "bank_account_restricted" => Ok(BankAccountRestricted), + "bank_ownership_changed" => Ok(BankOwnershipChanged), + "declined" => Ok(Declined), + "incorrect_account_holder_name" => Ok(IncorrectAccountHolderName), + "invalid_account_number" => Ok(InvalidAccountNumber), + "invalid_currency" => Ok(InvalidCurrency), + "no_account" => Ok(NoAccount), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl AsRef for TreasuryOutboundTransfersResourceReturnedDetailsCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryOutboundTransfersResourceReturnedDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryOutboundTransfersResourceReturnedDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryOutboundTransfersResourceReturnedDetailsCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryOutboundTransfersResourceReturnedDetailsCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryOutboundTransfersResourceReturnedDetailsCode")) + } +} diff --git a/generated/stripe_treasury/src/treasury_outbound_transfers_resource_status_transitions/mod.rs b/generated/stripe_treasury/src/treasury_outbound_transfers_resource_status_transitions/mod.rs new file mode 100644 index 000000000..5abf1724d --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_transfers_resource_status_transitions/mod.rs @@ -0,0 +1,11 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryOutboundTransfersResourceStatusTransitions { + /// Timestamp describing when an OutboundTransfer changed status to `canceled`. + pub canceled_at: Option, + /// Timestamp describing when an OutboundTransfer changed status to `failed`. + pub failed_at: Option, + /// Timestamp describing when an OutboundTransfer changed status to `posted`. + pub posted_at: Option, + /// Timestamp describing when an OutboundTransfer changed status to `returned`. + pub returned_at: Option, +} diff --git a/generated/stripe_treasury/src/treasury_received_credits_resource_credit_reversal/mod.rs b/generated/stripe_treasury/src/treasury_received_credits_resource_credit_reversal/mod.rs new file mode 100644 index 000000000..2d386570b --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_credits_resource_credit_reversal/mod.rs @@ -0,0 +1,167 @@ +/// You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. +/// +/// Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedCreditsResourceCreditReversal { + /// Amount (in cents) transferred. + pub amount: i64, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The FinancialAccount to reverse funds from. + pub financial_account: String, + /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + pub hosted_regulatory_receipt_url: Option, + /// Unique identifier for the object. + pub id: stripe_treasury::treasury_received_credits_resource_credit_reversal::TreasuryCreditReversalId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The rails used to reverse the funds. + pub network: TreasuryReceivedCreditsResourceCreditReversalNetwork, + /// The ReceivedCredit being reversed. + pub received_credit: String, + /// Status of the CreditReversal. + pub status: TreasuryReceivedCreditsResourceCreditReversalStatus, + pub status_transitions: stripe_treasury::TreasuryReceivedCreditsResourceStatusTransitions, + /// The Transaction associated with this object. + pub transaction: Option>, +} +/// The rails used to reverse the funds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedCreditsResourceCreditReversalNetwork { + Ach, + Stripe, +} +impl TreasuryReceivedCreditsResourceCreditReversalNetwork { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedCreditsResourceCreditReversalNetwork::*; + match self { + Ach => "ach", + Stripe => "stripe", + } + } +} + +impl std::str::FromStr for TreasuryReceivedCreditsResourceCreditReversalNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedCreditsResourceCreditReversalNetwork::*; + match s { + "ach" => Ok(Ach), + "stripe" => Ok(Stripe), + _ => Err(()), + } + } +} +impl AsRef for TreasuryReceivedCreditsResourceCreditReversalNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryReceivedCreditsResourceCreditReversalNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedCreditsResourceCreditReversalNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedCreditsResourceCreditReversalNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedCreditsResourceCreditReversalNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryReceivedCreditsResourceCreditReversalNetwork")) + } +} +/// Status of the CreditReversal. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedCreditsResourceCreditReversalStatus { + Canceled, + Posted, + Processing, +} +impl TreasuryReceivedCreditsResourceCreditReversalStatus { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedCreditsResourceCreditReversalStatus::*; + match self { + Canceled => "canceled", + Posted => "posted", + Processing => "processing", + } + } +} + +impl std::str::FromStr for TreasuryReceivedCreditsResourceCreditReversalStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedCreditsResourceCreditReversalStatus::*; + match s { + "canceled" => Ok(Canceled), + "posted" => Ok(Posted), + "processing" => Ok(Processing), + _ => Err(()), + } + } +} +impl AsRef for TreasuryReceivedCreditsResourceCreditReversalStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryReceivedCreditsResourceCreditReversalStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedCreditsResourceCreditReversalStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedCreditsResourceCreditReversalStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedCreditsResourceCreditReversalStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryReceivedCreditsResourceCreditReversalStatus")) + } +} +impl stripe_types::Object for TreasuryReceivedCreditsResourceCreditReversal { + type Id = stripe_treasury::treasury_received_credits_resource_credit_reversal::TreasuryCreditReversalId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TreasuryCreditReversalId); +#[cfg(feature = "treasury_received_credits_resource_credit_reversal")] +mod requests; +#[cfg(feature = "treasury_received_credits_resource_credit_reversal")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_received_credits_resource_credit_reversal/requests.rs b/generated/stripe_treasury/src/treasury_received_credits_resource_credit_reversal/requests.rs new file mode 100644 index 000000000..f5b0e9f08 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_credits_resource_credit_reversal/requests.rs @@ -0,0 +1,143 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryReceivedCreditsResourceCreditReversal<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Returns objects associated with this FinancialAccount. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return CreditReversals for the ReceivedCredit ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub received_credit: Option<&'a str>, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return CreditReversals for a given status. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTreasuryReceivedCreditsResourceCreditReversal<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { ending_before: Default::default(), expand: Default::default(), financial_account, limit: Default::default(), received_credit: Default::default(), starting_after: Default::default(), status: Default::default() } + } +} +/// Only return CreditReversals for a given status. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTreasuryReceivedCreditsResourceCreditReversalStatus { + Canceled, + Posted, + Processing, +} +impl ListTreasuryReceivedCreditsResourceCreditReversalStatus { + pub fn as_str(self) -> &'static str { + use ListTreasuryReceivedCreditsResourceCreditReversalStatus::*; + match self { + Canceled => "canceled", + Posted => "posted", + Processing => "processing", + } + } +} + +impl std::str::FromStr for ListTreasuryReceivedCreditsResourceCreditReversalStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTreasuryReceivedCreditsResourceCreditReversalStatus::*; + match s { + "canceled" => Ok(Canceled), + "posted" => Ok(Posted), + "processing" => Ok(Processing), + _ => Err(()), + } + } +} +impl AsRef for ListTreasuryReceivedCreditsResourceCreditReversalStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListTreasuryReceivedCreditsResourceCreditReversalStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTreasuryReceivedCreditsResourceCreditReversalStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTreasuryReceivedCreditsResourceCreditReversalStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListTreasuryReceivedCreditsResourceCreditReversal<'a> { + /// Returns a list of CreditReversals. + pub fn send(&self, client: &stripe::Client) -> stripe::Response> { + client.get_query("/treasury/credit_reversals", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/treasury/credit_reversals", self) + } +} +impl<'a> stripe::PaginationParams for ListTreasuryReceivedCreditsResourceCreditReversal<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryReceivedCreditsResourceCreditReversal<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryReceivedCreditsResourceCreditReversal<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryReceivedCreditsResourceCreditReversal<'a> { + /// Retrieves the details of an existing CreditReversal by passing the unique CreditReversal ID from either the CreditReversal creation request or CreditReversal list. + pub fn send(&self, client: &stripe::Client, credit_reversal: &str) -> stripe::Response { + client.get_query(&format!("/treasury/credit_reversals/{credit_reversal}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryReceivedCreditsResourceCreditReversal<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The ReceivedCredit to reverse. + pub received_credit: &'a str, +} +impl<'a> CreateTreasuryReceivedCreditsResourceCreditReversal<'a> { + pub fn new(received_credit: &'a str) -> Self { + Self { expand: Default::default(), metadata: Default::default(), received_credit } + } +} +impl<'a> CreateTreasuryReceivedCreditsResourceCreditReversal<'a> { + /// Reverses a ReceivedCredit and creates a CreditReversal object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/treasury/credit_reversals", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_treasury/src/treasury_received_credits_resource_linked_flows/mod.rs b/generated/stripe_treasury/src/treasury_received_credits_resource_linked_flows/mod.rs new file mode 100644 index 000000000..883c00ba0 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_credits_resource_linked_flows/mod.rs @@ -0,0 +1,18 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedCreditsResourceLinkedFlows { + /// The CreditReversal created as a result of this ReceivedCredit being reversed. + pub credit_reversal: Option, + /// Set if the ReceivedCredit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. + pub issuing_authorization: Option, + /// Set if the ReceivedCredit is also viewable as an [Issuing transaction](https://stripe.com/docs/api#issuing_transactions) object. + pub issuing_transaction: Option, + /// ID of the source flow. + /// + /// Set if `network` is `stripe` and the source flow is visible to the user. + /// Examples of source flows include OutboundPayments, payouts, or CreditReversals. + pub source_flow: Option, + /// The expandable object of the source flow. + pub source_flow_details: Option, + /// The type of flow that originated the ReceivedCredit (for example, `outbound_payment`). + pub source_flow_type: Option, +} diff --git a/generated/stripe_treasury/src/treasury_received_credits_resource_received_credit/mod.rs b/generated/stripe_treasury/src/treasury_received_credits_resource_received_credit/mod.rs new file mode 100644 index 000000000..7d7896603 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_credits_resource_received_credit/mod.rs @@ -0,0 +1,244 @@ +/// ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). +/// +/// These money movements are not initiated from the FinancialAccount. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedCreditsResourceReceivedCredit { + /// Amount (in cents) transferred. + pub amount: i64, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: String, + /// Reason for the failure. + /// + /// A ReceivedCredit might fail because the receiving FinancialAccount is closed or frozen. + pub failure_code: Option, + /// The FinancialAccount that received the funds. + pub financial_account: Option, + /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + pub hosted_regulatory_receipt_url: Option, + /// Unique identifier for the object. + pub id: stripe_treasury::treasury_received_credits_resource_received_credit::TreasuryReceivedCreditId, + pub initiating_payment_method_details: stripe_treasury::TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails, + pub linked_flows: stripe_treasury::TreasuryReceivedCreditsResourceLinkedFlows, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The rails used to send the funds. + pub network: TreasuryReceivedCreditsResourceReceivedCreditNetwork, + /// Details describing when a ReceivedCredit may be reversed. + pub reversal_details: Option, + /// Status of the ReceivedCredit. + /// + /// ReceivedCredits are created either `succeeded` (approved) or `failed` (declined). + /// If a ReceivedCredit is declined, the failure reason can be found in the `failure_code` field. + pub status: TreasuryReceivedCreditsResourceReceivedCreditStatus, + /// The Transaction associated with this object. + pub transaction: Option>, +} +/// Reason for the failure. +/// +/// A ReceivedCredit might fail because the receiving FinancialAccount is closed or frozen. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedCreditsResourceReceivedCreditFailureCode { + AccountClosed, + AccountFrozen, + Other, +} +impl TreasuryReceivedCreditsResourceReceivedCreditFailureCode { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedCreditsResourceReceivedCreditFailureCode::*; + match self { + AccountClosed => "account_closed", + AccountFrozen => "account_frozen", + Other => "other", + } + } +} + +impl std::str::FromStr for TreasuryReceivedCreditsResourceReceivedCreditFailureCode { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedCreditsResourceReceivedCreditFailureCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_frozen" => Ok(AccountFrozen), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl AsRef for TreasuryReceivedCreditsResourceReceivedCreditFailureCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryReceivedCreditsResourceReceivedCreditFailureCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedCreditsResourceReceivedCreditFailureCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedCreditsResourceReceivedCreditFailureCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedCreditsResourceReceivedCreditFailureCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryReceivedCreditsResourceReceivedCreditFailureCode")) + } +} +/// The rails used to send the funds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedCreditsResourceReceivedCreditNetwork { + Ach, + Card, + Stripe, + UsDomesticWire, +} +impl TreasuryReceivedCreditsResourceReceivedCreditNetwork { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedCreditsResourceReceivedCreditNetwork::*; + match self { + Ach => "ach", + Card => "card", + Stripe => "stripe", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for TreasuryReceivedCreditsResourceReceivedCreditNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedCreditsResourceReceivedCreditNetwork::*; + match s { + "ach" => Ok(Ach), + "card" => Ok(Card), + "stripe" => Ok(Stripe), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl AsRef for TreasuryReceivedCreditsResourceReceivedCreditNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryReceivedCreditsResourceReceivedCreditNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedCreditsResourceReceivedCreditNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedCreditsResourceReceivedCreditNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedCreditsResourceReceivedCreditNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryReceivedCreditsResourceReceivedCreditNetwork")) + } +} +/// Status of the ReceivedCredit. +/// +/// ReceivedCredits are created either `succeeded` (approved) or `failed` (declined). +/// If a ReceivedCredit is declined, the failure reason can be found in the `failure_code` field. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedCreditsResourceReceivedCreditStatus { + Failed, + Succeeded, +} +impl TreasuryReceivedCreditsResourceReceivedCreditStatus { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedCreditsResourceReceivedCreditStatus::*; + match self { + Failed => "failed", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for TreasuryReceivedCreditsResourceReceivedCreditStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedCreditsResourceReceivedCreditStatus::*; + match s { + "failed" => Ok(Failed), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl AsRef for TreasuryReceivedCreditsResourceReceivedCreditStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryReceivedCreditsResourceReceivedCreditStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedCreditsResourceReceivedCreditStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedCreditsResourceReceivedCreditStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedCreditsResourceReceivedCreditStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryReceivedCreditsResourceReceivedCreditStatus")) + } +} +impl stripe_types::Object for TreasuryReceivedCreditsResourceReceivedCredit { + type Id = stripe_treasury::treasury_received_credits_resource_received_credit::TreasuryReceivedCreditId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TreasuryReceivedCreditId); +#[cfg(feature = "treasury_received_credits_resource_received_credit")] +mod requests; +#[cfg(feature = "treasury_received_credits_resource_received_credit")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_received_credits_resource_received_credit/requests.rs b/generated/stripe_treasury/src/treasury_received_credits_resource_received_credit/requests.rs new file mode 100644 index 000000000..e4c24169e --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_credits_resource_received_credit/requests.rs @@ -0,0 +1,351 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryReceivedCreditsResourceReceivedCredit<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The FinancialAccount that received the funds. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return ReceivedCredits described by the flow. + #[serde(skip_serializing_if = "Option::is_none")] + pub linked_flows: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return ReceivedCredits that have the given status: `succeeded` or `failed`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTreasuryReceivedCreditsResourceReceivedCredit<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { ending_before: Default::default(), expand: Default::default(), financial_account, limit: Default::default(), linked_flows: Default::default(), starting_after: Default::default(), status: Default::default() } + } +} +/// Only return ReceivedCredits described by the flow. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryReceivedCreditsResourceReceivedCreditLinkedFlows { + /// The source flow type. + pub source_flow_type: ListTreasuryReceivedCreditsResourceReceivedCreditLinkedFlowsSourceFlowType, +} +impl ListTreasuryReceivedCreditsResourceReceivedCreditLinkedFlows { + pub fn new(source_flow_type: ListTreasuryReceivedCreditsResourceReceivedCreditLinkedFlowsSourceFlowType) -> Self { + Self { source_flow_type } + } +} +/// The source flow type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTreasuryReceivedCreditsResourceReceivedCreditLinkedFlowsSourceFlowType { + CreditReversal, + Other, + OutboundPayment, + Payout, +} +impl ListTreasuryReceivedCreditsResourceReceivedCreditLinkedFlowsSourceFlowType { + pub fn as_str(self) -> &'static str { + use ListTreasuryReceivedCreditsResourceReceivedCreditLinkedFlowsSourceFlowType::*; + match self { + CreditReversal => "credit_reversal", + Other => "other", + OutboundPayment => "outbound_payment", + Payout => "payout", + } + } +} + +impl std::str::FromStr for ListTreasuryReceivedCreditsResourceReceivedCreditLinkedFlowsSourceFlowType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTreasuryReceivedCreditsResourceReceivedCreditLinkedFlowsSourceFlowType::*; + match s { + "credit_reversal" => Ok(CreditReversal), + "other" => Ok(Other), + "outbound_payment" => Ok(OutboundPayment), + "payout" => Ok(Payout), + _ => Err(()), + } + } +} +impl AsRef for ListTreasuryReceivedCreditsResourceReceivedCreditLinkedFlowsSourceFlowType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListTreasuryReceivedCreditsResourceReceivedCreditLinkedFlowsSourceFlowType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTreasuryReceivedCreditsResourceReceivedCreditLinkedFlowsSourceFlowType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTreasuryReceivedCreditsResourceReceivedCreditLinkedFlowsSourceFlowType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only return ReceivedCredits that have the given status: `succeeded` or `failed`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTreasuryReceivedCreditsResourceReceivedCreditStatus { + Failed, + Succeeded, +} +impl ListTreasuryReceivedCreditsResourceReceivedCreditStatus { + pub fn as_str(self) -> &'static str { + use ListTreasuryReceivedCreditsResourceReceivedCreditStatus::*; + match self { + Failed => "failed", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for ListTreasuryReceivedCreditsResourceReceivedCreditStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTreasuryReceivedCreditsResourceReceivedCreditStatus::*; + match s { + "failed" => Ok(Failed), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl AsRef for ListTreasuryReceivedCreditsResourceReceivedCreditStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListTreasuryReceivedCreditsResourceReceivedCreditStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTreasuryReceivedCreditsResourceReceivedCreditStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTreasuryReceivedCreditsResourceReceivedCreditStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListTreasuryReceivedCreditsResourceReceivedCredit<'a> { + /// Returns a list of ReceivedCredits. + pub fn send(&self, client: &stripe::Client) -> stripe::Response> { + client.get_query("/treasury/received_credits", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/treasury/received_credits", self) + } +} +impl<'a> stripe::PaginationParams for ListTreasuryReceivedCreditsResourceReceivedCredit<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryReceivedCreditsResourceReceivedCredit<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryReceivedCreditsResourceReceivedCredit<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryReceivedCreditsResourceReceivedCredit<'a> { + /// Retrieves the details of an existing ReceivedCredit by passing the unique ReceivedCredit ID from the ReceivedCredit list. + pub fn send(&self, client: &stripe::Client, id: &stripe_treasury::treasury_received_credits_resource_received_credit::TreasuryReceivedCreditId) -> stripe::Response { + client.get_query(&format!("/treasury/received_credits/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryReceivedCreditsResourceReceivedCredit<'a> { + /// Amount (in cents) to be transferred. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The FinancialAccount to send funds to. + pub financial_account: &'a str, + /// Initiating payment method details for the object. + #[serde(skip_serializing_if = "Option::is_none")] + pub initiating_payment_method_details: Option>, + /// The rails used for the object. + pub network: CreateTreasuryReceivedCreditsResourceReceivedCreditNetwork, +} +impl<'a> CreateTreasuryReceivedCreditsResourceReceivedCredit<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency, financial_account: &'a str, network: CreateTreasuryReceivedCreditsResourceReceivedCreditNetwork) -> Self { + Self { amount, currency, description: Default::default(), expand: Default::default(), financial_account, initiating_payment_method_details: Default::default(), network } + } +} +/// Initiating payment method details for the object. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryReceivedCreditsResourceReceivedCreditInitiatingPaymentMethodDetails<'a> { + /// The source type. + #[serde(rename = "type")] + pub type_: CreateTreasuryReceivedCreditsResourceReceivedCreditInitiatingPaymentMethodDetailsType, + /// Optional fields for `us_bank_account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, +} +impl<'a> CreateTreasuryReceivedCreditsResourceReceivedCreditInitiatingPaymentMethodDetails<'a> { + pub fn new(type_: CreateTreasuryReceivedCreditsResourceReceivedCreditInitiatingPaymentMethodDetailsType) -> Self { + Self { type_, us_bank_account: Default::default() } + } +} +/// The source type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryReceivedCreditsResourceReceivedCreditInitiatingPaymentMethodDetailsType { + UsBankAccount, +} +impl CreateTreasuryReceivedCreditsResourceReceivedCreditInitiatingPaymentMethodDetailsType { + pub fn as_str(self) -> &'static str { + use CreateTreasuryReceivedCreditsResourceReceivedCreditInitiatingPaymentMethodDetailsType::*; + match self { + UsBankAccount => "us_bank_account", + } + } +} + +impl std::str::FromStr for CreateTreasuryReceivedCreditsResourceReceivedCreditInitiatingPaymentMethodDetailsType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryReceivedCreditsResourceReceivedCreditInitiatingPaymentMethodDetailsType::*; + match s { + "us_bank_account" => Ok(UsBankAccount), + _ => Err(()), + } + } +} +impl AsRef for CreateTreasuryReceivedCreditsResourceReceivedCreditInitiatingPaymentMethodDetailsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTreasuryReceivedCreditsResourceReceivedCreditInitiatingPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryReceivedCreditsResourceReceivedCreditInitiatingPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryReceivedCreditsResourceReceivedCreditInitiatingPaymentMethodDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Optional fields for `us_bank_account`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryReceivedCreditsResourceReceivedCreditInitiatingPaymentMethodDetailsUsBankAccount<'a> { + /// The bank account holder's name. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_name: Option<&'a str>, + /// The bank account number. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// The bank account's routing number. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> CreateTreasuryReceivedCreditsResourceReceivedCreditInitiatingPaymentMethodDetailsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The rails used for the object. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryReceivedCreditsResourceReceivedCreditNetwork { + Ach, + UsDomesticWire, +} +impl CreateTreasuryReceivedCreditsResourceReceivedCreditNetwork { + pub fn as_str(self) -> &'static str { + use CreateTreasuryReceivedCreditsResourceReceivedCreditNetwork::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for CreateTreasuryReceivedCreditsResourceReceivedCreditNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryReceivedCreditsResourceReceivedCreditNetwork::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl AsRef for CreateTreasuryReceivedCreditsResourceReceivedCreditNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTreasuryReceivedCreditsResourceReceivedCreditNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryReceivedCreditsResourceReceivedCreditNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryReceivedCreditsResourceReceivedCreditNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateTreasuryReceivedCreditsResourceReceivedCredit<'a> { + /// Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. + /// + /// In live mode, you can’t directly create ReceivedCredits initiated by third parties. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/test_helpers/treasury/received_credits", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_treasury/src/treasury_received_credits_resource_reversal_details/mod.rs b/generated/stripe_treasury/src/treasury_received_credits_resource_reversal_details/mod.rs new file mode 100644 index 000000000..4ddcd8d69 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_credits_resource_reversal_details/mod.rs @@ -0,0 +1,74 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedCreditsResourceReversalDetails { + /// Time before which a ReceivedCredit can be reversed. + pub deadline: Option, + /// Set if a ReceivedCredit cannot be reversed. + pub restricted_reason: Option, +} +/// Set if a ReceivedCredit cannot be reversed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { + AlreadyReversed, + DeadlinePassed, + NetworkRestricted, + Other, + SourceFlowRestricted, +} +impl TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason::*; + match self { + AlreadyReversed => "already_reversed", + DeadlinePassed => "deadline_passed", + NetworkRestricted => "network_restricted", + Other => "other", + SourceFlowRestricted => "source_flow_restricted", + } + } +} + +impl std::str::FromStr for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason::*; + match s { + "already_reversed" => Ok(AlreadyReversed), + "deadline_passed" => Ok(DeadlinePassed), + "network_restricted" => Ok(NetworkRestricted), + "other" => Ok(Other), + "source_flow_restricted" => Ok(SourceFlowRestricted), + _ => Err(()), + } + } +} +impl AsRef for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason")) + } +} diff --git a/generated/stripe_treasury/src/treasury_received_credits_resource_source_flows_details/mod.rs b/generated/stripe_treasury/src/treasury_received_credits_resource_source_flows_details/mod.rs new file mode 100644 index 000000000..d0103aca6 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_credits_resource_source_flows_details/mod.rs @@ -0,0 +1,76 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedCreditsResourceSourceFlowsDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub credit_reversal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_payment: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub payout: Option, + /// The type of the source flow that originated the ReceivedCredit. + #[serde(rename = "type")] + pub type_: TreasuryReceivedCreditsResourceSourceFlowsDetailsType, +} +/// The type of the source flow that originated the ReceivedCredit. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedCreditsResourceSourceFlowsDetailsType { + CreditReversal, + Other, + OutboundPayment, + Payout, +} +impl TreasuryReceivedCreditsResourceSourceFlowsDetailsType { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedCreditsResourceSourceFlowsDetailsType::*; + match self { + CreditReversal => "credit_reversal", + Other => "other", + OutboundPayment => "outbound_payment", + Payout => "payout", + } + } +} + +impl std::str::FromStr for TreasuryReceivedCreditsResourceSourceFlowsDetailsType { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedCreditsResourceSourceFlowsDetailsType::*; + match s { + "credit_reversal" => Ok(CreditReversal), + "other" => Ok(Other), + "outbound_payment" => Ok(OutboundPayment), + "payout" => Ok(Payout), + _ => Err(()), + } + } +} +impl AsRef for TreasuryReceivedCreditsResourceSourceFlowsDetailsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryReceivedCreditsResourceSourceFlowsDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedCreditsResourceSourceFlowsDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedCreditsResourceSourceFlowsDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedCreditsResourceSourceFlowsDetailsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryReceivedCreditsResourceSourceFlowsDetailsType")) + } +} diff --git a/generated/stripe_treasury/src/treasury_received_credits_resource_status_transitions/mod.rs b/generated/stripe_treasury/src/treasury_received_credits_resource_status_transitions/mod.rs new file mode 100644 index 000000000..fdd75bbcd --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_credits_resource_status_transitions/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedCreditsResourceStatusTransitions { + /// Timestamp describing when the CreditReversal changed status to `posted`. + pub posted_at: Option, +} diff --git a/generated/stripe_treasury/src/treasury_received_debits_resource_debit_reversal/mod.rs b/generated/stripe_treasury/src/treasury_received_debits_resource_debit_reversal/mod.rs new file mode 100644 index 000000000..13fd1186f --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_debits_resource_debit_reversal/mod.rs @@ -0,0 +1,169 @@ +/// You can reverse some [ReceivedDebits](https://stripe.com/docs/api#received_debits) depending on their network and source flow. +/// +/// Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedDebitsResourceDebitReversal { + /// Amount (in cents) transferred. + pub amount: i64, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The FinancialAccount to reverse funds from. + pub financial_account: Option, + /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + pub hosted_regulatory_receipt_url: Option, + /// Unique identifier for the object. + pub id: stripe_treasury::treasury_received_debits_resource_debit_reversal::TreasuryDebitReversalId, + /// Other flows linked to a DebitReversal. + pub linked_flows: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The rails used to reverse the funds. + pub network: TreasuryReceivedDebitsResourceDebitReversalNetwork, + /// The ReceivedDebit being reversed. + pub received_debit: String, + /// Status of the DebitReversal. + pub status: TreasuryReceivedDebitsResourceDebitReversalStatus, + pub status_transitions: stripe_treasury::TreasuryReceivedDebitsResourceStatusTransitions, + /// The Transaction associated with this object. + pub transaction: Option>, +} +/// The rails used to reverse the funds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedDebitsResourceDebitReversalNetwork { + Ach, + Card, +} +impl TreasuryReceivedDebitsResourceDebitReversalNetwork { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedDebitsResourceDebitReversalNetwork::*; + match self { + Ach => "ach", + Card => "card", + } + } +} + +impl std::str::FromStr for TreasuryReceivedDebitsResourceDebitReversalNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedDebitsResourceDebitReversalNetwork::*; + match s { + "ach" => Ok(Ach), + "card" => Ok(Card), + _ => Err(()), + } + } +} +impl AsRef for TreasuryReceivedDebitsResourceDebitReversalNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryReceivedDebitsResourceDebitReversalNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedDebitsResourceDebitReversalNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedDebitsResourceDebitReversalNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedDebitsResourceDebitReversalNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryReceivedDebitsResourceDebitReversalNetwork")) + } +} +/// Status of the DebitReversal. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedDebitsResourceDebitReversalStatus { + Failed, + Processing, + Succeeded, +} +impl TreasuryReceivedDebitsResourceDebitReversalStatus { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedDebitsResourceDebitReversalStatus::*; + match self { + Failed => "failed", + Processing => "processing", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for TreasuryReceivedDebitsResourceDebitReversalStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedDebitsResourceDebitReversalStatus::*; + match s { + "failed" => Ok(Failed), + "processing" => Ok(Processing), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl AsRef for TreasuryReceivedDebitsResourceDebitReversalStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryReceivedDebitsResourceDebitReversalStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedDebitsResourceDebitReversalStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedDebitsResourceDebitReversalStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedDebitsResourceDebitReversalStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryReceivedDebitsResourceDebitReversalStatus")) + } +} +impl stripe_types::Object for TreasuryReceivedDebitsResourceDebitReversal { + type Id = stripe_treasury::treasury_received_debits_resource_debit_reversal::TreasuryDebitReversalId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TreasuryDebitReversalId); +#[cfg(feature = "treasury_received_debits_resource_debit_reversal")] +mod requests; +#[cfg(feature = "treasury_received_debits_resource_debit_reversal")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_received_debits_resource_debit_reversal/requests.rs b/generated/stripe_treasury/src/treasury_received_debits_resource_debit_reversal/requests.rs new file mode 100644 index 000000000..100e040bc --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_debits_resource_debit_reversal/requests.rs @@ -0,0 +1,197 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryReceivedDebitsResourceDebitReversal<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The ReceivedDebit to reverse. + pub received_debit: &'a str, +} +impl<'a> CreateTreasuryReceivedDebitsResourceDebitReversal<'a> { + pub fn new(received_debit: &'a str) -> Self { + Self { expand: Default::default(), metadata: Default::default(), received_debit } + } +} +impl<'a> CreateTreasuryReceivedDebitsResourceDebitReversal<'a> { + /// Reverses a ReceivedDebit and creates a DebitReversal object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/treasury/debit_reversals", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryReceivedDebitsResourceDebitReversal<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryReceivedDebitsResourceDebitReversal<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryReceivedDebitsResourceDebitReversal<'a> { + /// Retrieves a DebitReversal object. + pub fn send(&self, client: &stripe::Client, debit_reversal: &str) -> stripe::Response { + client.get_query(&format!("/treasury/debit_reversals/{debit_reversal}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryReceivedDebitsResourceDebitReversal<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Returns objects associated with this FinancialAccount. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return DebitReversals for the ReceivedDebit ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub received_debit: Option<&'a str>, + /// Only return DebitReversals for a given resolution. + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return DebitReversals for a given status. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTreasuryReceivedDebitsResourceDebitReversal<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { ending_before: Default::default(), expand: Default::default(), financial_account, limit: Default::default(), received_debit: Default::default(), resolution: Default::default(), starting_after: Default::default(), status: Default::default() } + } +} +/// Only return DebitReversals for a given resolution. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTreasuryReceivedDebitsResourceDebitReversalResolution { + Lost, + Won, +} +impl ListTreasuryReceivedDebitsResourceDebitReversalResolution { + pub fn as_str(self) -> &'static str { + use ListTreasuryReceivedDebitsResourceDebitReversalResolution::*; + match self { + Lost => "lost", + Won => "won", + } + } +} + +impl std::str::FromStr for ListTreasuryReceivedDebitsResourceDebitReversalResolution { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTreasuryReceivedDebitsResourceDebitReversalResolution::*; + match s { + "lost" => Ok(Lost), + "won" => Ok(Won), + _ => Err(()), + } + } +} +impl AsRef for ListTreasuryReceivedDebitsResourceDebitReversalResolution { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListTreasuryReceivedDebitsResourceDebitReversalResolution { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTreasuryReceivedDebitsResourceDebitReversalResolution { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTreasuryReceivedDebitsResourceDebitReversalResolution { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only return DebitReversals for a given status. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTreasuryReceivedDebitsResourceDebitReversalStatus { + Canceled, + Completed, + Processing, +} +impl ListTreasuryReceivedDebitsResourceDebitReversalStatus { + pub fn as_str(self) -> &'static str { + use ListTreasuryReceivedDebitsResourceDebitReversalStatus::*; + match self { + Canceled => "canceled", + Completed => "completed", + Processing => "processing", + } + } +} + +impl std::str::FromStr for ListTreasuryReceivedDebitsResourceDebitReversalStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTreasuryReceivedDebitsResourceDebitReversalStatus::*; + match s { + "canceled" => Ok(Canceled), + "completed" => Ok(Completed), + "processing" => Ok(Processing), + _ => Err(()), + } + } +} +impl AsRef for ListTreasuryReceivedDebitsResourceDebitReversalStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListTreasuryReceivedDebitsResourceDebitReversalStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTreasuryReceivedDebitsResourceDebitReversalStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTreasuryReceivedDebitsResourceDebitReversalStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListTreasuryReceivedDebitsResourceDebitReversal<'a> { + /// Returns a list of DebitReversals. + pub fn send(&self, client: &stripe::Client) -> stripe::Response> { + client.get_query("/treasury/debit_reversals", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/treasury/debit_reversals", self) + } +} +impl<'a> stripe::PaginationParams for ListTreasuryReceivedDebitsResourceDebitReversal<'a> {} diff --git a/generated/stripe_treasury/src/treasury_received_debits_resource_debit_reversal_linked_flows/mod.rs b/generated/stripe_treasury/src/treasury_received_debits_resource_debit_reversal_linked_flows/mod.rs new file mode 100644 index 000000000..96b31b048 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_debits_resource_debit_reversal_linked_flows/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedDebitsResourceDebitReversalLinkedFlows { + /// Set if there is an Issuing dispute associated with the DebitReversal. + pub issuing_dispute: Option, +} diff --git a/generated/stripe_treasury/src/treasury_received_debits_resource_linked_flows/mod.rs b/generated/stripe_treasury/src/treasury_received_debits_resource_linked_flows/mod.rs new file mode 100644 index 000000000..f5f2f5e4a --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_debits_resource_linked_flows/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedDebitsResourceLinkedFlows { + /// The DebitReversal created as a result of this ReceivedDebit being reversed. + pub debit_reversal: Option, + /// Set if the ReceivedDebit is associated with an InboundTransfer's return of funds. + pub inbound_transfer: Option, + /// Set if the ReceivedDebit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. + pub issuing_authorization: Option, + /// Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://stripe.com/docs/api#issuing_disputes) object. + pub issuing_transaction: Option, +} diff --git a/generated/stripe_treasury/src/treasury_received_debits_resource_received_debit/mod.rs b/generated/stripe_treasury/src/treasury_received_debits_resource_received_debit/mod.rs new file mode 100644 index 000000000..4bb181029 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_debits_resource_received_debit/mod.rs @@ -0,0 +1,245 @@ +/// ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). +/// +/// These are not initiated from the FinancialAccount. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedDebitsResourceReceivedDebit { + /// Amount (in cents) transferred. + pub amount: i64, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: String, + /// Reason for the failure. + /// + /// A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen. + pub failure_code: Option, + /// The FinancialAccount that funds were pulled from. + pub financial_account: Option, + /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + pub hosted_regulatory_receipt_url: Option, + /// Unique identifier for the object. + pub id: stripe_treasury::treasury_received_debits_resource_received_debit::TreasuryReceivedDebitId, + #[serde(skip_serializing_if = "Option::is_none")] + pub initiating_payment_method_details: Option, + pub linked_flows: stripe_treasury::TreasuryReceivedDebitsResourceLinkedFlows, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The network used for the ReceivedDebit. + pub network: TreasuryReceivedDebitsResourceReceivedDebitNetwork, + /// Details describing when a ReceivedDebit might be reversed. + pub reversal_details: Option, + /// Status of the ReceivedDebit. + /// + /// ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). + /// The failure reason can be found under the `failure_code`. + pub status: TreasuryReceivedDebitsResourceReceivedDebitStatus, + /// The Transaction associated with this object. + pub transaction: Option>, +} +/// Reason for the failure. +/// +/// A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedDebitsResourceReceivedDebitFailureCode { + AccountClosed, + AccountFrozen, + InsufficientFunds, + Other, +} +impl TreasuryReceivedDebitsResourceReceivedDebitFailureCode { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedDebitsResourceReceivedDebitFailureCode::*; + match self { + AccountClosed => "account_closed", + AccountFrozen => "account_frozen", + InsufficientFunds => "insufficient_funds", + Other => "other", + } + } +} + +impl std::str::FromStr for TreasuryReceivedDebitsResourceReceivedDebitFailureCode { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedDebitsResourceReceivedDebitFailureCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_frozen" => Ok(AccountFrozen), + "insufficient_funds" => Ok(InsufficientFunds), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl AsRef for TreasuryReceivedDebitsResourceReceivedDebitFailureCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryReceivedDebitsResourceReceivedDebitFailureCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedDebitsResourceReceivedDebitFailureCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedDebitsResourceReceivedDebitFailureCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedDebitsResourceReceivedDebitFailureCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryReceivedDebitsResourceReceivedDebitFailureCode")) + } +} +/// The network used for the ReceivedDebit. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedDebitsResourceReceivedDebitNetwork { + Ach, + Card, + Stripe, +} +impl TreasuryReceivedDebitsResourceReceivedDebitNetwork { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedDebitsResourceReceivedDebitNetwork::*; + match self { + Ach => "ach", + Card => "card", + Stripe => "stripe", + } + } +} + +impl std::str::FromStr for TreasuryReceivedDebitsResourceReceivedDebitNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedDebitsResourceReceivedDebitNetwork::*; + match s { + "ach" => Ok(Ach), + "card" => Ok(Card), + "stripe" => Ok(Stripe), + _ => Err(()), + } + } +} +impl AsRef for TreasuryReceivedDebitsResourceReceivedDebitNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryReceivedDebitsResourceReceivedDebitNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedDebitsResourceReceivedDebitNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedDebitsResourceReceivedDebitNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedDebitsResourceReceivedDebitNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryReceivedDebitsResourceReceivedDebitNetwork")) + } +} +/// Status of the ReceivedDebit. +/// +/// ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). +/// The failure reason can be found under the `failure_code`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedDebitsResourceReceivedDebitStatus { + Failed, + Succeeded, +} +impl TreasuryReceivedDebitsResourceReceivedDebitStatus { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedDebitsResourceReceivedDebitStatus::*; + match self { + Failed => "failed", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for TreasuryReceivedDebitsResourceReceivedDebitStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedDebitsResourceReceivedDebitStatus::*; + match s { + "failed" => Ok(Failed), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl AsRef for TreasuryReceivedDebitsResourceReceivedDebitStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryReceivedDebitsResourceReceivedDebitStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedDebitsResourceReceivedDebitStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedDebitsResourceReceivedDebitStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedDebitsResourceReceivedDebitStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryReceivedDebitsResourceReceivedDebitStatus")) + } +} +impl stripe_types::Object for TreasuryReceivedDebitsResourceReceivedDebit { + type Id = stripe_treasury::treasury_received_debits_resource_received_debit::TreasuryReceivedDebitId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TreasuryReceivedDebitId); +#[cfg(feature = "treasury_received_debits_resource_received_debit")] +mod requests; +#[cfg(feature = "treasury_received_debits_resource_received_debit")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_received_debits_resource_received_debit/requests.rs b/generated/stripe_treasury/src/treasury_received_debits_resource_received_debit/requests.rs new file mode 100644 index 000000000..2c8fe6b5f --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_debits_resource_received_debit/requests.rs @@ -0,0 +1,277 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryReceivedDebitsResourceReceivedDebit<'a> { + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The FinancialAccount that funds were pulled from. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return ReceivedDebits that have the given status: `succeeded` or `failed`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTreasuryReceivedDebitsResourceReceivedDebit<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { ending_before: Default::default(), expand: Default::default(), financial_account, limit: Default::default(), starting_after: Default::default(), status: Default::default() } + } +} +/// Only return ReceivedDebits that have the given status: `succeeded` or `failed`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTreasuryReceivedDebitsResourceReceivedDebitStatus { + Failed, + Succeeded, +} +impl ListTreasuryReceivedDebitsResourceReceivedDebitStatus { + pub fn as_str(self) -> &'static str { + use ListTreasuryReceivedDebitsResourceReceivedDebitStatus::*; + match self { + Failed => "failed", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for ListTreasuryReceivedDebitsResourceReceivedDebitStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTreasuryReceivedDebitsResourceReceivedDebitStatus::*; + match s { + "failed" => Ok(Failed), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl AsRef for ListTreasuryReceivedDebitsResourceReceivedDebitStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListTreasuryReceivedDebitsResourceReceivedDebitStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTreasuryReceivedDebitsResourceReceivedDebitStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTreasuryReceivedDebitsResourceReceivedDebitStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListTreasuryReceivedDebitsResourceReceivedDebit<'a> { + /// Returns a list of ReceivedDebits. + pub fn send(&self, client: &stripe::Client) -> stripe::Response> { + client.get_query("/treasury/received_debits", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/treasury/received_debits", self) + } +} +impl<'a> stripe::PaginationParams for ListTreasuryReceivedDebitsResourceReceivedDebit<'a> {} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryReceivedDebitsResourceReceivedDebit<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryReceivedDebitsResourceReceivedDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryReceivedDebitsResourceReceivedDebit<'a> { + /// Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list. + pub fn send(&self, client: &stripe::Client, id: &stripe_treasury::treasury_received_debits_resource_received_debit::TreasuryReceivedDebitId) -> stripe::Response { + client.get_query(&format!("/treasury/received_debits/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryReceivedDebitsResourceReceivedDebit<'a> { + /// Amount (in cents) to be transferred. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The FinancialAccount to pull funds from. + pub financial_account: &'a str, + /// Initiating payment method details for the object. + #[serde(skip_serializing_if = "Option::is_none")] + pub initiating_payment_method_details: Option>, + /// The rails used for the object. + pub network: CreateTreasuryReceivedDebitsResourceReceivedDebitNetwork, +} +impl<'a> CreateTreasuryReceivedDebitsResourceReceivedDebit<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency, financial_account: &'a str, network: CreateTreasuryReceivedDebitsResourceReceivedDebitNetwork) -> Self { + Self { amount, currency, description: Default::default(), expand: Default::default(), financial_account, initiating_payment_method_details: Default::default(), network } + } +} +/// Initiating payment method details for the object. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryReceivedDebitsResourceReceivedDebitInitiatingPaymentMethodDetails<'a> { + /// The source type. + #[serde(rename = "type")] + pub type_: CreateTreasuryReceivedDebitsResourceReceivedDebitInitiatingPaymentMethodDetailsType, + /// Optional fields for `us_bank_account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, +} +impl<'a> CreateTreasuryReceivedDebitsResourceReceivedDebitInitiatingPaymentMethodDetails<'a> { + pub fn new(type_: CreateTreasuryReceivedDebitsResourceReceivedDebitInitiatingPaymentMethodDetailsType) -> Self { + Self { type_, us_bank_account: Default::default() } + } +} +/// The source type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryReceivedDebitsResourceReceivedDebitInitiatingPaymentMethodDetailsType { + UsBankAccount, +} +impl CreateTreasuryReceivedDebitsResourceReceivedDebitInitiatingPaymentMethodDetailsType { + pub fn as_str(self) -> &'static str { + use CreateTreasuryReceivedDebitsResourceReceivedDebitInitiatingPaymentMethodDetailsType::*; + match self { + UsBankAccount => "us_bank_account", + } + } +} + +impl std::str::FromStr for CreateTreasuryReceivedDebitsResourceReceivedDebitInitiatingPaymentMethodDetailsType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryReceivedDebitsResourceReceivedDebitInitiatingPaymentMethodDetailsType::*; + match s { + "us_bank_account" => Ok(UsBankAccount), + _ => Err(()), + } + } +} +impl AsRef for CreateTreasuryReceivedDebitsResourceReceivedDebitInitiatingPaymentMethodDetailsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTreasuryReceivedDebitsResourceReceivedDebitInitiatingPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryReceivedDebitsResourceReceivedDebitInitiatingPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryReceivedDebitsResourceReceivedDebitInitiatingPaymentMethodDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Optional fields for `us_bank_account`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryReceivedDebitsResourceReceivedDebitInitiatingPaymentMethodDetailsUsBankAccount<'a> { + /// The bank account holder's name. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_name: Option<&'a str>, + /// The bank account number. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// The bank account's routing number. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> CreateTreasuryReceivedDebitsResourceReceivedDebitInitiatingPaymentMethodDetailsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The rails used for the object. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryReceivedDebitsResourceReceivedDebitNetwork { + Ach, +} +impl CreateTreasuryReceivedDebitsResourceReceivedDebitNetwork { + pub fn as_str(self) -> &'static str { + use CreateTreasuryReceivedDebitsResourceReceivedDebitNetwork::*; + match self { + Ach => "ach", + } + } +} + +impl std::str::FromStr for CreateTreasuryReceivedDebitsResourceReceivedDebitNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryReceivedDebitsResourceReceivedDebitNetwork::*; + match s { + "ach" => Ok(Ach), + _ => Err(()), + } + } +} +impl AsRef for CreateTreasuryReceivedDebitsResourceReceivedDebitNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreateTreasuryReceivedDebitsResourceReceivedDebitNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryReceivedDebitsResourceReceivedDebitNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryReceivedDebitsResourceReceivedDebitNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateTreasuryReceivedDebitsResourceReceivedDebit<'a> { + /// Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. + /// + /// In live mode, you can’t directly create ReceivedDebits initiated by third parties. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/test_helpers/treasury/received_debits", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_treasury/src/treasury_received_debits_resource_reversal_details/mod.rs b/generated/stripe_treasury/src/treasury_received_debits_resource_reversal_details/mod.rs new file mode 100644 index 000000000..8788bcd8b --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_debits_resource_reversal_details/mod.rs @@ -0,0 +1,74 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedDebitsResourceReversalDetails { + /// Time before which a ReceivedDebit can be reversed. + pub deadline: Option, + /// Set if a ReceivedDebit can't be reversed. + pub restricted_reason: Option, +} +/// Set if a ReceivedDebit can't be reversed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { + AlreadyReversed, + DeadlinePassed, + NetworkRestricted, + Other, + SourceFlowRestricted, +} +impl TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason::*; + match self { + AlreadyReversed => "already_reversed", + DeadlinePassed => "deadline_passed", + NetworkRestricted => "network_restricted", + Other => "other", + SourceFlowRestricted => "source_flow_restricted", + } + } +} + +impl std::str::FromStr for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason::*; + match s { + "already_reversed" => Ok(AlreadyReversed), + "deadline_passed" => Ok(DeadlinePassed), + "network_restricted" => Ok(NetworkRestricted), + "other" => Ok(Other), + "source_flow_restricted" => Ok(SourceFlowRestricted), + _ => Err(()), + } + } +} +impl AsRef for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason")) + } +} diff --git a/generated/stripe_treasury/src/treasury_received_debits_resource_status_transitions/mod.rs b/generated/stripe_treasury/src/treasury_received_debits_resource_status_transitions/mod.rs new file mode 100644 index 000000000..66df51d8e --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_debits_resource_status_transitions/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedDebitsResourceStatusTransitions { + /// Timestamp describing when the DebitReversal changed status to `completed`. + pub completed_at: Option, +} diff --git a/generated/stripe_treasury/src/treasury_shared_resource_billing_details/mod.rs b/generated/stripe_treasury/src/treasury_shared_resource_billing_details/mod.rs new file mode 100644 index 000000000..ae31bf9d2 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_shared_resource_billing_details/mod.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasurySharedResourceBillingDetails { + pub address: stripe_types::Address, + /// Email address. + pub email: Option, + /// Full name. + pub name: Option, +} diff --git a/generated/stripe_treasury/src/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details/mod.rs b/generated/stripe_treasury/src/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details/mod.rs new file mode 100644 index 000000000..44e3f2231 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details/mod.rs @@ -0,0 +1,145 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails { + /// Set when `type` is `balance`. + #[serde(skip_serializing_if = "Option::is_none")] + pub balance: Option, + pub billing_details: stripe_treasury::TreasurySharedResourceBillingDetails, + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_account: Option, + /// Set when `type` is `issuing_card`. + /// + /// This is an [Issuing Card](https://stripe.com/docs/api#issuing_cards) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuing_card: Option, + /// Polymorphic type matching the originating money movement's source. + /// + /// This can be an external account, a Stripe balance, or a FinancialAccount. + #[serde(rename = "type")] + pub type_: TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} +/// Set when `type` is `balance`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { + Payments, +} +impl TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { + pub fn as_str(self) -> &'static str { + use TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance::*; + match self { + Payments => "payments", + } + } +} + +impl std::str::FromStr for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance::*; + match s { + "payments" => Ok(Payments), + _ => Err(()), + } + } +} +impl AsRef for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance")) + } +} +/// Polymorphic type matching the originating money movement's source. +/// +/// This can be an external account, a Stripe balance, or a FinancialAccount. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { + Balance, + FinancialAccount, + IssuingCard, + Stripe, + UsBankAccount, +} +impl TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { + pub fn as_str(self) -> &'static str { + use TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType::*; + match self { + Balance => "balance", + FinancialAccount => "financial_account", + IssuingCard => "issuing_card", + Stripe => "stripe", + UsBankAccount => "us_bank_account", + } + } +} + +impl std::str::FromStr for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType::*; + match s { + "balance" => Ok(Balance), + "financial_account" => Ok(FinancialAccount), + "issuing_card" => Ok(IssuingCard), + "stripe" => Ok(Stripe), + "us_bank_account" => Ok(UsBankAccount), + _ => Err(()), + } + } +} +impl AsRef for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType")) + } +} diff --git a/generated/stripe_treasury/src/treasury_shared_resource_initiating_payment_method_details_us_bank_account/mod.rs b/generated/stripe_treasury/src/treasury_shared_resource_initiating_payment_method_details_us_bank_account/mod.rs new file mode 100644 index 000000000..24ba0cdff --- /dev/null +++ b/generated/stripe_treasury/src/treasury_shared_resource_initiating_payment_method_details_us_bank_account/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasurySharedResourceInitiatingPaymentMethodDetailsUsBankAccount { + /// Bank name. + pub bank_name: Option, + /// The last four digits of the bank account number. + pub last4: Option, + /// The routing number for the bank account. + pub routing_number: Option, +} diff --git a/generated/stripe_treasury/src/treasury_transactions_resource_abstract_transaction_resource_status_transitions/mod.rs b/generated/stripe_treasury/src/treasury_transactions_resource_abstract_transaction_resource_status_transitions/mod.rs new file mode 100644 index 000000000..cf9550c30 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_transactions_resource_abstract_transaction_resource_status_transitions/mod.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryTransactionsResourceAbstractTransactionResourceStatusTransitions { + /// Timestamp describing when the Transaction changed status to `posted`. + pub posted_at: Option, + /// Timestamp describing when the Transaction changed status to `void`. + pub void_at: Option, +} diff --git a/generated/stripe_treasury/src/treasury_transactions_resource_balance_impact/mod.rs b/generated/stripe_treasury/src/treasury_transactions_resource_balance_impact/mod.rs new file mode 100644 index 000000000..859529853 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_transactions_resource_balance_impact/mod.rs @@ -0,0 +1,10 @@ +/// Change to a FinancialAccount's balance. +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryTransactionsResourceBalanceImpact { + /// The change made to funds the user can spend right now. + pub cash: i64, + /// The change made to funds that are not spendable yet, but will become available at a later time. + pub inbound_pending: i64, + /// The change made to funds in the account, but not spendable because they are being held for pending outbound flows. + pub outbound_pending: i64, +} diff --git a/generated/stripe_treasury/src/treasury_transactions_resource_flow_details/mod.rs b/generated/stripe_treasury/src/treasury_transactions_resource_flow_details/mod.rs new file mode 100644 index 000000000..798ba4a75 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_transactions_resource_flow_details/mod.rs @@ -0,0 +1,105 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryTransactionsResourceFlowDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub credit_reversal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub debit_reversal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub issuing_authorization: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_payment: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub received_credit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub received_debit: Option, + /// Type of the flow that created the Transaction. + /// + /// Set to the same value as `flow_type`. + #[serde(rename = "type")] + pub type_: TreasuryTransactionsResourceFlowDetailsType, +} +/// Type of the flow that created the Transaction. +/// +/// Set to the same value as `flow_type`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryTransactionsResourceFlowDetailsType { + CreditReversal, + DebitReversal, + InboundTransfer, + IssuingAuthorization, + Other, + OutboundPayment, + OutboundTransfer, + ReceivedCredit, + ReceivedDebit, +} +impl TreasuryTransactionsResourceFlowDetailsType { + pub fn as_str(self) -> &'static str { + use TreasuryTransactionsResourceFlowDetailsType::*; + match self { + CreditReversal => "credit_reversal", + DebitReversal => "debit_reversal", + InboundTransfer => "inbound_transfer", + IssuingAuthorization => "issuing_authorization", + Other => "other", + OutboundPayment => "outbound_payment", + OutboundTransfer => "outbound_transfer", + ReceivedCredit => "received_credit", + ReceivedDebit => "received_debit", + } + } +} + +impl std::str::FromStr for TreasuryTransactionsResourceFlowDetailsType { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryTransactionsResourceFlowDetailsType::*; + match s { + "credit_reversal" => Ok(CreditReversal), + "debit_reversal" => Ok(DebitReversal), + "inbound_transfer" => Ok(InboundTransfer), + "issuing_authorization" => Ok(IssuingAuthorization), + "other" => Ok(Other), + "outbound_payment" => Ok(OutboundPayment), + "outbound_transfer" => Ok(OutboundTransfer), + "received_credit" => Ok(ReceivedCredit), + "received_debit" => Ok(ReceivedDebit), + _ => Err(()), + } + } +} +impl AsRef for TreasuryTransactionsResourceFlowDetailsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryTransactionsResourceFlowDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryTransactionsResourceFlowDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryTransactionsResourceFlowDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryTransactionsResourceFlowDetailsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryTransactionsResourceFlowDetailsType")) + } +} diff --git a/generated/stripe_treasury/src/treasury_transactions_resource_transaction/mod.rs b/generated/stripe_treasury/src/treasury_transactions_resource_transaction/mod.rs new file mode 100644 index 000000000..32701bb1e --- /dev/null +++ b/generated/stripe_treasury/src/treasury_transactions_resource_transaction/mod.rs @@ -0,0 +1,189 @@ +/// Transactions represent changes to a [FinancialAccount's](https://stripe.com/docs/api#financial_accounts) balance. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryTransactionsResourceTransaction { + /// Amount (in cents) transferred. + pub amount: i64, + pub balance_impact: stripe_treasury::TreasuryTransactionsResourceBalanceImpact, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: String, + /// A list of TransactionEntries that are part of this Transaction. + /// + /// This cannot be expanded in any list endpoints. + pub entries: stripe_types::List, + /// The FinancialAccount associated with this object. + pub financial_account: String, + /// ID of the flow that created the Transaction. + pub flow: Option, + /// Details of the flow that created the Transaction. + pub flow_details: Option, + /// Type of the flow that created the Transaction. + pub flow_type: TreasuryTransactionsResourceTransactionFlowType, + /// Unique identifier for the object. + pub id: stripe_treasury::treasury_transactions_resource_transaction::TreasuryTransactionId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Status of the Transaction. + pub status: TreasuryTransactionsResourceTransactionStatus, + pub status_transitions: stripe_treasury::TreasuryTransactionsResourceAbstractTransactionResourceStatusTransitions, +} +/// Type of the flow that created the Transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryTransactionsResourceTransactionFlowType { + CreditReversal, + DebitReversal, + InboundTransfer, + IssuingAuthorization, + Other, + OutboundPayment, + OutboundTransfer, + ReceivedCredit, + ReceivedDebit, +} +impl TreasuryTransactionsResourceTransactionFlowType { + pub fn as_str(self) -> &'static str { + use TreasuryTransactionsResourceTransactionFlowType::*; + match self { + CreditReversal => "credit_reversal", + DebitReversal => "debit_reversal", + InboundTransfer => "inbound_transfer", + IssuingAuthorization => "issuing_authorization", + Other => "other", + OutboundPayment => "outbound_payment", + OutboundTransfer => "outbound_transfer", + ReceivedCredit => "received_credit", + ReceivedDebit => "received_debit", + } + } +} + +impl std::str::FromStr for TreasuryTransactionsResourceTransactionFlowType { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryTransactionsResourceTransactionFlowType::*; + match s { + "credit_reversal" => Ok(CreditReversal), + "debit_reversal" => Ok(DebitReversal), + "inbound_transfer" => Ok(InboundTransfer), + "issuing_authorization" => Ok(IssuingAuthorization), + "other" => Ok(Other), + "outbound_payment" => Ok(OutboundPayment), + "outbound_transfer" => Ok(OutboundTransfer), + "received_credit" => Ok(ReceivedCredit), + "received_debit" => Ok(ReceivedDebit), + _ => Err(()), + } + } +} +impl AsRef for TreasuryTransactionsResourceTransactionFlowType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryTransactionsResourceTransactionFlowType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryTransactionsResourceTransactionFlowType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryTransactionsResourceTransactionFlowType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryTransactionsResourceTransactionFlowType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryTransactionsResourceTransactionFlowType")) + } +} +/// Status of the Transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryTransactionsResourceTransactionStatus { + Open, + Posted, + Void, +} +impl TreasuryTransactionsResourceTransactionStatus { + pub fn as_str(self) -> &'static str { + use TreasuryTransactionsResourceTransactionStatus::*; + match self { + Open => "open", + Posted => "posted", + Void => "void", + } + } +} + +impl std::str::FromStr for TreasuryTransactionsResourceTransactionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryTransactionsResourceTransactionStatus::*; + match s { + "open" => Ok(Open), + "posted" => Ok(Posted), + "void" => Ok(Void), + _ => Err(()), + } + } +} +impl AsRef for TreasuryTransactionsResourceTransactionStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryTransactionsResourceTransactionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryTransactionsResourceTransactionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryTransactionsResourceTransactionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryTransactionsResourceTransactionStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryTransactionsResourceTransactionStatus")) + } +} +impl stripe_types::Object for TreasuryTransactionsResourceTransaction { + type Id = stripe_treasury::treasury_transactions_resource_transaction::TreasuryTransactionId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TreasuryTransactionId); +#[cfg(feature = "treasury_transactions_resource_transaction")] +mod requests; +#[cfg(feature = "treasury_transactions_resource_transaction")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_transactions_resource_transaction/requests.rs b/generated/stripe_treasury/src/treasury_transactions_resource_transaction/requests.rs new file mode 100644 index 000000000..b1ea6f5eb --- /dev/null +++ b/generated/stripe_treasury/src/treasury_transactions_resource_transaction/requests.rs @@ -0,0 +1,203 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryTransactionsResourceTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryTransactionsResourceTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryTransactionsResourceTransaction<'a> { + /// Retrieves the details of an existing Transaction. + pub fn send(&self, client: &stripe::Client, id: &stripe_treasury::treasury_transactions_resource_transaction::TreasuryTransactionId) -> stripe::Response { + client.get_query(&format!("/treasury/transactions/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryTransactionsResourceTransaction<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Returns objects associated with this FinancialAccount. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// The results are in reverse chronological order by `created` or `posted_at`. + /// + /// The default is `created`. + #[serde(skip_serializing_if = "Option::is_none")] + pub order_by: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return Transactions that have the given status: `open`, `posted`, or `void`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// A filter for the `status_transitions.posted_at` timestamp. + /// + /// When using this filter, `status=posted` and `order_by=posted_at` must also be specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub status_transitions: Option, +} +impl<'a> ListTreasuryTransactionsResourceTransaction<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { + created: Default::default(), + ending_before: Default::default(), + expand: Default::default(), + financial_account, + limit: Default::default(), + order_by: Default::default(), + starting_after: Default::default(), + status: Default::default(), + status_transitions: Default::default(), + } + } +} +/// The results are in reverse chronological order by `created` or `posted_at`. +/// +/// The default is `created`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTreasuryTransactionsResourceTransactionOrderBy { + Created, + PostedAt, +} +impl ListTreasuryTransactionsResourceTransactionOrderBy { + pub fn as_str(self) -> &'static str { + use ListTreasuryTransactionsResourceTransactionOrderBy::*; + match self { + Created => "created", + PostedAt => "posted_at", + } + } +} + +impl std::str::FromStr for ListTreasuryTransactionsResourceTransactionOrderBy { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTreasuryTransactionsResourceTransactionOrderBy::*; + match s { + "created" => Ok(Created), + "posted_at" => Ok(PostedAt), + _ => Err(()), + } + } +} +impl AsRef for ListTreasuryTransactionsResourceTransactionOrderBy { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListTreasuryTransactionsResourceTransactionOrderBy { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTreasuryTransactionsResourceTransactionOrderBy { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTreasuryTransactionsResourceTransactionOrderBy { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only return Transactions that have the given status: `open`, `posted`, or `void`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTreasuryTransactionsResourceTransactionStatus { + Open, + Posted, + Void, +} +impl ListTreasuryTransactionsResourceTransactionStatus { + pub fn as_str(self) -> &'static str { + use ListTreasuryTransactionsResourceTransactionStatus::*; + match self { + Open => "open", + Posted => "posted", + Void => "void", + } + } +} + +impl std::str::FromStr for ListTreasuryTransactionsResourceTransactionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTreasuryTransactionsResourceTransactionStatus::*; + match s { + "open" => Ok(Open), + "posted" => Ok(Posted), + "void" => Ok(Void), + _ => Err(()), + } + } +} +impl AsRef for ListTreasuryTransactionsResourceTransactionStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListTreasuryTransactionsResourceTransactionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTreasuryTransactionsResourceTransactionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTreasuryTransactionsResourceTransactionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A filter for the `status_transitions.posted_at` timestamp. +/// +/// When using this filter, `status=posted` and `order_by=posted_at` must also be specified. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTreasuryTransactionsResourceTransactionStatusTransitions { + /// Returns Transactions with `posted_at` within the specified range. + #[serde(skip_serializing_if = "Option::is_none")] + pub posted_at: Option, +} +impl ListTreasuryTransactionsResourceTransactionStatusTransitions { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTreasuryTransactionsResourceTransaction<'a> { + /// Retrieves a list of Transaction objects. + pub fn send(&self, client: &stripe::Client) -> stripe::Response> { + client.get_query("/treasury/transactions", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/treasury/transactions", self) + } +} +impl<'a> stripe::PaginationParams for ListTreasuryTransactionsResourceTransaction<'a> {} diff --git a/generated/stripe_treasury/src/treasury_transactions_resource_transaction_entry/mod.rs b/generated/stripe_treasury/src/treasury_transactions_resource_transaction_entry/mod.rs new file mode 100644 index 000000000..7567abc56 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_transactions_resource_transaction_entry/mod.rs @@ -0,0 +1,238 @@ +/// TransactionEntries represent individual units of money movements within a single [Transaction](https://stripe.com/docs/api#transactions). +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryTransactionsResourceTransactionEntry { + pub balance_impact: stripe_treasury::TreasuryTransactionsResourceBalanceImpact, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// When the TransactionEntry will impact the FinancialAccount's balance. + pub effective_at: stripe_types::Timestamp, + /// The FinancialAccount associated with this object. + pub financial_account: String, + /// Token of the flow associated with the TransactionEntry. + pub flow: Option, + /// Details of the flow associated with the TransactionEntry. + pub flow_details: Option, + /// Type of the flow associated with the TransactionEntry. + pub flow_type: TreasuryTransactionsResourceTransactionEntryFlowType, + /// Unique identifier for the object. + pub id: stripe_treasury::treasury_transactions_resource_transaction_entry::TreasuryTransactionEntryId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The Transaction associated with this object. + pub transaction: stripe_types::Expandable, + /// The specific money movement that generated the TransactionEntry. + #[serde(rename = "type")] + pub type_: TreasuryTransactionsResourceTransactionEntryType, +} +/// Type of the flow associated with the TransactionEntry. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryTransactionsResourceTransactionEntryFlowType { + CreditReversal, + DebitReversal, + InboundTransfer, + IssuingAuthorization, + Other, + OutboundPayment, + OutboundTransfer, + ReceivedCredit, + ReceivedDebit, +} +impl TreasuryTransactionsResourceTransactionEntryFlowType { + pub fn as_str(self) -> &'static str { + use TreasuryTransactionsResourceTransactionEntryFlowType::*; + match self { + CreditReversal => "credit_reversal", + DebitReversal => "debit_reversal", + InboundTransfer => "inbound_transfer", + IssuingAuthorization => "issuing_authorization", + Other => "other", + OutboundPayment => "outbound_payment", + OutboundTransfer => "outbound_transfer", + ReceivedCredit => "received_credit", + ReceivedDebit => "received_debit", + } + } +} + +impl std::str::FromStr for TreasuryTransactionsResourceTransactionEntryFlowType { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryTransactionsResourceTransactionEntryFlowType::*; + match s { + "credit_reversal" => Ok(CreditReversal), + "debit_reversal" => Ok(DebitReversal), + "inbound_transfer" => Ok(InboundTransfer), + "issuing_authorization" => Ok(IssuingAuthorization), + "other" => Ok(Other), + "outbound_payment" => Ok(OutboundPayment), + "outbound_transfer" => Ok(OutboundTransfer), + "received_credit" => Ok(ReceivedCredit), + "received_debit" => Ok(ReceivedDebit), + _ => Err(()), + } + } +} +impl AsRef for TreasuryTransactionsResourceTransactionEntryFlowType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryTransactionsResourceTransactionEntryFlowType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryTransactionsResourceTransactionEntryFlowType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryTransactionsResourceTransactionEntryFlowType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryTransactionsResourceTransactionEntryFlowType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryTransactionsResourceTransactionEntryFlowType")) + } +} +/// The specific money movement that generated the TransactionEntry. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum TreasuryTransactionsResourceTransactionEntryType { + CreditReversal, + CreditReversalPosting, + DebitReversal, + InboundTransfer, + InboundTransferReturn, + IssuingAuthorizationHold, + IssuingAuthorizationRelease, + Other, + OutboundPayment, + OutboundPaymentCancellation, + OutboundPaymentFailure, + OutboundPaymentPosting, + OutboundPaymentReturn, + OutboundTransfer, + OutboundTransferCancellation, + OutboundTransferFailure, + OutboundTransferPosting, + OutboundTransferReturn, + ReceivedCredit, + ReceivedDebit, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl TreasuryTransactionsResourceTransactionEntryType { + pub fn as_str(self) -> &'static str { + use TreasuryTransactionsResourceTransactionEntryType::*; + match self { + CreditReversal => "credit_reversal", + CreditReversalPosting => "credit_reversal_posting", + DebitReversal => "debit_reversal", + InboundTransfer => "inbound_transfer", + InboundTransferReturn => "inbound_transfer_return", + IssuingAuthorizationHold => "issuing_authorization_hold", + IssuingAuthorizationRelease => "issuing_authorization_release", + Other => "other", + OutboundPayment => "outbound_payment", + OutboundPaymentCancellation => "outbound_payment_cancellation", + OutboundPaymentFailure => "outbound_payment_failure", + OutboundPaymentPosting => "outbound_payment_posting", + OutboundPaymentReturn => "outbound_payment_return", + OutboundTransfer => "outbound_transfer", + OutboundTransferCancellation => "outbound_transfer_cancellation", + OutboundTransferFailure => "outbound_transfer_failure", + OutboundTransferPosting => "outbound_transfer_posting", + OutboundTransferReturn => "outbound_transfer_return", + ReceivedCredit => "received_credit", + ReceivedDebit => "received_debit", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for TreasuryTransactionsResourceTransactionEntryType { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryTransactionsResourceTransactionEntryType::*; + match s { + "credit_reversal" => Ok(CreditReversal), + "credit_reversal_posting" => Ok(CreditReversalPosting), + "debit_reversal" => Ok(DebitReversal), + "inbound_transfer" => Ok(InboundTransfer), + "inbound_transfer_return" => Ok(InboundTransferReturn), + "issuing_authorization_hold" => Ok(IssuingAuthorizationHold), + "issuing_authorization_release" => Ok(IssuingAuthorizationRelease), + "other" => Ok(Other), + "outbound_payment" => Ok(OutboundPayment), + "outbound_payment_cancellation" => Ok(OutboundPaymentCancellation), + "outbound_payment_failure" => Ok(OutboundPaymentFailure), + "outbound_payment_posting" => Ok(OutboundPaymentPosting), + "outbound_payment_return" => Ok(OutboundPaymentReturn), + "outbound_transfer" => Ok(OutboundTransfer), + "outbound_transfer_cancellation" => Ok(OutboundTransferCancellation), + "outbound_transfer_failure" => Ok(OutboundTransferFailure), + "outbound_transfer_posting" => Ok(OutboundTransferPosting), + "outbound_transfer_return" => Ok(OutboundTransferReturn), + "received_credit" => Ok(ReceivedCredit), + "received_debit" => Ok(ReceivedDebit), + _ => Err(()), + } + } +} +impl AsRef for TreasuryTransactionsResourceTransactionEntryType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TreasuryTransactionsResourceTransactionEntryType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryTransactionsResourceTransactionEntryType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryTransactionsResourceTransactionEntryType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryTransactionsResourceTransactionEntryType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(TreasuryTransactionsResourceTransactionEntryType::Unknown)) + } +} +impl stripe_types::Object for TreasuryTransactionsResourceTransactionEntry { + type Id = stripe_treasury::treasury_transactions_resource_transaction_entry::TreasuryTransactionEntryId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TreasuryTransactionEntryId); +#[cfg(feature = "treasury_transactions_resource_transaction_entry")] +mod requests; +#[cfg(feature = "treasury_transactions_resource_transaction_entry")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_transactions_resource_transaction_entry/requests.rs b/generated/stripe_treasury/src/treasury_transactions_resource_transaction_entry/requests.rs new file mode 100644 index 000000000..ab18a7652 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_transactions_resource_transaction_entry/requests.rs @@ -0,0 +1,132 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryTransactionsResourceTransactionEntry<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryTransactionsResourceTransactionEntry<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryTransactionsResourceTransactionEntry<'a> { + /// Retrieves a TransactionEntry object. + pub fn send(&self, client: &stripe::Client, id: &stripe_treasury::treasury_transactions_resource_transaction_entry::TreasuryTransactionEntryId) -> stripe::Response { + client.get_query(&format!("/treasury/transaction_entries/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryTransactionsResourceTransactionEntry<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_at: Option, + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Returns objects associated with this FinancialAccount. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// The results are in reverse chronological order by `created` or `effective_at`. + /// + /// The default is `created`. + #[serde(skip_serializing_if = "Option::is_none")] + pub order_by: Option, + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return TransactionEntries associated with this Transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction: Option<&'a str>, +} +impl<'a> ListTreasuryTransactionsResourceTransactionEntry<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { + created: Default::default(), + effective_at: Default::default(), + ending_before: Default::default(), + expand: Default::default(), + financial_account, + limit: Default::default(), + order_by: Default::default(), + starting_after: Default::default(), + transaction: Default::default(), + } + } +} +/// The results are in reverse chronological order by `created` or `effective_at`. +/// +/// The default is `created`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTreasuryTransactionsResourceTransactionEntryOrderBy { + Created, + EffectiveAt, +} +impl ListTreasuryTransactionsResourceTransactionEntryOrderBy { + pub fn as_str(self) -> &'static str { + use ListTreasuryTransactionsResourceTransactionEntryOrderBy::*; + match self { + Created => "created", + EffectiveAt => "effective_at", + } + } +} + +impl std::str::FromStr for ListTreasuryTransactionsResourceTransactionEntryOrderBy { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTreasuryTransactionsResourceTransactionEntryOrderBy::*; + match s { + "created" => Ok(Created), + "effective_at" => Ok(EffectiveAt), + _ => Err(()), + } + } +} +impl AsRef for ListTreasuryTransactionsResourceTransactionEntryOrderBy { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ListTreasuryTransactionsResourceTransactionEntryOrderBy { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTreasuryTransactionsResourceTransactionEntryOrderBy { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTreasuryTransactionsResourceTransactionEntryOrderBy { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListTreasuryTransactionsResourceTransactionEntry<'a> { + /// Retrieves a list of TransactionEntry objects. + pub fn send(&self, client: &stripe::Client) -> stripe::Response> { + client.get_query("/treasury/transaction_entries", self) + } + pub fn paginate(self) -> stripe::ListPaginator { + stripe::ListPaginator::from_params("/treasury/transaction_entries", self) + } +} +impl<'a> stripe::PaginationParams for ListTreasuryTransactionsResourceTransactionEntry<'a> {} diff --git a/stripe_types/src/generated/account/mod.rs b/stripe_types/src/generated/account/mod.rs new file mode 100644 index 000000000..ffe76d273 --- /dev/null +++ b/stripe_types/src/generated/account/mod.rs @@ -0,0 +1,213 @@ +/// This is an object representing a Stripe account. +/// +/// You can retrieve it to see properties on the account like its current requirements or if the account is enabled to make live charges or receive payouts. For Custom accounts, the properties below are always returned. +/// For other accounts, some properties are returned until that account has started to go through Connect Onboarding. +/// Once you create an [Account Link](https://stripe.com/docs/api/account_links) for a Standard or Express account, some parameters are no longer returned. +/// These are marked as **Custom Only** or **Custom and Express** below. +/// Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts). For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Account { + /// Business information about the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub business_profile: Option, + /// The business type. + #[serde(skip_serializing_if = "Option::is_none")] + pub business_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub capabilities: Option, + /// Whether the account can create live charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub charges_enabled: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub company: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub controller: Option, + /// The account's country. + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option, + /// Time at which the account was connected. + /// + /// Measured in seconds since the Unix epoch. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Three-letter ISO currency code representing the default currency for the account. + /// + /// This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). + #[serde(skip_serializing_if = "Option::is_none")] + pub default_currency: Option, + /// Whether account details have been submitted. + /// + /// Standard accounts cannot receive payouts before this is true. + #[serde(skip_serializing_if = "Option::is_none")] + pub details_submitted: Option, + /// An email address associated with the account. + /// + /// It's not used for authentication and Stripe doesn't market to this field without explicit approval from the platform. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option, + /// External accounts (bank accounts and debit cards) currently attached to this account. + #[serde(default)] + pub external_accounts: stripe_types::List, + #[serde(skip_serializing_if = "Option::is_none")] + pub future_requirements: Option, + /// Unique identifier for the object. + pub id: stripe_types::account::AccountId, + #[serde(skip_serializing_if = "Option::is_none")] + pub individual: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option>, + /// Whether Stripe can send payouts to this account. + #[serde(skip_serializing_if = "Option::is_none")] + pub payouts_enabled: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub requirements: Option, + /// Options for customizing how the account functions within Stripe. + #[serde(skip_serializing_if = "Option::is_none")] + pub settings: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_acceptance: Option, + /// The Stripe account type. + /// + /// Can be `standard`, `express`, or `custom`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +/// The business type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountBusinessType { + Company, + GovernmentEntity, + Individual, + NonProfit, +} +impl AccountBusinessType { + pub fn as_str(self) -> &'static str { + use AccountBusinessType::*; + match self { + Company => "company", + GovernmentEntity => "government_entity", + Individual => "individual", + NonProfit => "non_profit", + } + } +} + +impl std::str::FromStr for AccountBusinessType { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountBusinessType::*; + match s { + "company" => Ok(Company), + "government_entity" => Ok(GovernmentEntity), + "individual" => Ok(Individual), + "non_profit" => Ok(NonProfit), + _ => Err(()), + } + } +} +impl AsRef for AccountBusinessType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountBusinessType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountBusinessType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountBusinessType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountBusinessType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for AccountBusinessType")) + } +} +/// The Stripe account type. +/// +/// Can be `standard`, `express`, or `custom`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountType { + Custom, + Express, + Standard, +} +impl AccountType { + pub fn as_str(self) -> &'static str { + use AccountType::*; + match self { + Custom => "custom", + Express => "express", + Standard => "standard", + } + } +} + +impl std::str::FromStr for AccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountType::*; + match s { + "custom" => Ok(Custom), + "express" => Ok(Express), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for AccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for AccountType")) + } +} +impl stripe_types::Object for Account { + type Id = stripe_types::account::AccountId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(AccountId, "acct_"); diff --git a/stripe_types/src/generated/account_bacs_debit_payments_settings/mod.rs b/stripe_types/src/generated/account_bacs_debit_payments_settings/mod.rs new file mode 100644 index 000000000..51a17121e --- /dev/null +++ b/stripe_types/src/generated/account_bacs_debit_payments_settings/mod.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountBacsDebitPaymentsSettings { + /// The Bacs Direct Debit display name for this account. + /// + /// For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. + /// Mobile banking apps display it as the name of the business. + /// To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. + /// Custom branding incurs an additional monthly fee for the platform. + /// The fee appears 5 business days after requesting Bacs. + /// If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. + pub display_name: Option, + /// The Bacs Direct Debit Service user number for this account. + /// + /// For payments made with Bacs Direct Debit, this number is a unique identifier of the account with our banking partners. + pub service_user_number: Option, +} diff --git a/stripe_types/src/generated/account_branding_settings/mod.rs b/stripe_types/src/generated/account_branding_settings/mod.rs new file mode 100644 index 000000000..a3d39e32e --- /dev/null +++ b/stripe_types/src/generated/account_branding_settings/mod.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountBrandingSettings { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. + /// + /// Must be square and at least 128px x 128px. + pub icon: Option>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. + /// + /// Must be at least 128px x 128px. + pub logo: Option>, + /// A CSS hex color value representing the primary branding color for this account. + pub primary_color: Option, + /// A CSS hex color value representing the secondary branding color for this account. + pub secondary_color: Option, +} diff --git a/stripe_types/src/generated/account_business_profile/mod.rs b/stripe_types/src/generated/account_business_profile/mod.rs new file mode 100644 index 000000000..8ca78b63a --- /dev/null +++ b/stripe_types/src/generated/account_business_profile/mod.rs @@ -0,0 +1,26 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountBusinessProfile { + /// [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). + /// + /// MCCs are used to classify businesses based on the goods or services they provide. + pub mcc: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub monthly_estimated_revenue: Option, + /// The customer-facing business name. + pub name: Option, + /// Internal-only description of the product sold or service provided by the business. + /// + /// It's used by Stripe for risk and underwriting purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option, + /// A publicly available mailing address for sending support issues to. + pub support_address: Option, + /// A publicly available email address for sending support issues to. + pub support_email: Option, + /// A publicly available phone number to call with support issues. + pub support_phone: Option, + /// A publicly available website for handling support issues. + pub support_url: Option, + /// The business's publicly available website. + pub url: Option, +} diff --git a/stripe_types/src/generated/account_capabilities/mod.rs b/stripe_types/src/generated/account_capabilities/mod.rs new file mode 100644 index 000000000..4c8cc4bb7 --- /dev/null +++ b/stripe_types/src/generated/account_capabilities/mod.rs @@ -0,0 +1,2449 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountCapabilities { + /// The status of the Canadian pre-authorized debits payments capability of the account, or whether the account can directly process Canadian pre-authorized debits charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit_payments: Option, + /// The status of the Affirm capability of the account, or whether the account can directly process Affirm charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm_payments: Option, + /// The status of the Afterpay Clearpay capability of the account, or whether the account can directly process Afterpay Clearpay charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay_payments: Option, + /// The status of the BECS Direct Debit (AU) payments capability of the account, or whether the account can directly process BECS Direct Debit (AU) charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit_payments: Option, + /// The status of the Bacs Direct Debits payments capability of the account, or whether the account can directly process Bacs Direct Debits charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit_payments: Option, + /// The status of the Bancontact payments capability of the account, or whether the account can directly process Bancontact charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact_payments: Option, + /// The status of the customer_balance payments capability of the account, or whether the account can directly process customer_balance charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer_payments: Option, + /// The status of the blik payments capability of the account, or whether the account can directly process blik charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik_payments: Option, + /// The status of the boleto payments capability of the account, or whether the account can directly process boleto charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto_payments: Option, + /// The status of the card issuing capability of the account, or whether you can use Issuing to distribute funds on cards. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option, + /// The status of the card payments capability of the account, or whether the account can directly process credit and debit card charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_payments: Option, + /// The status of the Cartes Bancaires payments capability of the account, or whether the account can directly process Cartes Bancaires card charges in EUR currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub cartes_bancaires_payments: Option, + /// The status of the Cash App Pay capability of the account, or whether the account can directly process Cash App Pay payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp_payments: Option, + /// The status of the EPS payments capability of the account, or whether the account can directly process EPS charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps_payments: Option, + /// The status of the FPX payments capability of the account, or whether the account can directly process FPX charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx_payments: Option, + /// The status of the giropay payments capability of the account, or whether the account can directly process giropay charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay_payments: Option, + /// The status of the GrabPay payments capability of the account, or whether the account can directly process GrabPay charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay_payments: Option, + /// The status of the iDEAL payments capability of the account, or whether the account can directly process iDEAL charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal_payments: Option, + /// The status of the india_international_payments capability of the account, or whether the account can process international charges (non INR) in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub india_international_payments: Option, + /// The status of the JCB payments capability of the account, or whether the account (Japan only) can directly process JCB credit card charges in JPY currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub jcb_payments: Option, + /// The status of the Klarna payments capability of the account, or whether the account can directly process Klarna charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna_payments: Option, + /// The status of the konbini payments capability of the account, or whether the account can directly process konbini charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini_payments: Option, + /// The status of the legacy payments capability of the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub legacy_payments: Option, + /// The status of the link_payments capability of the account, or whether the account can directly process Link charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub link_payments: Option, + /// The status of the OXXO payments capability of the account, or whether the account can directly process OXXO charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo_payments: Option, + /// The status of the P24 payments capability of the account, or whether the account can directly process P24 charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24_payments: Option, + /// The status of the paynow payments capability of the account, or whether the account can directly process paynow charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow_payments: Option, + /// The status of the promptpay payments capability of the account, or whether the account can directly process promptpay charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay_payments: Option, + /// The status of the RevolutPay capability of the account, or whether the account can directly process RevolutPay payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay_payments: Option, + /// The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit_payments: Option, + /// The status of the Sofort payments capability of the account, or whether the account can directly process Sofort charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort_payments: Option, + /// The status of the tax reporting 1099-K (US) capability of the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_reporting_us_1099_k: Option, + /// The status of the tax reporting 1099-MISC (US) capability of the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_reporting_us_1099_misc: Option, + /// The status of the transfers capability of the account, or whether your platform can transfer funds to the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfers: Option, + /// The status of the banking capability, or whether the account can have bank accounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option, + /// The status of the US bank account ACH payments capability of the account, or whether the account can directly process US bank account charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account_ach_payments: Option, + /// The status of the Zip capability of the account, or whether the account can directly process Zip charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip_payments: Option, +} +/// The status of the Canadian pre-authorized debits payments capability of the account, or whether the account can directly process Canadian pre-authorized debits charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesAcssDebitPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesAcssDebitPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesAcssDebitPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesAcssDebitPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesAcssDebitPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesAcssDebitPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesAcssDebitPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesAcssDebitPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesAcssDebitPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesAcssDebitPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesAcssDebitPayments") + }) + } +} +/// The status of the Affirm capability of the account, or whether the account can directly process Affirm charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesAffirmPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesAffirmPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesAffirmPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesAffirmPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesAffirmPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesAffirmPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesAffirmPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesAffirmPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesAffirmPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesAffirmPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesAffirmPayments") + }) + } +} +/// The status of the Afterpay Clearpay capability of the account, or whether the account can directly process Afterpay Clearpay charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesAfterpayClearpayPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesAfterpayClearpayPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesAfterpayClearpayPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesAfterpayClearpayPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesAfterpayClearpayPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesAfterpayClearpayPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesAfterpayClearpayPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesAfterpayClearpayPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesAfterpayClearpayPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesAfterpayClearpayPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for AccountCapabilitiesAfterpayClearpayPayments", + ) + }) + } +} +/// The status of the BECS Direct Debit (AU) payments capability of the account, or whether the account can directly process BECS Direct Debit (AU) charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesAuBecsDebitPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesAuBecsDebitPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesAuBecsDebitPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesAuBecsDebitPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesAuBecsDebitPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesAuBecsDebitPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesAuBecsDebitPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesAuBecsDebitPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesAuBecsDebitPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesAuBecsDebitPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesAuBecsDebitPayments") + }) + } +} +/// The status of the Bacs Direct Debits payments capability of the account, or whether the account can directly process Bacs Direct Debits charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesBacsDebitPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesBacsDebitPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesBacsDebitPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesBacsDebitPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesBacsDebitPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesBacsDebitPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesBacsDebitPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesBacsDebitPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesBacsDebitPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesBacsDebitPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesBacsDebitPayments") + }) + } +} +/// The status of the Bancontact payments capability of the account, or whether the account can directly process Bancontact charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesBancontactPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesBancontactPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesBancontactPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesBancontactPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesBancontactPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesBancontactPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesBancontactPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesBancontactPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesBancontactPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesBancontactPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesBancontactPayments") + }) + } +} +/// The status of the customer_balance payments capability of the account, or whether the account can directly process customer_balance charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesBankTransferPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesBankTransferPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesBankTransferPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesBankTransferPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesBankTransferPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesBankTransferPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesBankTransferPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesBankTransferPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesBankTransferPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesBankTransferPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesBankTransferPayments") + }) + } +} +/// The status of the blik payments capability of the account, or whether the account can directly process blik charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesBlikPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesBlikPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesBlikPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesBlikPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesBlikPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesBlikPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesBlikPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesBlikPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesBlikPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesBlikPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesBlikPayments") + }) + } +} +/// The status of the boleto payments capability of the account, or whether the account can directly process boleto charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesBoletoPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesBoletoPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesBoletoPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesBoletoPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesBoletoPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesBoletoPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesBoletoPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesBoletoPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesBoletoPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesBoletoPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesBoletoPayments") + }) + } +} +/// The status of the card issuing capability of the account, or whether you can use Issuing to distribute funds on cards. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesCardIssuing { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesCardIssuing { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesCardIssuing::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesCardIssuing { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesCardIssuing::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesCardIssuing { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesCardIssuing { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesCardIssuing { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesCardIssuing { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesCardIssuing { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesCardIssuing") + }) + } +} +/// The status of the card payments capability of the account, or whether the account can directly process credit and debit card charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesCardPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesCardPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesCardPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesCardPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesCardPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesCardPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesCardPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesCardPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesCardPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesCardPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesCardPayments") + }) + } +} +/// The status of the Cartes Bancaires payments capability of the account, or whether the account can directly process Cartes Bancaires card charges in EUR currency. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesCartesBancairesPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesCartesBancairesPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesCartesBancairesPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesCartesBancairesPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesCartesBancairesPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesCartesBancairesPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesCartesBancairesPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesCartesBancairesPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesCartesBancairesPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesCartesBancairesPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesCartesBancairesPayments") + }) + } +} +/// The status of the Cash App Pay capability of the account, or whether the account can directly process Cash App Pay payments. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesCashappPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesCashappPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesCashappPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesCashappPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesCashappPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesCashappPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesCashappPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesCashappPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesCashappPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesCashappPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesCashappPayments") + }) + } +} +/// The status of the EPS payments capability of the account, or whether the account can directly process EPS charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesEpsPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesEpsPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesEpsPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesEpsPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesEpsPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesEpsPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesEpsPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesEpsPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesEpsPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesEpsPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesEpsPayments") + }) + } +} +/// The status of the FPX payments capability of the account, or whether the account can directly process FPX charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesFpxPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesFpxPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesFpxPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesFpxPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesFpxPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesFpxPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesFpxPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesFpxPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesFpxPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesFpxPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesFpxPayments") + }) + } +} +/// The status of the giropay payments capability of the account, or whether the account can directly process giropay charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesGiropayPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesGiropayPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesGiropayPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesGiropayPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesGiropayPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesGiropayPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesGiropayPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesGiropayPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesGiropayPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesGiropayPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesGiropayPayments") + }) + } +} +/// The status of the GrabPay payments capability of the account, or whether the account can directly process GrabPay charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesGrabpayPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesGrabpayPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesGrabpayPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesGrabpayPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesGrabpayPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesGrabpayPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesGrabpayPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesGrabpayPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesGrabpayPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesGrabpayPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesGrabpayPayments") + }) + } +} +/// The status of the iDEAL payments capability of the account, or whether the account can directly process iDEAL charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesIdealPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesIdealPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesIdealPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesIdealPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesIdealPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesIdealPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesIdealPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesIdealPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesIdealPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesIdealPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesIdealPayments") + }) + } +} +/// The status of the india_international_payments capability of the account, or whether the account can process international charges (non INR) in India. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesIndiaInternationalPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesIndiaInternationalPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesIndiaInternationalPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesIndiaInternationalPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesIndiaInternationalPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesIndiaInternationalPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesIndiaInternationalPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesIndiaInternationalPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesIndiaInternationalPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesIndiaInternationalPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for AccountCapabilitiesIndiaInternationalPayments", + ) + }) + } +} +/// The status of the JCB payments capability of the account, or whether the account (Japan only) can directly process JCB credit card charges in JPY currency. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesJcbPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesJcbPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesJcbPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesJcbPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesJcbPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesJcbPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesJcbPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesJcbPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesJcbPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesJcbPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesJcbPayments") + }) + } +} +/// The status of the Klarna payments capability of the account, or whether the account can directly process Klarna charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesKlarnaPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesKlarnaPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesKlarnaPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesKlarnaPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesKlarnaPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesKlarnaPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesKlarnaPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesKlarnaPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesKlarnaPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesKlarnaPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesKlarnaPayments") + }) + } +} +/// The status of the konbini payments capability of the account, or whether the account can directly process konbini charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesKonbiniPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesKonbiniPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesKonbiniPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesKonbiniPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesKonbiniPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesKonbiniPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesKonbiniPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesKonbiniPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesKonbiniPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesKonbiniPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesKonbiniPayments") + }) + } +} +/// The status of the legacy payments capability of the account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesLegacyPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesLegacyPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesLegacyPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesLegacyPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesLegacyPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesLegacyPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesLegacyPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesLegacyPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesLegacyPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesLegacyPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesLegacyPayments") + }) + } +} +/// The status of the link_payments capability of the account, or whether the account can directly process Link charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesLinkPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesLinkPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesLinkPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesLinkPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesLinkPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesLinkPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesLinkPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesLinkPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesLinkPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesLinkPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesLinkPayments") + }) + } +} +/// The status of the OXXO payments capability of the account, or whether the account can directly process OXXO charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesOxxoPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesOxxoPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesOxxoPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesOxxoPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesOxxoPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesOxxoPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesOxxoPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesOxxoPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesOxxoPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesOxxoPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesOxxoPayments") + }) + } +} +/// The status of the P24 payments capability of the account, or whether the account can directly process P24 charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesP24Payments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesP24Payments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesP24Payments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesP24Payments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesP24Payments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesP24Payments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesP24Payments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesP24Payments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesP24Payments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesP24Payments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesP24Payments") + }) + } +} +/// The status of the paynow payments capability of the account, or whether the account can directly process paynow charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesPaynowPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesPaynowPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesPaynowPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesPaynowPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesPaynowPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesPaynowPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesPaynowPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesPaynowPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesPaynowPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesPaynowPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesPaynowPayments") + }) + } +} +/// The status of the promptpay payments capability of the account, or whether the account can directly process promptpay charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesPromptpayPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesPromptpayPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesPromptpayPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesPromptpayPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesPromptpayPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesPromptpayPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesPromptpayPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesPromptpayPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesPromptpayPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesPromptpayPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesPromptpayPayments") + }) + } +} +/// The status of the RevolutPay capability of the account, or whether the account can directly process RevolutPay payments. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesRevolutPayPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesRevolutPayPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesRevolutPayPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesRevolutPayPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesRevolutPayPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesRevolutPayPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesRevolutPayPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesRevolutPayPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesRevolutPayPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesRevolutPayPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesRevolutPayPayments") + }) + } +} +/// The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesSepaDebitPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesSepaDebitPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesSepaDebitPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesSepaDebitPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesSepaDebitPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesSepaDebitPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesSepaDebitPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesSepaDebitPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesSepaDebitPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesSepaDebitPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesSepaDebitPayments") + }) + } +} +/// The status of the Sofort payments capability of the account, or whether the account can directly process Sofort charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesSofortPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesSofortPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesSofortPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesSofortPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesSofortPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesSofortPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesSofortPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesSofortPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesSofortPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesSofortPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesSofortPayments") + }) + } +} +/// The status of the tax reporting 1099-K (US) capability of the account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesTaxReportingUs1099K { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesTaxReportingUs1099K { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesTaxReportingUs1099K::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesTaxReportingUs1099K { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesTaxReportingUs1099K::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesTaxReportingUs1099K { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesTaxReportingUs1099K { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesTaxReportingUs1099K { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesTaxReportingUs1099K { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesTaxReportingUs1099K { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesTaxReportingUs1099K") + }) + } +} +/// The status of the tax reporting 1099-MISC (US) capability of the account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesTaxReportingUs1099Misc { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesTaxReportingUs1099Misc { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesTaxReportingUs1099Misc::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesTaxReportingUs1099Misc { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesTaxReportingUs1099Misc::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesTaxReportingUs1099Misc { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesTaxReportingUs1099Misc { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesTaxReportingUs1099Misc { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesTaxReportingUs1099Misc { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesTaxReportingUs1099Misc { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesTaxReportingUs1099Misc") + }) + } +} +/// The status of the transfers capability of the account, or whether your platform can transfer funds to the account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesTransfers { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesTransfers { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesTransfers::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesTransfers { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesTransfers::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesTransfers { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesTransfers { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesTransfers { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesTransfers { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesTransfers { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for AccountCapabilitiesTransfers")) + } +} +/// The status of the banking capability, or whether the account can have bank accounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesTreasury { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesTreasury { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesTreasury::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesTreasury { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesTreasury::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesTreasury { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesTreasury { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesTreasury { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesTreasury { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesTreasury { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for AccountCapabilitiesTreasury")) + } +} +/// The status of the US bank account ACH payments capability of the account, or whether the account can directly process US bank account charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesUsBankAccountAchPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesUsBankAccountAchPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesUsBankAccountAchPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesUsBankAccountAchPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesUsBankAccountAchPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesUsBankAccountAchPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesUsBankAccountAchPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesUsBankAccountAchPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesUsBankAccountAchPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesUsBankAccountAchPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for AccountCapabilitiesUsBankAccountAchPayments", + ) + }) + } +} +/// The status of the Zip capability of the account, or whether the account can directly process Zip charges. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesZipPayments { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesZipPayments { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesZipPayments::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesZipPayments { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesZipPayments::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilitiesZipPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilitiesZipPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesZipPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesZipPayments { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesZipPayments { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountCapabilitiesZipPayments") + }) + } +} diff --git a/stripe_types/src/generated/account_capability/mod.rs b/stripe_types/src/generated/account_capability/mod.rs new file mode 100644 index 000000000..257a2d2d5 --- /dev/null +++ b/stripe_types/src/generated/account_capability/mod.rs @@ -0,0 +1,103 @@ +/// This is an object representing a capability for a Stripe account. +/// +/// Related guide: [Account capabilities](https://stripe.com/docs/connect/account-capabilities) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountCapability { + /// The account for which the capability enables functionality. + pub account: stripe_types::Expandable, + #[serde(skip_serializing_if = "Option::is_none")] + pub future_requirements: Option, + /// The identifier for the capability. + pub id: stripe_types::account_capability::CapabilityId, + /// Whether the capability has been requested. + pub requested: bool, + /// Time at which the capability was requested. + /// + /// Measured in seconds since the Unix epoch. + pub requested_at: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub requirements: Option, + /// The status of the capability. + /// + /// Can be `active`, `inactive`, `pending`, or `unrequested`. + pub status: AccountCapabilityStatus, +} +/// The status of the capability. +/// +/// Can be `active`, `inactive`, `pending`, or `unrequested`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilityStatus { + Active, + Disabled, + Inactive, + Pending, + Unrequested, +} +impl AccountCapabilityStatus { + pub fn as_str(self) -> &'static str { + use AccountCapabilityStatus::*; + match self { + Active => "active", + Disabled => "disabled", + Inactive => "inactive", + Pending => "pending", + Unrequested => "unrequested", + } + } +} + +impl std::str::FromStr for AccountCapabilityStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilityStatus::*; + match s { + "active" => Ok(Active), + "disabled" => Ok(Disabled), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + "unrequested" => Ok(Unrequested), + _ => Err(()), + } + } +} +impl AsRef for AccountCapabilityStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountCapabilityStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilityStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilityStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilityStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for AccountCapabilityStatus")) + } +} +impl stripe_types::Object for AccountCapability { + type Id = stripe_types::account_capability::CapabilityId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(CapabilityId); diff --git a/stripe_types/src/generated/account_capability_future_requirements/mod.rs b/stripe_types/src/generated/account_capability_future_requirements/mod.rs new file mode 100644 index 000000000..62f3989e2 --- /dev/null +++ b/stripe_types/src/generated/account_capability_future_requirements/mod.rs @@ -0,0 +1,31 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountCapabilityFutureRequirements { + /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + pub alternatives: Option>, + /// Date on which `future_requirements` merges with the main `requirements` hash and `future_requirements` becomes empty. + /// + /// After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on the capability's enablement state prior to transitioning. + pub current_deadline: Option, + /// Fields that need to be collected to keep the capability enabled. + /// + /// If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. + pub currently_due: Vec, + /// This is typed as a string for consistency with `requirements.disabled_reason`, but it safe to assume `future_requirements.disabled_reason` is empty because fields in `future_requirements` will never disable the account. + pub disabled_reason: Option, + /// Fields that are `currently_due` and need to be collected again because validation or verification failed. + pub errors: Vec, + /// Fields that need to be collected assuming all volume thresholds are reached. + /// + /// As they become required, they appear in `currently_due` as well. + pub eventually_due: Vec, + /// Fields that weren't collected by `requirements.current_deadline`. + /// + /// These fields need to be collected to enable the capability on the account. + /// New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. + pub past_due: Vec, + /// Fields that may become required depending on the results of verification or review. + /// + /// Will be an empty array unless an asynchronous verification is pending. + /// If verification fails, these fields move to `eventually_due` or `currently_due`. + pub pending_verification: Vec, +} diff --git a/stripe_types/src/generated/account_capability_requirements/mod.rs b/stripe_types/src/generated/account_capability_requirements/mod.rs new file mode 100644 index 000000000..d15d14f10 --- /dev/null +++ b/stripe_types/src/generated/account_capability_requirements/mod.rs @@ -0,0 +1,33 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountCapabilityRequirements { + /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + pub alternatives: Option>, + /// Date by which the fields in `currently_due` must be collected to keep the capability enabled for the account. + /// + /// These fields may disable the capability sooner if the next threshold is reached before they are collected. + pub current_deadline: Option, + /// Fields that need to be collected to keep the capability enabled. + /// + /// If not collected by `current_deadline`, these fields appear in `past_due` as well, and the capability is disabled. + pub currently_due: Vec, + /// If the capability is disabled, this string describes why. + /// + /// Can be `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.listed`, `rejected.terms_of_service`, `rejected.other`, `under_review`, or `other`. `rejected.unsupported_business` means that the account's business is not supported by the capability. + /// For example, payment methods may restrict the businesses they support in their terms of service: - [Afterpay Clearpay's terms of service](/afterpay-clearpay/legal#restricted-businesses) If you believe that the rejection is in error, please contact support at for assistance. + pub disabled_reason: Option, + /// Fields that are `currently_due` and need to be collected again because validation or verification failed. + pub errors: Vec, + /// Fields that need to be collected assuming all volume thresholds are reached. + /// + /// As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. + pub eventually_due: Vec, + /// Fields that weren't collected by `current_deadline`. + /// + /// These fields need to be collected to enable the capability on the account. + pub past_due: Vec, + /// Fields that may become required depending on the results of verification or review. + /// + /// Will be an empty array unless an asynchronous verification is pending. + /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + pub pending_verification: Vec, +} diff --git a/stripe_types/src/generated/account_card_issuing_settings/mod.rs b/stripe_types/src/generated/account_card_issuing_settings/mod.rs new file mode 100644 index 000000000..e4a0673b1 --- /dev/null +++ b/stripe_types/src/generated/account_card_issuing_settings/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountCardIssuingSettings { + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_acceptance: Option, +} diff --git a/stripe_types/src/generated/account_card_payments_settings/mod.rs b/stripe_types/src/generated/account_card_payments_settings/mod.rs new file mode 100644 index 000000000..84077b2fc --- /dev/null +++ b/stripe_types/src/generated/account_card_payments_settings/mod.rs @@ -0,0 +1,20 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountCardPaymentsSettings { + #[serde(skip_serializing_if = "Option::is_none")] + pub decline_on: Option, + /// The default text that appears on credit card statements when a charge is made. + /// + /// This field prefixes any dynamic `statement_descriptor` specified on the charge. + /// `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. + pub statement_descriptor_prefix: Option, + /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + /// + /// This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. + /// `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. + pub statement_descriptor_prefix_kana: Option, + /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + /// + /// This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. + /// `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. + pub statement_descriptor_prefix_kanji: Option, +} diff --git a/stripe_types/src/generated/account_dashboard_settings/mod.rs b/stripe_types/src/generated/account_dashboard_settings/mod.rs new file mode 100644 index 000000000..019c0b697 --- /dev/null +++ b/stripe_types/src/generated/account_dashboard_settings/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountDashboardSettings { + /// The display name for this account. + /// + /// This is used on the Stripe Dashboard to differentiate between accounts. + pub display_name: Option, + /// The timezone used in the Stripe Dashboard for this account. + /// + /// A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). + pub timezone: Option, +} diff --git a/stripe_types/src/generated/account_decline_charge_on/mod.rs b/stripe_types/src/generated/account_decline_charge_on/mod.rs new file mode 100644 index 000000000..ff89eed29 --- /dev/null +++ b/stripe_types/src/generated/account_decline_charge_on/mod.rs @@ -0,0 +1,11 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountDeclineChargeOn { + /// Whether Stripe automatically declines charges with an incorrect ZIP or postal code. + /// + /// This setting only applies when a ZIP or postal code is provided and they fail bank verification. + pub avs_failure: bool, + /// Whether Stripe automatically declines charges with an incorrect CVC. + /// + /// This setting only applies when a CVC is provided and it fails bank verification. + pub cvc_failure: bool, +} diff --git a/stripe_types/src/generated/account_future_requirements/mod.rs b/stripe_types/src/generated/account_future_requirements/mod.rs new file mode 100644 index 000000000..75ea5f56e --- /dev/null +++ b/stripe_types/src/generated/account_future_requirements/mod.rs @@ -0,0 +1,31 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountFutureRequirements { + /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + pub alternatives: Option>, + /// Date on which `future_requirements` merges with the main `requirements` hash and `future_requirements` becomes empty. + /// + /// After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on its enablement state prior to transitioning. + pub current_deadline: Option, + /// Fields that need to be collected to keep the account enabled. + /// + /// If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. + pub currently_due: Option>, + /// This is typed as a string for consistency with `requirements.disabled_reason`. + pub disabled_reason: Option, + /// Fields that are `currently_due` and need to be collected again because validation or verification failed. + pub errors: Option>, + /// Fields that need to be collected assuming all volume thresholds are reached. + /// + /// As they become required, they appear in `currently_due` as well. + pub eventually_due: Option>, + /// Fields that weren't collected by `requirements.current_deadline`. + /// + /// These fields need to be collected to enable the capability on the account. + /// New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. + pub past_due: Option>, + /// Fields that may become required depending on the results of verification or review. + /// + /// Will be an empty array unless an asynchronous verification is pending. + /// If verification fails, these fields move to `eventually_due` or `currently_due`. + pub pending_verification: Option>, +} diff --git a/stripe_types/src/generated/account_monthly_estimated_revenue/mod.rs b/stripe_types/src/generated/account_monthly_estimated_revenue/mod.rs new file mode 100644 index 000000000..e44097e5b --- /dev/null +++ b/stripe_types/src/generated/account_monthly_estimated_revenue/mod.rs @@ -0,0 +1,9 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountMonthlyEstimatedRevenue { + /// A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, +} diff --git a/stripe_types/src/generated/account_payments_settings/mod.rs b/stripe_types/src/generated/account_payments_settings/mod.rs new file mode 100644 index 000000000..9902ccf5b --- /dev/null +++ b/stripe_types/src/generated/account_payments_settings/mod.rs @@ -0,0 +1,21 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountPaymentsSettings { + /// The default text that appears on credit card statements when a charge is made. + /// + /// This field prefixes any dynamic `statement_descriptor` specified on the charge. + pub statement_descriptor: Option, + /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + pub statement_descriptor_kana: Option, + /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + pub statement_descriptor_kanji: Option, + /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + /// + /// This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. + /// `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. + pub statement_descriptor_prefix_kana: Option, + /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + /// + /// This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. + /// `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. + pub statement_descriptor_prefix_kanji: Option, +} diff --git a/stripe_types/src/generated/account_payout_settings/mod.rs b/stripe_types/src/generated/account_payout_settings/mod.rs new file mode 100644 index 000000000..a3e207dbc --- /dev/null +++ b/stripe_types/src/generated/account_payout_settings/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountPayoutSettings { + /// A Boolean indicating if Stripe should try to reclaim negative balances from an attached bank account. + /// + /// See our [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances) documentation for details. + /// Default value is `false` for Custom accounts, otherwise `true`. + pub debit_negative_balances: bool, + pub schedule: stripe_types::TransferSchedule, + /// The text that appears on the bank account statement for payouts. + /// + /// If not set, this defaults to the platform's bank descriptor as set in the Dashboard. + pub statement_descriptor: Option, +} diff --git a/stripe_types/src/generated/account_requirements/mod.rs b/stripe_types/src/generated/account_requirements/mod.rs new file mode 100644 index 000000000..28d4b0a1a --- /dev/null +++ b/stripe_types/src/generated/account_requirements/mod.rs @@ -0,0 +1,33 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountRequirements { + /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + pub alternatives: Option>, + /// Date by which the fields in `currently_due` must be collected to keep the account enabled. + /// + /// These fields may disable the account sooner if the next threshold is reached before they are collected. + pub current_deadline: Option, + /// Fields that need to be collected to keep the account enabled. + /// + /// If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. + pub currently_due: Option>, + /// If the account is disabled, this string describes why. + /// + /// [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). + /// Can be `action_required.requested_capabilities`, `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.incomplete_verification`, `rejected.listed`, `rejected.other`, `rejected.terms_of_service`, `under_review`, or `other`. + pub disabled_reason: Option, + /// Fields that are `currently_due` and need to be collected again because validation or verification failed. + pub errors: Option>, + /// Fields that need to be collected assuming all volume thresholds are reached. + /// + /// As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. + pub eventually_due: Option>, + /// Fields that weren't collected by `current_deadline`. + /// + /// These fields need to be collected to enable the account. + pub past_due: Option>, + /// Fields that may become required depending on the results of verification or review. + /// + /// Will be an empty array unless an asynchronous verification is pending. + /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + pub pending_verification: Option>, +} diff --git a/stripe_types/src/generated/account_requirements_alternative/mod.rs b/stripe_types/src/generated/account_requirements_alternative/mod.rs new file mode 100644 index 000000000..31d08a601 --- /dev/null +++ b/stripe_types/src/generated/account_requirements_alternative/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountRequirementsAlternative { + /// Fields that can be provided to satisfy all fields in `original_fields_due`. + pub alternative_fields_due: Vec, + /// Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. + pub original_fields_due: Vec, +} diff --git a/stripe_types/src/generated/account_requirements_error/mod.rs b/stripe_types/src/generated/account_requirements_error/mod.rs new file mode 100644 index 000000000..7ba4a48b8 --- /dev/null +++ b/stripe_types/src/generated/account_requirements_error/mod.rs @@ -0,0 +1,392 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountRequirementsError { + /// The code for the type of error. + pub code: AccountRequirementsErrorCode, + /// An informative message that indicates the error type and provides additional details about the error. + pub reason: String, + /// The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + pub requirement: String, +} +/// The code for the type of error. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum AccountRequirementsErrorCode { + InvalidAddressCityStatePostalCode, + InvalidAddressHighwayContractBox, + InvalidAddressPrivateMailbox, + InvalidBusinessProfileName, + InvalidBusinessProfileNameDenylisted, + InvalidCompanyNameDenylisted, + InvalidDobAgeOverMaximum, + InvalidDobAgeUnder18, + InvalidDobAgeUnderMinimum, + InvalidProductDescriptionLength, + InvalidProductDescriptionUrlMatch, + InvalidRepresentativeCountry, + InvalidStatementDescriptorBusinessMismatch, + InvalidStatementDescriptorDenylisted, + InvalidStatementDescriptorLength, + InvalidStatementDescriptorPrefixDenylisted, + InvalidStatementDescriptorPrefixMismatch, + InvalidStreetAddress, + InvalidTaxId, + InvalidTaxIdFormat, + InvalidTosAcceptance, + InvalidUrlDenylisted, + InvalidUrlFormat, + InvalidUrlLength, + InvalidUrlWebPresenceDetected, + InvalidUrlWebsiteBusinessInformationMismatch, + InvalidUrlWebsiteEmpty, + InvalidUrlWebsiteInaccessible, + InvalidUrlWebsiteInaccessibleGeoblocked, + InvalidUrlWebsiteInaccessiblePasswordProtected, + InvalidUrlWebsiteIncomplete, + InvalidUrlWebsiteIncompleteCancellationPolicy, + InvalidUrlWebsiteIncompleteCustomerServiceDetails, + InvalidUrlWebsiteIncompleteLegalRestrictions, + InvalidUrlWebsiteIncompleteRefundPolicy, + InvalidUrlWebsiteIncompleteReturnPolicy, + InvalidUrlWebsiteIncompleteTermsAndConditions, + InvalidUrlWebsiteIncompleteUnderConstruction, + InvalidUrlWebsiteOther, + InvalidValueOther, + VerificationDirectorsMismatch, + VerificationDocumentAddressMismatch, + VerificationDocumentAddressMissing, + VerificationDocumentCorrupt, + VerificationDocumentCountryNotSupported, + VerificationDocumentDirectorsMismatch, + VerificationDocumentDobMismatch, + VerificationDocumentDuplicateType, + VerificationDocumentExpired, + VerificationDocumentFailedCopy, + VerificationDocumentFailedGreyscale, + VerificationDocumentFailedOther, + VerificationDocumentFailedTestMode, + VerificationDocumentFraudulent, + VerificationDocumentIdNumberMismatch, + VerificationDocumentIdNumberMissing, + VerificationDocumentIncomplete, + VerificationDocumentInvalid, + VerificationDocumentIssueOrExpiryDateMissing, + VerificationDocumentManipulated, + VerificationDocumentMissingBack, + VerificationDocumentMissingFront, + VerificationDocumentNameMismatch, + VerificationDocumentNameMissing, + VerificationDocumentNationalityMismatch, + VerificationDocumentNotReadable, + VerificationDocumentNotSigned, + VerificationDocumentNotUploaded, + VerificationDocumentPhotoMismatch, + VerificationDocumentTooLarge, + VerificationDocumentTypeNotSupported, + VerificationExtraneousDirectors, + VerificationFailedAddressMatch, + VerificationFailedBusinessIecNumber, + VerificationFailedDocumentMatch, + VerificationFailedIdNumberMatch, + VerificationFailedKeyedIdentity, + VerificationFailedKeyedMatch, + VerificationFailedNameMatch, + VerificationFailedOther, + VerificationFailedResidentialAddress, + VerificationFailedTaxIdMatch, + VerificationFailedTaxIdNotIssued, + VerificationMissingDirectors, + VerificationMissingExecutives, + VerificationMissingOwners, + VerificationRequiresAdditionalMemorandumOfAssociations, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl AccountRequirementsErrorCode { + pub fn as_str(self) -> &'static str { + use AccountRequirementsErrorCode::*; + match self { + InvalidAddressCityStatePostalCode => "invalid_address_city_state_postal_code", + InvalidAddressHighwayContractBox => "invalid_address_highway_contract_box", + InvalidAddressPrivateMailbox => "invalid_address_private_mailbox", + InvalidBusinessProfileName => "invalid_business_profile_name", + InvalidBusinessProfileNameDenylisted => "invalid_business_profile_name_denylisted", + InvalidCompanyNameDenylisted => "invalid_company_name_denylisted", + InvalidDobAgeOverMaximum => "invalid_dob_age_over_maximum", + InvalidDobAgeUnder18 => "invalid_dob_age_under_18", + InvalidDobAgeUnderMinimum => "invalid_dob_age_under_minimum", + InvalidProductDescriptionLength => "invalid_product_description_length", + InvalidProductDescriptionUrlMatch => "invalid_product_description_url_match", + InvalidRepresentativeCountry => "invalid_representative_country", + InvalidStatementDescriptorBusinessMismatch => { + "invalid_statement_descriptor_business_mismatch" + } + InvalidStatementDescriptorDenylisted => "invalid_statement_descriptor_denylisted", + InvalidStatementDescriptorLength => "invalid_statement_descriptor_length", + InvalidStatementDescriptorPrefixDenylisted => { + "invalid_statement_descriptor_prefix_denylisted" + } + InvalidStatementDescriptorPrefixMismatch => { + "invalid_statement_descriptor_prefix_mismatch" + } + InvalidStreetAddress => "invalid_street_address", + InvalidTaxId => "invalid_tax_id", + InvalidTaxIdFormat => "invalid_tax_id_format", + InvalidTosAcceptance => "invalid_tos_acceptance", + InvalidUrlDenylisted => "invalid_url_denylisted", + InvalidUrlFormat => "invalid_url_format", + InvalidUrlLength => "invalid_url_length", + InvalidUrlWebPresenceDetected => "invalid_url_web_presence_detected", + InvalidUrlWebsiteBusinessInformationMismatch => { + "invalid_url_website_business_information_mismatch" + } + InvalidUrlWebsiteEmpty => "invalid_url_website_empty", + InvalidUrlWebsiteInaccessible => "invalid_url_website_inaccessible", + InvalidUrlWebsiteInaccessibleGeoblocked => { + "invalid_url_website_inaccessible_geoblocked" + } + InvalidUrlWebsiteInaccessiblePasswordProtected => { + "invalid_url_website_inaccessible_password_protected" + } + InvalidUrlWebsiteIncomplete => "invalid_url_website_incomplete", + InvalidUrlWebsiteIncompleteCancellationPolicy => { + "invalid_url_website_incomplete_cancellation_policy" + } + InvalidUrlWebsiteIncompleteCustomerServiceDetails => { + "invalid_url_website_incomplete_customer_service_details" + } + InvalidUrlWebsiteIncompleteLegalRestrictions => { + "invalid_url_website_incomplete_legal_restrictions" + } + InvalidUrlWebsiteIncompleteRefundPolicy => { + "invalid_url_website_incomplete_refund_policy" + } + InvalidUrlWebsiteIncompleteReturnPolicy => { + "invalid_url_website_incomplete_return_policy" + } + InvalidUrlWebsiteIncompleteTermsAndConditions => { + "invalid_url_website_incomplete_terms_and_conditions" + } + InvalidUrlWebsiteIncompleteUnderConstruction => { + "invalid_url_website_incomplete_under_construction" + } + InvalidUrlWebsiteOther => "invalid_url_website_other", + InvalidValueOther => "invalid_value_other", + VerificationDirectorsMismatch => "verification_directors_mismatch", + VerificationDocumentAddressMismatch => "verification_document_address_mismatch", + VerificationDocumentAddressMissing => "verification_document_address_missing", + VerificationDocumentCorrupt => "verification_document_corrupt", + VerificationDocumentCountryNotSupported => { + "verification_document_country_not_supported" + } + VerificationDocumentDirectorsMismatch => "verification_document_directors_mismatch", + VerificationDocumentDobMismatch => "verification_document_dob_mismatch", + VerificationDocumentDuplicateType => "verification_document_duplicate_type", + VerificationDocumentExpired => "verification_document_expired", + VerificationDocumentFailedCopy => "verification_document_failed_copy", + VerificationDocumentFailedGreyscale => "verification_document_failed_greyscale", + VerificationDocumentFailedOther => "verification_document_failed_other", + VerificationDocumentFailedTestMode => "verification_document_failed_test_mode", + VerificationDocumentFraudulent => "verification_document_fraudulent", + VerificationDocumentIdNumberMismatch => "verification_document_id_number_mismatch", + VerificationDocumentIdNumberMissing => "verification_document_id_number_missing", + VerificationDocumentIncomplete => "verification_document_incomplete", + VerificationDocumentInvalid => "verification_document_invalid", + VerificationDocumentIssueOrExpiryDateMissing => { + "verification_document_issue_or_expiry_date_missing" + } + VerificationDocumentManipulated => "verification_document_manipulated", + VerificationDocumentMissingBack => "verification_document_missing_back", + VerificationDocumentMissingFront => "verification_document_missing_front", + VerificationDocumentNameMismatch => "verification_document_name_mismatch", + VerificationDocumentNameMissing => "verification_document_name_missing", + VerificationDocumentNationalityMismatch => "verification_document_nationality_mismatch", + VerificationDocumentNotReadable => "verification_document_not_readable", + VerificationDocumentNotSigned => "verification_document_not_signed", + VerificationDocumentNotUploaded => "verification_document_not_uploaded", + VerificationDocumentPhotoMismatch => "verification_document_photo_mismatch", + VerificationDocumentTooLarge => "verification_document_too_large", + VerificationDocumentTypeNotSupported => "verification_document_type_not_supported", + VerificationExtraneousDirectors => "verification_extraneous_directors", + VerificationFailedAddressMatch => "verification_failed_address_match", + VerificationFailedBusinessIecNumber => "verification_failed_business_iec_number", + VerificationFailedDocumentMatch => "verification_failed_document_match", + VerificationFailedIdNumberMatch => "verification_failed_id_number_match", + VerificationFailedKeyedIdentity => "verification_failed_keyed_identity", + VerificationFailedKeyedMatch => "verification_failed_keyed_match", + VerificationFailedNameMatch => "verification_failed_name_match", + VerificationFailedOther => "verification_failed_other", + VerificationFailedResidentialAddress => "verification_failed_residential_address", + VerificationFailedTaxIdMatch => "verification_failed_tax_id_match", + VerificationFailedTaxIdNotIssued => "verification_failed_tax_id_not_issued", + VerificationMissingDirectors => "verification_missing_directors", + VerificationMissingExecutives => "verification_missing_executives", + VerificationMissingOwners => "verification_missing_owners", + VerificationRequiresAdditionalMemorandumOfAssociations => { + "verification_requires_additional_memorandum_of_associations" + } + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for AccountRequirementsErrorCode { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountRequirementsErrorCode::*; + match s { + "invalid_address_city_state_postal_code" => Ok(InvalidAddressCityStatePostalCode), + "invalid_address_highway_contract_box" => Ok(InvalidAddressHighwayContractBox), + "invalid_address_private_mailbox" => Ok(InvalidAddressPrivateMailbox), + "invalid_business_profile_name" => Ok(InvalidBusinessProfileName), + "invalid_business_profile_name_denylisted" => Ok(InvalidBusinessProfileNameDenylisted), + "invalid_company_name_denylisted" => Ok(InvalidCompanyNameDenylisted), + "invalid_dob_age_over_maximum" => Ok(InvalidDobAgeOverMaximum), + "invalid_dob_age_under_18" => Ok(InvalidDobAgeUnder18), + "invalid_dob_age_under_minimum" => Ok(InvalidDobAgeUnderMinimum), + "invalid_product_description_length" => Ok(InvalidProductDescriptionLength), + "invalid_product_description_url_match" => Ok(InvalidProductDescriptionUrlMatch), + "invalid_representative_country" => Ok(InvalidRepresentativeCountry), + "invalid_statement_descriptor_business_mismatch" => { + Ok(InvalidStatementDescriptorBusinessMismatch) + } + "invalid_statement_descriptor_denylisted" => Ok(InvalidStatementDescriptorDenylisted), + "invalid_statement_descriptor_length" => Ok(InvalidStatementDescriptorLength), + "invalid_statement_descriptor_prefix_denylisted" => { + Ok(InvalidStatementDescriptorPrefixDenylisted) + } + "invalid_statement_descriptor_prefix_mismatch" => { + Ok(InvalidStatementDescriptorPrefixMismatch) + } + "invalid_street_address" => Ok(InvalidStreetAddress), + "invalid_tax_id" => Ok(InvalidTaxId), + "invalid_tax_id_format" => Ok(InvalidTaxIdFormat), + "invalid_tos_acceptance" => Ok(InvalidTosAcceptance), + "invalid_url_denylisted" => Ok(InvalidUrlDenylisted), + "invalid_url_format" => Ok(InvalidUrlFormat), + "invalid_url_length" => Ok(InvalidUrlLength), + "invalid_url_web_presence_detected" => Ok(InvalidUrlWebPresenceDetected), + "invalid_url_website_business_information_mismatch" => { + Ok(InvalidUrlWebsiteBusinessInformationMismatch) + } + "invalid_url_website_empty" => Ok(InvalidUrlWebsiteEmpty), + "invalid_url_website_inaccessible" => Ok(InvalidUrlWebsiteInaccessible), + "invalid_url_website_inaccessible_geoblocked" => { + Ok(InvalidUrlWebsiteInaccessibleGeoblocked) + } + "invalid_url_website_inaccessible_password_protected" => { + Ok(InvalidUrlWebsiteInaccessiblePasswordProtected) + } + "invalid_url_website_incomplete" => Ok(InvalidUrlWebsiteIncomplete), + "invalid_url_website_incomplete_cancellation_policy" => { + Ok(InvalidUrlWebsiteIncompleteCancellationPolicy) + } + "invalid_url_website_incomplete_customer_service_details" => { + Ok(InvalidUrlWebsiteIncompleteCustomerServiceDetails) + } + "invalid_url_website_incomplete_legal_restrictions" => { + Ok(InvalidUrlWebsiteIncompleteLegalRestrictions) + } + "invalid_url_website_incomplete_refund_policy" => { + Ok(InvalidUrlWebsiteIncompleteRefundPolicy) + } + "invalid_url_website_incomplete_return_policy" => { + Ok(InvalidUrlWebsiteIncompleteReturnPolicy) + } + "invalid_url_website_incomplete_terms_and_conditions" => { + Ok(InvalidUrlWebsiteIncompleteTermsAndConditions) + } + "invalid_url_website_incomplete_under_construction" => { + Ok(InvalidUrlWebsiteIncompleteUnderConstruction) + } + "invalid_url_website_other" => Ok(InvalidUrlWebsiteOther), + "invalid_value_other" => Ok(InvalidValueOther), + "verification_directors_mismatch" => Ok(VerificationDirectorsMismatch), + "verification_document_address_mismatch" => Ok(VerificationDocumentAddressMismatch), + "verification_document_address_missing" => Ok(VerificationDocumentAddressMissing), + "verification_document_corrupt" => Ok(VerificationDocumentCorrupt), + "verification_document_country_not_supported" => { + Ok(VerificationDocumentCountryNotSupported) + } + "verification_document_directors_mismatch" => Ok(VerificationDocumentDirectorsMismatch), + "verification_document_dob_mismatch" => Ok(VerificationDocumentDobMismatch), + "verification_document_duplicate_type" => Ok(VerificationDocumentDuplicateType), + "verification_document_expired" => Ok(VerificationDocumentExpired), + "verification_document_failed_copy" => Ok(VerificationDocumentFailedCopy), + "verification_document_failed_greyscale" => Ok(VerificationDocumentFailedGreyscale), + "verification_document_failed_other" => Ok(VerificationDocumentFailedOther), + "verification_document_failed_test_mode" => Ok(VerificationDocumentFailedTestMode), + "verification_document_fraudulent" => Ok(VerificationDocumentFraudulent), + "verification_document_id_number_mismatch" => Ok(VerificationDocumentIdNumberMismatch), + "verification_document_id_number_missing" => Ok(VerificationDocumentIdNumberMissing), + "verification_document_incomplete" => Ok(VerificationDocumentIncomplete), + "verification_document_invalid" => Ok(VerificationDocumentInvalid), + "verification_document_issue_or_expiry_date_missing" => { + Ok(VerificationDocumentIssueOrExpiryDateMissing) + } + "verification_document_manipulated" => Ok(VerificationDocumentManipulated), + "verification_document_missing_back" => Ok(VerificationDocumentMissingBack), + "verification_document_missing_front" => Ok(VerificationDocumentMissingFront), + "verification_document_name_mismatch" => Ok(VerificationDocumentNameMismatch), + "verification_document_name_missing" => Ok(VerificationDocumentNameMissing), + "verification_document_nationality_mismatch" => { + Ok(VerificationDocumentNationalityMismatch) + } + "verification_document_not_readable" => Ok(VerificationDocumentNotReadable), + "verification_document_not_signed" => Ok(VerificationDocumentNotSigned), + "verification_document_not_uploaded" => Ok(VerificationDocumentNotUploaded), + "verification_document_photo_mismatch" => Ok(VerificationDocumentPhotoMismatch), + "verification_document_too_large" => Ok(VerificationDocumentTooLarge), + "verification_document_type_not_supported" => Ok(VerificationDocumentTypeNotSupported), + "verification_extraneous_directors" => Ok(VerificationExtraneousDirectors), + "verification_failed_address_match" => Ok(VerificationFailedAddressMatch), + "verification_failed_business_iec_number" => Ok(VerificationFailedBusinessIecNumber), + "verification_failed_document_match" => Ok(VerificationFailedDocumentMatch), + "verification_failed_id_number_match" => Ok(VerificationFailedIdNumberMatch), + "verification_failed_keyed_identity" => Ok(VerificationFailedKeyedIdentity), + "verification_failed_keyed_match" => Ok(VerificationFailedKeyedMatch), + "verification_failed_name_match" => Ok(VerificationFailedNameMatch), + "verification_failed_other" => Ok(VerificationFailedOther), + "verification_failed_residential_address" => Ok(VerificationFailedResidentialAddress), + "verification_failed_tax_id_match" => Ok(VerificationFailedTaxIdMatch), + "verification_failed_tax_id_not_issued" => Ok(VerificationFailedTaxIdNotIssued), + "verification_missing_directors" => Ok(VerificationMissingDirectors), + "verification_missing_executives" => Ok(VerificationMissingExecutives), + "verification_missing_owners" => Ok(VerificationMissingOwners), + "verification_requires_additional_memorandum_of_associations" => { + Ok(VerificationRequiresAdditionalMemorandumOfAssociations) + } + _ => Err(()), + } + } +} +impl AsRef for AccountRequirementsErrorCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountRequirementsErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountRequirementsErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountRequirementsErrorCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountRequirementsErrorCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(AccountRequirementsErrorCode::Unknown)) + } +} diff --git a/stripe_types/src/generated/account_sepa_debit_payments_settings/mod.rs b/stripe_types/src/generated/account_sepa_debit_payments_settings/mod.rs new file mode 100644 index 000000000..9da113cc0 --- /dev/null +++ b/stripe_types/src/generated/account_sepa_debit_payments_settings/mod.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountSepaDebitPaymentsSettings { + /// SEPA creditor identifier that identifies the company making the payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub creditor_id: Option, +} diff --git a/stripe_types/src/generated/account_settings/mod.rs b/stripe_types/src/generated/account_settings/mod.rs new file mode 100644 index 000000000..e7b0bce21 --- /dev/null +++ b/stripe_types/src/generated/account_settings/mod.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountSettings { + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit_payments: Option, + pub branding: stripe_types::AccountBrandingSettings, + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option, + pub card_payments: stripe_types::AccountCardPaymentsSettings, + pub dashboard: stripe_types::AccountDashboardSettings, + pub payments: stripe_types::AccountPaymentsSettings, + #[serde(skip_serializing_if = "Option::is_none")] + pub payouts: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit_payments: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option, +} diff --git a/stripe_types/src/generated/account_terms_of_service/mod.rs b/stripe_types/src/generated/account_terms_of_service/mod.rs new file mode 100644 index 000000000..a096416f5 --- /dev/null +++ b/stripe_types/src/generated/account_terms_of_service/mod.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountTermsOfService { + /// The Unix timestamp marking when the account representative accepted the service agreement. + pub date: Option, + /// The IP address from which the account representative accepted the service agreement. + pub ip: Option, + /// The user agent of the browser from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option, +} diff --git a/stripe_types/src/generated/account_tos_acceptance/mod.rs b/stripe_types/src/generated/account_tos_acceptance/mod.rs new file mode 100644 index 000000000..574f42294 --- /dev/null +++ b/stripe_types/src/generated/account_tos_acceptance/mod.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountTosAcceptance { + /// The Unix timestamp marking when the account representative accepted their service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the account representative accepted their service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option, + /// The user's service agreement type. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_agreement: Option, + /// The user agent of the browser from which the account representative accepted their service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option, +} diff --git a/stripe_types/src/generated/account_treasury_settings/mod.rs b/stripe_types/src/generated/account_treasury_settings/mod.rs new file mode 100644 index 000000000..0fd9e93f9 --- /dev/null +++ b/stripe_types/src/generated/account_treasury_settings/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountTreasurySettings { + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_acceptance: Option, +} diff --git a/stripe_types/src/generated/account_unification_account_controller/mod.rs b/stripe_types/src/generated/account_unification_account_controller/mod.rs new file mode 100644 index 000000000..3b6693fb6 --- /dev/null +++ b/stripe_types/src/generated/account_unification_account_controller/mod.rs @@ -0,0 +1,75 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountUnificationAccountController { + /// `true` if the Connect application retrieving the resource controls the account and can therefore exercise [platform controls](https://stripe.com/docs/connect/platform-controls-for-standard-accounts). + /// + /// Otherwise, this field is null. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_controller: Option, + /// The controller type. + /// + /// Can be `application`, if a Connect application controls the account, or `account`, if the account controls itself. + #[serde(rename = "type")] + pub type_: AccountUnificationAccountControllerType, +} +/// The controller type. +/// +/// Can be `application`, if a Connect application controls the account, or `account`, if the account controls itself. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountUnificationAccountControllerType { + Account, + Application, +} +impl AccountUnificationAccountControllerType { + pub fn as_str(self) -> &'static str { + use AccountUnificationAccountControllerType::*; + match self { + Account => "account", + Application => "application", + } + } +} + +impl std::str::FromStr for AccountUnificationAccountControllerType { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountUnificationAccountControllerType::*; + match s { + "account" => Ok(Account), + "application" => Ok(Application), + _ => Err(()), + } + } +} +impl AsRef for AccountUnificationAccountControllerType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AccountUnificationAccountControllerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountUnificationAccountControllerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountUnificationAccountControllerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountUnificationAccountControllerType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountUnificationAccountControllerType") + }) + } +} diff --git a/stripe_types/src/generated/address/mod.rs b/stripe_types/src/generated/address/mod.rs new file mode 100644 index 000000000..9aaf337bf --- /dev/null +++ b/stripe_types/src/generated/address/mod.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct Address { + /// City, district, suburb, town, or village. + pub city: Option, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: Option, + /// Address line 1 (e.g., street, PO Box, or company name). + pub line1: Option, + /// Address line 2 (e.g., apartment, suite, unit, or building). + pub line2: Option, + /// ZIP or postal code. + pub postal_code: Option, + /// State, county, province, or region. + pub state: Option, +} diff --git a/stripe_types/src/generated/api_errors/mod.rs b/stripe_types/src/generated/api_errors/mod.rs new file mode 100644 index 000000000..37801a9cf --- /dev/null +++ b/stripe_types/src/generated/api_errors/mod.rs @@ -0,0 +1,692 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ApiErrors { + /// For card errors, the ID of the failed charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub charge: Option, + /// For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option, + /// For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + #[serde(skip_serializing_if = "Option::is_none")] + pub decline_code: Option, + /// A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + #[serde(skip_serializing_if = "Option::is_none")] + pub doc_url: Option, + /// A human-readable message providing more details about the error. + /// + /// For card errors, these messages can be shown to your users. + #[serde(skip_serializing_if = "Option::is_none")] + pub message: Option, + /// If the error is parameter-specific, the parameter related to the error. + /// + /// For example, you can use this to display a message near the correct form field. + #[serde(skip_serializing_if = "Option::is_none")] + pub param: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option, + /// If the error is specific to the type of payment method, the payment method type that had a problem. + /// + /// This field is only populated for invoice-related errors. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_type: Option, + /// A URL to the request log entry in your dashboard. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_log_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_intent: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option, + /// The type of error returned. + /// + /// One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`. + #[serde(rename = "type")] + pub type_: ApiErrorsType, +} +/// For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ApiErrorsCode { + AccountClosed, + AccountCountryInvalidAddress, + AccountErrorCountryChangeRequiresAdditionalSteps, + AccountInformationMismatch, + AccountInvalid, + AccountNumberInvalid, + AcssDebitSessionIncomplete, + AlipayUpgradeRequired, + AmountTooLarge, + AmountTooSmall, + ApiKeyExpired, + ApplicationFeesNotAllowed, + AuthenticationRequired, + BalanceInsufficient, + BalanceInvalidParameter, + BankAccountBadRoutingNumbers, + BankAccountDeclined, + BankAccountExists, + BankAccountRestricted, + BankAccountUnusable, + BankAccountUnverified, + BankAccountVerificationFailed, + BillingInvalidMandate, + BitcoinUpgradeRequired, + CaptureChargeAuthorizationExpired, + CaptureUnauthorizedPayment, + CardDeclineRateLimitExceeded, + CardDeclined, + CardholderPhoneNumberRequired, + ChargeAlreadyCaptured, + ChargeAlreadyRefunded, + ChargeDisputed, + ChargeExceedsSourceLimit, + ChargeExpiredForCapture, + ChargeInvalidParameter, + ChargeNotRefundable, + ClearingCodeUnsupported, + CountryCodeInvalid, + CountryUnsupported, + CouponExpired, + CustomerMaxPaymentMethods, + CustomerMaxSubscriptions, + DebitNotAuthorized, + EmailInvalid, + ExpiredCard, + IdempotencyKeyInUse, + IncorrectAddress, + IncorrectCvc, + IncorrectNumber, + IncorrectZip, + InstantPayoutsConfigDisabled, + InstantPayoutsCurrencyDisabled, + InstantPayoutsLimitExceeded, + InstantPayoutsUnsupported, + InsufficientFunds, + IntentInvalidState, + IntentVerificationMethodMissing, + InvalidCardType, + InvalidCharacters, + InvalidChargeAmount, + InvalidCvc, + InvalidExpiryMonth, + InvalidExpiryYear, + InvalidNumber, + InvalidSourceUsage, + InvalidTaxLocation, + InvoiceNoCustomerLineItems, + InvoiceNoPaymentMethodTypes, + InvoiceNoSubscriptionLineItems, + InvoiceNotEditable, + InvoiceOnBehalfOfNotEditable, + InvoicePaymentIntentRequiresAction, + InvoiceUpcomingNone, + LivemodeMismatch, + LockTimeout, + Missing, + NoAccount, + NotAllowedOnStandardAccount, + OutOfInventory, + OwnershipDeclarationNotAllowed, + ParameterInvalidEmpty, + ParameterInvalidInteger, + ParameterInvalidStringBlank, + ParameterInvalidStringEmpty, + ParameterMissing, + ParameterUnknown, + ParametersExclusive, + PaymentIntentActionRequired, + PaymentIntentAuthenticationFailure, + PaymentIntentIncompatiblePaymentMethod, + PaymentIntentInvalidParameter, + PaymentIntentKonbiniRejectedConfirmationNumber, + PaymentIntentMandateInvalid, + PaymentIntentPaymentAttemptExpired, + PaymentIntentPaymentAttemptFailed, + PaymentIntentUnexpectedState, + PaymentMethodBankAccountAlreadyVerified, + PaymentMethodBankAccountBlocked, + PaymentMethodBillingDetailsAddressMissing, + PaymentMethodConfigurationFailures, + PaymentMethodCurrencyMismatch, + PaymentMethodCustomerDecline, + PaymentMethodInvalidParameter, + PaymentMethodInvalidParameterTestmode, + PaymentMethodMicrodepositFailed, + PaymentMethodMicrodepositVerificationAmountsInvalid, + PaymentMethodMicrodepositVerificationAmountsMismatch, + PaymentMethodMicrodepositVerificationAttemptsExceeded, + PaymentMethodMicrodepositVerificationDescriptorCodeMismatch, + PaymentMethodMicrodepositVerificationTimeout, + PaymentMethodNotAvailable, + PaymentMethodProviderDecline, + PaymentMethodProviderTimeout, + PaymentMethodUnactivated, + PaymentMethodUnexpectedState, + PaymentMethodUnsupportedType, + PayoutReconciliationNotReady, + PayoutsLimitExceeded, + PayoutsNotAllowed, + PlatformAccountRequired, + PlatformApiKeyExpired, + PostalCodeInvalid, + ProcessingError, + ProductInactive, + ProgressiveOnboardingLimitExceeded, + RateLimit, + ReferToCustomer, + RefundDisputedPayment, + ResourceAlreadyExists, + ResourceMissing, + ReturnIntentAlreadyProcessed, + RoutingNumberInvalid, + SecretKeyRequired, + SepaUnsupportedAccount, + SetupAttemptFailed, + SetupIntentAuthenticationFailure, + SetupIntentInvalidParameter, + SetupIntentMandateInvalid, + SetupIntentSetupAttemptExpired, + SetupIntentUnexpectedState, + ShippingCalculationFailed, + SkuInactive, + StateUnsupported, + StatusTransitionInvalid, + StripeTaxInactive, + TaxIdInvalid, + TaxesCalculationFailed, + TerminalLocationCountryUnsupported, + TerminalReaderBusy, + TerminalReaderHardwareFault, + TerminalReaderOffline, + TerminalReaderTimeout, + TestmodeChargesOnly, + TlsVersionUnsupported, + TokenAlreadyUsed, + TokenCardNetworkInvalid, + TokenInUse, + TransferSourceBalanceParametersMismatch, + TransfersNotAllowed, + UrlInvalid, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ApiErrorsCode { + pub fn as_str(self) -> &'static str { + use ApiErrorsCode::*; + match self { + AccountClosed => "account_closed", + AccountCountryInvalidAddress => "account_country_invalid_address", + AccountErrorCountryChangeRequiresAdditionalSteps => { + "account_error_country_change_requires_additional_steps" + } + AccountInformationMismatch => "account_information_mismatch", + AccountInvalid => "account_invalid", + AccountNumberInvalid => "account_number_invalid", + AcssDebitSessionIncomplete => "acss_debit_session_incomplete", + AlipayUpgradeRequired => "alipay_upgrade_required", + AmountTooLarge => "amount_too_large", + AmountTooSmall => "amount_too_small", + ApiKeyExpired => "api_key_expired", + ApplicationFeesNotAllowed => "application_fees_not_allowed", + AuthenticationRequired => "authentication_required", + BalanceInsufficient => "balance_insufficient", + BalanceInvalidParameter => "balance_invalid_parameter", + BankAccountBadRoutingNumbers => "bank_account_bad_routing_numbers", + BankAccountDeclined => "bank_account_declined", + BankAccountExists => "bank_account_exists", + BankAccountRestricted => "bank_account_restricted", + BankAccountUnusable => "bank_account_unusable", + BankAccountUnverified => "bank_account_unverified", + BankAccountVerificationFailed => "bank_account_verification_failed", + BillingInvalidMandate => "billing_invalid_mandate", + BitcoinUpgradeRequired => "bitcoin_upgrade_required", + CaptureChargeAuthorizationExpired => "capture_charge_authorization_expired", + CaptureUnauthorizedPayment => "capture_unauthorized_payment", + CardDeclineRateLimitExceeded => "card_decline_rate_limit_exceeded", + CardDeclined => "card_declined", + CardholderPhoneNumberRequired => "cardholder_phone_number_required", + ChargeAlreadyCaptured => "charge_already_captured", + ChargeAlreadyRefunded => "charge_already_refunded", + ChargeDisputed => "charge_disputed", + ChargeExceedsSourceLimit => "charge_exceeds_source_limit", + ChargeExpiredForCapture => "charge_expired_for_capture", + ChargeInvalidParameter => "charge_invalid_parameter", + ChargeNotRefundable => "charge_not_refundable", + ClearingCodeUnsupported => "clearing_code_unsupported", + CountryCodeInvalid => "country_code_invalid", + CountryUnsupported => "country_unsupported", + CouponExpired => "coupon_expired", + CustomerMaxPaymentMethods => "customer_max_payment_methods", + CustomerMaxSubscriptions => "customer_max_subscriptions", + DebitNotAuthorized => "debit_not_authorized", + EmailInvalid => "email_invalid", + ExpiredCard => "expired_card", + IdempotencyKeyInUse => "idempotency_key_in_use", + IncorrectAddress => "incorrect_address", + IncorrectCvc => "incorrect_cvc", + IncorrectNumber => "incorrect_number", + IncorrectZip => "incorrect_zip", + InstantPayoutsConfigDisabled => "instant_payouts_config_disabled", + InstantPayoutsCurrencyDisabled => "instant_payouts_currency_disabled", + InstantPayoutsLimitExceeded => "instant_payouts_limit_exceeded", + InstantPayoutsUnsupported => "instant_payouts_unsupported", + InsufficientFunds => "insufficient_funds", + IntentInvalidState => "intent_invalid_state", + IntentVerificationMethodMissing => "intent_verification_method_missing", + InvalidCardType => "invalid_card_type", + InvalidCharacters => "invalid_characters", + InvalidChargeAmount => "invalid_charge_amount", + InvalidCvc => "invalid_cvc", + InvalidExpiryMonth => "invalid_expiry_month", + InvalidExpiryYear => "invalid_expiry_year", + InvalidNumber => "invalid_number", + InvalidSourceUsage => "invalid_source_usage", + InvalidTaxLocation => "invalid_tax_location", + InvoiceNoCustomerLineItems => "invoice_no_customer_line_items", + InvoiceNoPaymentMethodTypes => "invoice_no_payment_method_types", + InvoiceNoSubscriptionLineItems => "invoice_no_subscription_line_items", + InvoiceNotEditable => "invoice_not_editable", + InvoiceOnBehalfOfNotEditable => "invoice_on_behalf_of_not_editable", + InvoicePaymentIntentRequiresAction => "invoice_payment_intent_requires_action", + InvoiceUpcomingNone => "invoice_upcoming_none", + LivemodeMismatch => "livemode_mismatch", + LockTimeout => "lock_timeout", + Missing => "missing", + NoAccount => "no_account", + NotAllowedOnStandardAccount => "not_allowed_on_standard_account", + OutOfInventory => "out_of_inventory", + OwnershipDeclarationNotAllowed => "ownership_declaration_not_allowed", + ParameterInvalidEmpty => "parameter_invalid_empty", + ParameterInvalidInteger => "parameter_invalid_integer", + ParameterInvalidStringBlank => "parameter_invalid_string_blank", + ParameterInvalidStringEmpty => "parameter_invalid_string_empty", + ParameterMissing => "parameter_missing", + ParameterUnknown => "parameter_unknown", + ParametersExclusive => "parameters_exclusive", + PaymentIntentActionRequired => "payment_intent_action_required", + PaymentIntentAuthenticationFailure => "payment_intent_authentication_failure", + PaymentIntentIncompatiblePaymentMethod => "payment_intent_incompatible_payment_method", + PaymentIntentInvalidParameter => "payment_intent_invalid_parameter", + PaymentIntentKonbiniRejectedConfirmationNumber => { + "payment_intent_konbini_rejected_confirmation_number" + } + PaymentIntentMandateInvalid => "payment_intent_mandate_invalid", + PaymentIntentPaymentAttemptExpired => "payment_intent_payment_attempt_expired", + PaymentIntentPaymentAttemptFailed => "payment_intent_payment_attempt_failed", + PaymentIntentUnexpectedState => "payment_intent_unexpected_state", + PaymentMethodBankAccountAlreadyVerified => { + "payment_method_bank_account_already_verified" + } + PaymentMethodBankAccountBlocked => "payment_method_bank_account_blocked", + PaymentMethodBillingDetailsAddressMissing => { + "payment_method_billing_details_address_missing" + } + PaymentMethodConfigurationFailures => "payment_method_configuration_failures", + PaymentMethodCurrencyMismatch => "payment_method_currency_mismatch", + PaymentMethodCustomerDecline => "payment_method_customer_decline", + PaymentMethodInvalidParameter => "payment_method_invalid_parameter", + PaymentMethodInvalidParameterTestmode => "payment_method_invalid_parameter_testmode", + PaymentMethodMicrodepositFailed => "payment_method_microdeposit_failed", + PaymentMethodMicrodepositVerificationAmountsInvalid => { + "payment_method_microdeposit_verification_amounts_invalid" + } + PaymentMethodMicrodepositVerificationAmountsMismatch => { + "payment_method_microdeposit_verification_amounts_mismatch" + } + PaymentMethodMicrodepositVerificationAttemptsExceeded => { + "payment_method_microdeposit_verification_attempts_exceeded" + } + PaymentMethodMicrodepositVerificationDescriptorCodeMismatch => { + "payment_method_microdeposit_verification_descriptor_code_mismatch" + } + PaymentMethodMicrodepositVerificationTimeout => { + "payment_method_microdeposit_verification_timeout" + } + PaymentMethodNotAvailable => "payment_method_not_available", + PaymentMethodProviderDecline => "payment_method_provider_decline", + PaymentMethodProviderTimeout => "payment_method_provider_timeout", + PaymentMethodUnactivated => "payment_method_unactivated", + PaymentMethodUnexpectedState => "payment_method_unexpected_state", + PaymentMethodUnsupportedType => "payment_method_unsupported_type", + PayoutReconciliationNotReady => "payout_reconciliation_not_ready", + PayoutsLimitExceeded => "payouts_limit_exceeded", + PayoutsNotAllowed => "payouts_not_allowed", + PlatformAccountRequired => "platform_account_required", + PlatformApiKeyExpired => "platform_api_key_expired", + PostalCodeInvalid => "postal_code_invalid", + ProcessingError => "processing_error", + ProductInactive => "product_inactive", + ProgressiveOnboardingLimitExceeded => "progressive_onboarding_limit_exceeded", + RateLimit => "rate_limit", + ReferToCustomer => "refer_to_customer", + RefundDisputedPayment => "refund_disputed_payment", + ResourceAlreadyExists => "resource_already_exists", + ResourceMissing => "resource_missing", + ReturnIntentAlreadyProcessed => "return_intent_already_processed", + RoutingNumberInvalid => "routing_number_invalid", + SecretKeyRequired => "secret_key_required", + SepaUnsupportedAccount => "sepa_unsupported_account", + SetupAttemptFailed => "setup_attempt_failed", + SetupIntentAuthenticationFailure => "setup_intent_authentication_failure", + SetupIntentInvalidParameter => "setup_intent_invalid_parameter", + SetupIntentMandateInvalid => "setup_intent_mandate_invalid", + SetupIntentSetupAttemptExpired => "setup_intent_setup_attempt_expired", + SetupIntentUnexpectedState => "setup_intent_unexpected_state", + ShippingCalculationFailed => "shipping_calculation_failed", + SkuInactive => "sku_inactive", + StateUnsupported => "state_unsupported", + StatusTransitionInvalid => "status_transition_invalid", + StripeTaxInactive => "stripe_tax_inactive", + TaxIdInvalid => "tax_id_invalid", + TaxesCalculationFailed => "taxes_calculation_failed", + TerminalLocationCountryUnsupported => "terminal_location_country_unsupported", + TerminalReaderBusy => "terminal_reader_busy", + TerminalReaderHardwareFault => "terminal_reader_hardware_fault", + TerminalReaderOffline => "terminal_reader_offline", + TerminalReaderTimeout => "terminal_reader_timeout", + TestmodeChargesOnly => "testmode_charges_only", + TlsVersionUnsupported => "tls_version_unsupported", + TokenAlreadyUsed => "token_already_used", + TokenCardNetworkInvalid => "token_card_network_invalid", + TokenInUse => "token_in_use", + TransferSourceBalanceParametersMismatch => { + "transfer_source_balance_parameters_mismatch" + } + TransfersNotAllowed => "transfers_not_allowed", + UrlInvalid => "url_invalid", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ApiErrorsCode { + type Err = (); + fn from_str(s: &str) -> Result { + use ApiErrorsCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_country_invalid_address" => Ok(AccountCountryInvalidAddress), + "account_error_country_change_requires_additional_steps" => { + Ok(AccountErrorCountryChangeRequiresAdditionalSteps) + } + "account_information_mismatch" => Ok(AccountInformationMismatch), + "account_invalid" => Ok(AccountInvalid), + "account_number_invalid" => Ok(AccountNumberInvalid), + "acss_debit_session_incomplete" => Ok(AcssDebitSessionIncomplete), + "alipay_upgrade_required" => Ok(AlipayUpgradeRequired), + "amount_too_large" => Ok(AmountTooLarge), + "amount_too_small" => Ok(AmountTooSmall), + "api_key_expired" => Ok(ApiKeyExpired), + "application_fees_not_allowed" => Ok(ApplicationFeesNotAllowed), + "authentication_required" => Ok(AuthenticationRequired), + "balance_insufficient" => Ok(BalanceInsufficient), + "balance_invalid_parameter" => Ok(BalanceInvalidParameter), + "bank_account_bad_routing_numbers" => Ok(BankAccountBadRoutingNumbers), + "bank_account_declined" => Ok(BankAccountDeclined), + "bank_account_exists" => Ok(BankAccountExists), + "bank_account_restricted" => Ok(BankAccountRestricted), + "bank_account_unusable" => Ok(BankAccountUnusable), + "bank_account_unverified" => Ok(BankAccountUnverified), + "bank_account_verification_failed" => Ok(BankAccountVerificationFailed), + "billing_invalid_mandate" => Ok(BillingInvalidMandate), + "bitcoin_upgrade_required" => Ok(BitcoinUpgradeRequired), + "capture_charge_authorization_expired" => Ok(CaptureChargeAuthorizationExpired), + "capture_unauthorized_payment" => Ok(CaptureUnauthorizedPayment), + "card_decline_rate_limit_exceeded" => Ok(CardDeclineRateLimitExceeded), + "card_declined" => Ok(CardDeclined), + "cardholder_phone_number_required" => Ok(CardholderPhoneNumberRequired), + "charge_already_captured" => Ok(ChargeAlreadyCaptured), + "charge_already_refunded" => Ok(ChargeAlreadyRefunded), + "charge_disputed" => Ok(ChargeDisputed), + "charge_exceeds_source_limit" => Ok(ChargeExceedsSourceLimit), + "charge_expired_for_capture" => Ok(ChargeExpiredForCapture), + "charge_invalid_parameter" => Ok(ChargeInvalidParameter), + "charge_not_refundable" => Ok(ChargeNotRefundable), + "clearing_code_unsupported" => Ok(ClearingCodeUnsupported), + "country_code_invalid" => Ok(CountryCodeInvalid), + "country_unsupported" => Ok(CountryUnsupported), + "coupon_expired" => Ok(CouponExpired), + "customer_max_payment_methods" => Ok(CustomerMaxPaymentMethods), + "customer_max_subscriptions" => Ok(CustomerMaxSubscriptions), + "debit_not_authorized" => Ok(DebitNotAuthorized), + "email_invalid" => Ok(EmailInvalid), + "expired_card" => Ok(ExpiredCard), + "idempotency_key_in_use" => Ok(IdempotencyKeyInUse), + "incorrect_address" => Ok(IncorrectAddress), + "incorrect_cvc" => Ok(IncorrectCvc), + "incorrect_number" => Ok(IncorrectNumber), + "incorrect_zip" => Ok(IncorrectZip), + "instant_payouts_config_disabled" => Ok(InstantPayoutsConfigDisabled), + "instant_payouts_currency_disabled" => Ok(InstantPayoutsCurrencyDisabled), + "instant_payouts_limit_exceeded" => Ok(InstantPayoutsLimitExceeded), + "instant_payouts_unsupported" => Ok(InstantPayoutsUnsupported), + "insufficient_funds" => Ok(InsufficientFunds), + "intent_invalid_state" => Ok(IntentInvalidState), + "intent_verification_method_missing" => Ok(IntentVerificationMethodMissing), + "invalid_card_type" => Ok(InvalidCardType), + "invalid_characters" => Ok(InvalidCharacters), + "invalid_charge_amount" => Ok(InvalidChargeAmount), + "invalid_cvc" => Ok(InvalidCvc), + "invalid_expiry_month" => Ok(InvalidExpiryMonth), + "invalid_expiry_year" => Ok(InvalidExpiryYear), + "invalid_number" => Ok(InvalidNumber), + "invalid_source_usage" => Ok(InvalidSourceUsage), + "invalid_tax_location" => Ok(InvalidTaxLocation), + "invoice_no_customer_line_items" => Ok(InvoiceNoCustomerLineItems), + "invoice_no_payment_method_types" => Ok(InvoiceNoPaymentMethodTypes), + "invoice_no_subscription_line_items" => Ok(InvoiceNoSubscriptionLineItems), + "invoice_not_editable" => Ok(InvoiceNotEditable), + "invoice_on_behalf_of_not_editable" => Ok(InvoiceOnBehalfOfNotEditable), + "invoice_payment_intent_requires_action" => Ok(InvoicePaymentIntentRequiresAction), + "invoice_upcoming_none" => Ok(InvoiceUpcomingNone), + "livemode_mismatch" => Ok(LivemodeMismatch), + "lock_timeout" => Ok(LockTimeout), + "missing" => Ok(Missing), + "no_account" => Ok(NoAccount), + "not_allowed_on_standard_account" => Ok(NotAllowedOnStandardAccount), + "out_of_inventory" => Ok(OutOfInventory), + "ownership_declaration_not_allowed" => Ok(OwnershipDeclarationNotAllowed), + "parameter_invalid_empty" => Ok(ParameterInvalidEmpty), + "parameter_invalid_integer" => Ok(ParameterInvalidInteger), + "parameter_invalid_string_blank" => Ok(ParameterInvalidStringBlank), + "parameter_invalid_string_empty" => Ok(ParameterInvalidStringEmpty), + "parameter_missing" => Ok(ParameterMissing), + "parameter_unknown" => Ok(ParameterUnknown), + "parameters_exclusive" => Ok(ParametersExclusive), + "payment_intent_action_required" => Ok(PaymentIntentActionRequired), + "payment_intent_authentication_failure" => Ok(PaymentIntentAuthenticationFailure), + "payment_intent_incompatible_payment_method" => { + Ok(PaymentIntentIncompatiblePaymentMethod) + } + "payment_intent_invalid_parameter" => Ok(PaymentIntentInvalidParameter), + "payment_intent_konbini_rejected_confirmation_number" => { + Ok(PaymentIntentKonbiniRejectedConfirmationNumber) + } + "payment_intent_mandate_invalid" => Ok(PaymentIntentMandateInvalid), + "payment_intent_payment_attempt_expired" => Ok(PaymentIntentPaymentAttemptExpired), + "payment_intent_payment_attempt_failed" => Ok(PaymentIntentPaymentAttemptFailed), + "payment_intent_unexpected_state" => Ok(PaymentIntentUnexpectedState), + "payment_method_bank_account_already_verified" => { + Ok(PaymentMethodBankAccountAlreadyVerified) + } + "payment_method_bank_account_blocked" => Ok(PaymentMethodBankAccountBlocked), + "payment_method_billing_details_address_missing" => { + Ok(PaymentMethodBillingDetailsAddressMissing) + } + "payment_method_configuration_failures" => Ok(PaymentMethodConfigurationFailures), + "payment_method_currency_mismatch" => Ok(PaymentMethodCurrencyMismatch), + "payment_method_customer_decline" => Ok(PaymentMethodCustomerDecline), + "payment_method_invalid_parameter" => Ok(PaymentMethodInvalidParameter), + "payment_method_invalid_parameter_testmode" => { + Ok(PaymentMethodInvalidParameterTestmode) + } + "payment_method_microdeposit_failed" => Ok(PaymentMethodMicrodepositFailed), + "payment_method_microdeposit_verification_amounts_invalid" => { + Ok(PaymentMethodMicrodepositVerificationAmountsInvalid) + } + "payment_method_microdeposit_verification_amounts_mismatch" => { + Ok(PaymentMethodMicrodepositVerificationAmountsMismatch) + } + "payment_method_microdeposit_verification_attempts_exceeded" => { + Ok(PaymentMethodMicrodepositVerificationAttemptsExceeded) + } + "payment_method_microdeposit_verification_descriptor_code_mismatch" => { + Ok(PaymentMethodMicrodepositVerificationDescriptorCodeMismatch) + } + "payment_method_microdeposit_verification_timeout" => { + Ok(PaymentMethodMicrodepositVerificationTimeout) + } + "payment_method_not_available" => Ok(PaymentMethodNotAvailable), + "payment_method_provider_decline" => Ok(PaymentMethodProviderDecline), + "payment_method_provider_timeout" => Ok(PaymentMethodProviderTimeout), + "payment_method_unactivated" => Ok(PaymentMethodUnactivated), + "payment_method_unexpected_state" => Ok(PaymentMethodUnexpectedState), + "payment_method_unsupported_type" => Ok(PaymentMethodUnsupportedType), + "payout_reconciliation_not_ready" => Ok(PayoutReconciliationNotReady), + "payouts_limit_exceeded" => Ok(PayoutsLimitExceeded), + "payouts_not_allowed" => Ok(PayoutsNotAllowed), + "platform_account_required" => Ok(PlatformAccountRequired), + "platform_api_key_expired" => Ok(PlatformApiKeyExpired), + "postal_code_invalid" => Ok(PostalCodeInvalid), + "processing_error" => Ok(ProcessingError), + "product_inactive" => Ok(ProductInactive), + "progressive_onboarding_limit_exceeded" => Ok(ProgressiveOnboardingLimitExceeded), + "rate_limit" => Ok(RateLimit), + "refer_to_customer" => Ok(ReferToCustomer), + "refund_disputed_payment" => Ok(RefundDisputedPayment), + "resource_already_exists" => Ok(ResourceAlreadyExists), + "resource_missing" => Ok(ResourceMissing), + "return_intent_already_processed" => Ok(ReturnIntentAlreadyProcessed), + "routing_number_invalid" => Ok(RoutingNumberInvalid), + "secret_key_required" => Ok(SecretKeyRequired), + "sepa_unsupported_account" => Ok(SepaUnsupportedAccount), + "setup_attempt_failed" => Ok(SetupAttemptFailed), + "setup_intent_authentication_failure" => Ok(SetupIntentAuthenticationFailure), + "setup_intent_invalid_parameter" => Ok(SetupIntentInvalidParameter), + "setup_intent_mandate_invalid" => Ok(SetupIntentMandateInvalid), + "setup_intent_setup_attempt_expired" => Ok(SetupIntentSetupAttemptExpired), + "setup_intent_unexpected_state" => Ok(SetupIntentUnexpectedState), + "shipping_calculation_failed" => Ok(ShippingCalculationFailed), + "sku_inactive" => Ok(SkuInactive), + "state_unsupported" => Ok(StateUnsupported), + "status_transition_invalid" => Ok(StatusTransitionInvalid), + "stripe_tax_inactive" => Ok(StripeTaxInactive), + "tax_id_invalid" => Ok(TaxIdInvalid), + "taxes_calculation_failed" => Ok(TaxesCalculationFailed), + "terminal_location_country_unsupported" => Ok(TerminalLocationCountryUnsupported), + "terminal_reader_busy" => Ok(TerminalReaderBusy), + "terminal_reader_hardware_fault" => Ok(TerminalReaderHardwareFault), + "terminal_reader_offline" => Ok(TerminalReaderOffline), + "terminal_reader_timeout" => Ok(TerminalReaderTimeout), + "testmode_charges_only" => Ok(TestmodeChargesOnly), + "tls_version_unsupported" => Ok(TlsVersionUnsupported), + "token_already_used" => Ok(TokenAlreadyUsed), + "token_card_network_invalid" => Ok(TokenCardNetworkInvalid), + "token_in_use" => Ok(TokenInUse), + "transfer_source_balance_parameters_mismatch" => { + Ok(TransferSourceBalanceParametersMismatch) + } + "transfers_not_allowed" => Ok(TransfersNotAllowed), + "url_invalid" => Ok(UrlInvalid), + _ => Err(()), + } + } +} +impl AsRef for ApiErrorsCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ApiErrorsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ApiErrorsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ApiErrorsCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ApiErrorsCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(ApiErrorsCode::Unknown)) + } +} +/// The type of error returned. +/// +/// One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ApiErrorsType { + ApiError, + CardError, + IdempotencyError, + InvalidRequestError, +} +impl ApiErrorsType { + pub fn as_str(self) -> &'static str { + use ApiErrorsType::*; + match self { + ApiError => "api_error", + CardError => "card_error", + IdempotencyError => "idempotency_error", + InvalidRequestError => "invalid_request_error", + } + } +} + +impl std::str::FromStr for ApiErrorsType { + type Err = (); + fn from_str(s: &str) -> Result { + use ApiErrorsType::*; + match s { + "api_error" => Ok(ApiError), + "card_error" => Ok(CardError), + "idempotency_error" => Ok(IdempotencyError), + "invalid_request_error" => Ok(InvalidRequestError), + _ => Err(()), + } + } +} +impl AsRef for ApiErrorsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ApiErrorsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ApiErrorsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ApiErrorsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ApiErrorsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ApiErrorsType")) + } +} diff --git a/stripe_types/src/generated/api_version.rs b/stripe_types/src/generated/api_version.rs new file mode 100644 index 000000000..11587cd22 --- /dev/null +++ b/stripe_types/src/generated/api_version.rs @@ -0,0 +1,355 @@ +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ApiVersion { + V2011_01_01, + V2011_06_21, + V2011_06_28, + V2011_08_01, + V2011_09_15, + V2011_11_17, + V2012_02_23, + V2012_03_25, + V2012_06_18, + V2012_06_28, + V2012_07_09, + V2012_09_24, + V2012_10_26, + V2012_11_07, + V2013_02_11, + V2013_02_13, + V2013_07_05, + V2013_08_12, + V2013_08_13, + V2013_10_29, + V2013_12_03, + V2014_01_31, + V2014_03_13, + V2014_03_28, + V2014_05_19, + V2014_06_13, + V2014_06_17, + V2014_07_22, + V2014_07_26, + V2014_08_04, + V2014_08_20, + V2014_09_08, + V2014_10_07, + V2014_11_05, + V2014_11_20, + V2014_12_08, + V2014_12_17, + V2014_12_22, + V2015_01_11, + V2015_01_26, + V2015_02_10, + V2015_02_16, + V2015_02_18, + V2015_03_24, + V2015_04_07, + V2015_06_15, + V2015_07_07, + V2015_07_13, + V2015_07_28, + V2015_08_07, + V2015_08_19, + V2015_09_03, + V2015_09_08, + V2015_09_23, + V2015_10_01, + V2015_10_12, + V2015_10_16, + V2016_02_03, + V2016_02_19, + V2016_02_22, + V2016_02_23, + V2016_02_29, + V2016_03_07, + V2016_06_15, + V2016_07_06, + V2016_10_19, + V2017_01_27, + V2017_02_14, + V2017_04_06, + V2017_05_25, + V2017_06_05, + V2017_08_15, + V2017_12_14, + V2018_01_23, + V2018_02_05, + V2018_02_06, + V2018_02_28, + V2018_05_21, + V2018_07_27, + V2018_08_23, + V2018_09_06, + V2018_09_24, + V2018_10_31, + V2018_11_08, + V2019_02_11, + V2019_02_19, + V2019_03_14, + V2019_05_16, + V2019_08_14, + V2019_09_09, + V2019_10_08, + V2019_10_17, + V2019_11_05, + V2019_12_03, + V2020_03_02, + V2020_08_27, + V2022_08_01, + V2022_11_15, + V2023_08_16, + V2023_10_16, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ApiVersion { + pub fn as_str(self) -> &'static str { + use ApiVersion::*; + match self { + V2011_01_01 => "2011-01-01", + V2011_06_21 => "2011-06-21", + V2011_06_28 => "2011-06-28", + V2011_08_01 => "2011-08-01", + V2011_09_15 => "2011-09-15", + V2011_11_17 => "2011-11-17", + V2012_02_23 => "2012-02-23", + V2012_03_25 => "2012-03-25", + V2012_06_18 => "2012-06-18", + V2012_06_28 => "2012-06-28", + V2012_07_09 => "2012-07-09", + V2012_09_24 => "2012-09-24", + V2012_10_26 => "2012-10-26", + V2012_11_07 => "2012-11-07", + V2013_02_11 => "2013-02-11", + V2013_02_13 => "2013-02-13", + V2013_07_05 => "2013-07-05", + V2013_08_12 => "2013-08-12", + V2013_08_13 => "2013-08-13", + V2013_10_29 => "2013-10-29", + V2013_12_03 => "2013-12-03", + V2014_01_31 => "2014-01-31", + V2014_03_13 => "2014-03-13", + V2014_03_28 => "2014-03-28", + V2014_05_19 => "2014-05-19", + V2014_06_13 => "2014-06-13", + V2014_06_17 => "2014-06-17", + V2014_07_22 => "2014-07-22", + V2014_07_26 => "2014-07-26", + V2014_08_04 => "2014-08-04", + V2014_08_20 => "2014-08-20", + V2014_09_08 => "2014-09-08", + V2014_10_07 => "2014-10-07", + V2014_11_05 => "2014-11-05", + V2014_11_20 => "2014-11-20", + V2014_12_08 => "2014-12-08", + V2014_12_17 => "2014-12-17", + V2014_12_22 => "2014-12-22", + V2015_01_11 => "2015-01-11", + V2015_01_26 => "2015-01-26", + V2015_02_10 => "2015-02-10", + V2015_02_16 => "2015-02-16", + V2015_02_18 => "2015-02-18", + V2015_03_24 => "2015-03-24", + V2015_04_07 => "2015-04-07", + V2015_06_15 => "2015-06-15", + V2015_07_07 => "2015-07-07", + V2015_07_13 => "2015-07-13", + V2015_07_28 => "2015-07-28", + V2015_08_07 => "2015-08-07", + V2015_08_19 => "2015-08-19", + V2015_09_03 => "2015-09-03", + V2015_09_08 => "2015-09-08", + V2015_09_23 => "2015-09-23", + V2015_10_01 => "2015-10-01", + V2015_10_12 => "2015-10-12", + V2015_10_16 => "2015-10-16", + V2016_02_03 => "2016-02-03", + V2016_02_19 => "2016-02-19", + V2016_02_22 => "2016-02-22", + V2016_02_23 => "2016-02-23", + V2016_02_29 => "2016-02-29", + V2016_03_07 => "2016-03-07", + V2016_06_15 => "2016-06-15", + V2016_07_06 => "2016-07-06", + V2016_10_19 => "2016-10-19", + V2017_01_27 => "2017-01-27", + V2017_02_14 => "2017-02-14", + V2017_04_06 => "2017-04-06", + V2017_05_25 => "2017-05-25", + V2017_06_05 => "2017-06-05", + V2017_08_15 => "2017-08-15", + V2017_12_14 => "2017-12-14", + V2018_01_23 => "2018-01-23", + V2018_02_05 => "2018-02-05", + V2018_02_06 => "2018-02-06", + V2018_02_28 => "2018-02-28", + V2018_05_21 => "2018-05-21", + V2018_07_27 => "2018-07-27", + V2018_08_23 => "2018-08-23", + V2018_09_06 => "2018-09-06", + V2018_09_24 => "2018-09-24", + V2018_10_31 => "2018-10-31", + V2018_11_08 => "2018-11-08", + V2019_02_11 => "2019-02-11", + V2019_02_19 => "2019-02-19", + V2019_03_14 => "2019-03-14", + V2019_05_16 => "2019-05-16", + V2019_08_14 => "2019-08-14", + V2019_09_09 => "2019-09-09", + V2019_10_08 => "2019-10-08", + V2019_10_17 => "2019-10-17", + V2019_11_05 => "2019-11-05", + V2019_12_03 => "2019-12-03", + V2020_03_02 => "2020-03-02", + V2020_08_27 => "2020-08-27", + V2022_08_01 => "2022-08-01", + V2022_11_15 => "2022-11-15", + V2023_08_16 => "2023-08-16", + V2023_10_16 => "2023-10-16", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ApiVersion { + type Err = (); + fn from_str(s: &str) -> Result { + use ApiVersion::*; + match s { + "2011-01-01" => Ok(V2011_01_01), + "2011-06-21" => Ok(V2011_06_21), + "2011-06-28" => Ok(V2011_06_28), + "2011-08-01" => Ok(V2011_08_01), + "2011-09-15" => Ok(V2011_09_15), + "2011-11-17" => Ok(V2011_11_17), + "2012-02-23" => Ok(V2012_02_23), + "2012-03-25" => Ok(V2012_03_25), + "2012-06-18" => Ok(V2012_06_18), + "2012-06-28" => Ok(V2012_06_28), + "2012-07-09" => Ok(V2012_07_09), + "2012-09-24" => Ok(V2012_09_24), + "2012-10-26" => Ok(V2012_10_26), + "2012-11-07" => Ok(V2012_11_07), + "2013-02-11" => Ok(V2013_02_11), + "2013-02-13" => Ok(V2013_02_13), + "2013-07-05" => Ok(V2013_07_05), + "2013-08-12" => Ok(V2013_08_12), + "2013-08-13" => Ok(V2013_08_13), + "2013-10-29" => Ok(V2013_10_29), + "2013-12-03" => Ok(V2013_12_03), + "2014-01-31" => Ok(V2014_01_31), + "2014-03-13" => Ok(V2014_03_13), + "2014-03-28" => Ok(V2014_03_28), + "2014-05-19" => Ok(V2014_05_19), + "2014-06-13" => Ok(V2014_06_13), + "2014-06-17" => Ok(V2014_06_17), + "2014-07-22" => Ok(V2014_07_22), + "2014-07-26" => Ok(V2014_07_26), + "2014-08-04" => Ok(V2014_08_04), + "2014-08-20" => Ok(V2014_08_20), + "2014-09-08" => Ok(V2014_09_08), + "2014-10-07" => Ok(V2014_10_07), + "2014-11-05" => Ok(V2014_11_05), + "2014-11-20" => Ok(V2014_11_20), + "2014-12-08" => Ok(V2014_12_08), + "2014-12-17" => Ok(V2014_12_17), + "2014-12-22" => Ok(V2014_12_22), + "2015-01-11" => Ok(V2015_01_11), + "2015-01-26" => Ok(V2015_01_26), + "2015-02-10" => Ok(V2015_02_10), + "2015-02-16" => Ok(V2015_02_16), + "2015-02-18" => Ok(V2015_02_18), + "2015-03-24" => Ok(V2015_03_24), + "2015-04-07" => Ok(V2015_04_07), + "2015-06-15" => Ok(V2015_06_15), + "2015-07-07" => Ok(V2015_07_07), + "2015-07-13" => Ok(V2015_07_13), + "2015-07-28" => Ok(V2015_07_28), + "2015-08-07" => Ok(V2015_08_07), + "2015-08-19" => Ok(V2015_08_19), + "2015-09-03" => Ok(V2015_09_03), + "2015-09-08" => Ok(V2015_09_08), + "2015-09-23" => Ok(V2015_09_23), + "2015-10-01" => Ok(V2015_10_01), + "2015-10-12" => Ok(V2015_10_12), + "2015-10-16" => Ok(V2015_10_16), + "2016-02-03" => Ok(V2016_02_03), + "2016-02-19" => Ok(V2016_02_19), + "2016-02-22" => Ok(V2016_02_22), + "2016-02-23" => Ok(V2016_02_23), + "2016-02-29" => Ok(V2016_02_29), + "2016-03-07" => Ok(V2016_03_07), + "2016-06-15" => Ok(V2016_06_15), + "2016-07-06" => Ok(V2016_07_06), + "2016-10-19" => Ok(V2016_10_19), + "2017-01-27" => Ok(V2017_01_27), + "2017-02-14" => Ok(V2017_02_14), + "2017-04-06" => Ok(V2017_04_06), + "2017-05-25" => Ok(V2017_05_25), + "2017-06-05" => Ok(V2017_06_05), + "2017-08-15" => Ok(V2017_08_15), + "2017-12-14" => Ok(V2017_12_14), + "2018-01-23" => Ok(V2018_01_23), + "2018-02-05" => Ok(V2018_02_05), + "2018-02-06" => Ok(V2018_02_06), + "2018-02-28" => Ok(V2018_02_28), + "2018-05-21" => Ok(V2018_05_21), + "2018-07-27" => Ok(V2018_07_27), + "2018-08-23" => Ok(V2018_08_23), + "2018-09-06" => Ok(V2018_09_06), + "2018-09-24" => Ok(V2018_09_24), + "2018-10-31" => Ok(V2018_10_31), + "2018-11-08" => Ok(V2018_11_08), + "2019-02-11" => Ok(V2019_02_11), + "2019-02-19" => Ok(V2019_02_19), + "2019-03-14" => Ok(V2019_03_14), + "2019-05-16" => Ok(V2019_05_16), + "2019-08-14" => Ok(V2019_08_14), + "2019-09-09" => Ok(V2019_09_09), + "2019-10-08" => Ok(V2019_10_08), + "2019-10-17" => Ok(V2019_10_17), + "2019-11-05" => Ok(V2019_11_05), + "2019-12-03" => Ok(V2019_12_03), + "2020-03-02" => Ok(V2020_03_02), + "2020-08-27" => Ok(V2020_08_27), + "2022-08-01" => Ok(V2022_08_01), + "2022-11-15" => Ok(V2022_11_15), + "2023-08-16" => Ok(V2023_08_16), + "2023-10-16" => Ok(V2023_10_16), + _ => Err(()), + } + } +} +impl AsRef for ApiVersion { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ApiVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ApiVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ApiVersion { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ApiVersion { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(ApiVersion::Unknown)) + } +} diff --git a/stripe_types/src/generated/application/mod.rs b/stripe_types/src/generated/application/mod.rs new file mode 100644 index 000000000..ee060f21f --- /dev/null +++ b/stripe_types/src/generated/application/mod.rs @@ -0,0 +1,14 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Application { + /// Unique identifier for the object. + pub id: stripe_types::application::ApplicationId, + /// The name of the application. + pub name: Option, +} +impl stripe_types::Object for Application { + type Id = stripe_types::application::ApplicationId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(ApplicationId, "ca_"); diff --git a/stripe_types/src/generated/automatic_tax/mod.rs b/stripe_types/src/generated/automatic_tax/mod.rs new file mode 100644 index 000000000..191322846 --- /dev/null +++ b/stripe_types/src/generated/automatic_tax/mod.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AutomaticTax { + /// Whether Stripe automatically computes tax on this invoice. + /// + /// Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + pub enabled: bool, + /// The status of the most recent automated tax calculation for this invoice. + pub status: Option, +} +/// The status of the most recent automated tax calculation for this invoice. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AutomaticTaxStatus { + Complete, + Failed, + RequiresLocationInputs, +} +impl AutomaticTaxStatus { + pub fn as_str(self) -> &'static str { + use AutomaticTaxStatus::*; + match self { + Complete => "complete", + Failed => "failed", + RequiresLocationInputs => "requires_location_inputs", + } + } +} + +impl std::str::FromStr for AutomaticTaxStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use AutomaticTaxStatus::*; + match s { + "complete" => Ok(Complete), + "failed" => Ok(Failed), + "requires_location_inputs" => Ok(RequiresLocationInputs), + _ => Err(()), + } + } +} +impl AsRef for AutomaticTaxStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for AutomaticTaxStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AutomaticTaxStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AutomaticTaxStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AutomaticTaxStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for AutomaticTaxStatus")) + } +} diff --git a/stripe_types/src/generated/balance_transaction/mod.rs b/stripe_types/src/generated/balance_transaction/mod.rs new file mode 100644 index 000000000..dcebe69a2 --- /dev/null +++ b/stripe_types/src/generated/balance_transaction/mod.rs @@ -0,0 +1,244 @@ +/// Balance transactions represent funds moving through your Stripe account. +/// Stripe creates them for every type of transaction that enters or leaves your Stripe account balance. +/// +/// Related guide: [Balance transaction types](https://stripe.com/docs/reports/balance-transaction-types) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BalanceTransaction { + /// Gross amount of this transaction (in cents (or local equivalent)). + /// + /// A positive value represents funds charged to another party, and a negative value represents funds sent to another party. + pub amount: i64, + /// The date that the transaction's net funds become available in the Stripe balance. + pub available_on: stripe_types::Timestamp, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// If applicable, this transaction uses an exchange rate. + /// + /// If money converts from currency A to currency B, then the `amount` in currency A, multipled by the `exchange_rate`, equals the `amount` in currency B. + /// For example, if you charge a customer 10.00 EUR, the PaymentIntent's `amount` is `1000` and `currency` is `eur`. + /// If this converts to 12.34 USD in your Stripe account, the BalanceTransaction's `amount` is `1234`, its `currency` is `usd`, and the `exchange_rate` is `1.234`. + pub exchange_rate: Option, + /// Fees (in cents (or local equivalent)) paid for this transaction. + /// + /// Represented as a positive integer when assessed. + pub fee: i64, + /// Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction. + pub fee_details: Vec, + /// Unique identifier for the object. + pub id: stripe_types::balance_transaction::BalanceTransactionId, + /// Net impact to a Stripe balance (in cents (or local equivalent)). + /// + /// A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. + /// You can calculate the net impact of a transaction on a balance by `amount` - `fee`. + pub net: i64, + /// Learn more about how [reporting categories](https://stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective. + pub reporting_category: String, + /// This transaction relates to the Stripe object. + pub source: Option>, + /// The transaction's net funds status in the Stripe balance, which are either `available` or `pending`. + pub status: String, + /// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. + /// + /// Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). + /// To classify transactions for accounting purposes, consider `reporting_category` instead. + #[serde(rename = "type")] + pub type_: BalanceTransactionType, +} +/// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. +/// +/// Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). +/// To classify transactions for accounting purposes, consider `reporting_category` instead. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum BalanceTransactionType { + Adjustment, + Advance, + AdvanceFunding, + AnticipationRepayment, + ApplicationFee, + ApplicationFeeRefund, + Charge, + ConnectCollectionTransfer, + Contribution, + IssuingAuthorizationHold, + IssuingAuthorizationRelease, + IssuingDispute, + IssuingTransaction, + ObligationInbound, + ObligationOutbound, + ObligationPayout, + ObligationPayoutFailure, + ObligationReversalInbound, + ObligationReversalOutbound, + Payment, + PaymentFailureRefund, + PaymentRefund, + PaymentReversal, + PaymentUnreconciled, + Payout, + PayoutCancel, + PayoutFailure, + Refund, + RefundFailure, + ReserveTransaction, + ReservedFunds, + StripeFee, + StripeFxFee, + TaxFee, + Topup, + TopupReversal, + Transfer, + TransferCancel, + TransferFailure, + TransferRefund, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl BalanceTransactionType { + pub fn as_str(self) -> &'static str { + use BalanceTransactionType::*; + match self { + Adjustment => "adjustment", + Advance => "advance", + AdvanceFunding => "advance_funding", + AnticipationRepayment => "anticipation_repayment", + ApplicationFee => "application_fee", + ApplicationFeeRefund => "application_fee_refund", + Charge => "charge", + ConnectCollectionTransfer => "connect_collection_transfer", + Contribution => "contribution", + IssuingAuthorizationHold => "issuing_authorization_hold", + IssuingAuthorizationRelease => "issuing_authorization_release", + IssuingDispute => "issuing_dispute", + IssuingTransaction => "issuing_transaction", + ObligationInbound => "obligation_inbound", + ObligationOutbound => "obligation_outbound", + ObligationPayout => "obligation_payout", + ObligationPayoutFailure => "obligation_payout_failure", + ObligationReversalInbound => "obligation_reversal_inbound", + ObligationReversalOutbound => "obligation_reversal_outbound", + Payment => "payment", + PaymentFailureRefund => "payment_failure_refund", + PaymentRefund => "payment_refund", + PaymentReversal => "payment_reversal", + PaymentUnreconciled => "payment_unreconciled", + Payout => "payout", + PayoutCancel => "payout_cancel", + PayoutFailure => "payout_failure", + Refund => "refund", + RefundFailure => "refund_failure", + ReserveTransaction => "reserve_transaction", + ReservedFunds => "reserved_funds", + StripeFee => "stripe_fee", + StripeFxFee => "stripe_fx_fee", + TaxFee => "tax_fee", + Topup => "topup", + TopupReversal => "topup_reversal", + Transfer => "transfer", + TransferCancel => "transfer_cancel", + TransferFailure => "transfer_failure", + TransferRefund => "transfer_refund", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for BalanceTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use BalanceTransactionType::*; + match s { + "adjustment" => Ok(Adjustment), + "advance" => Ok(Advance), + "advance_funding" => Ok(AdvanceFunding), + "anticipation_repayment" => Ok(AnticipationRepayment), + "application_fee" => Ok(ApplicationFee), + "application_fee_refund" => Ok(ApplicationFeeRefund), + "charge" => Ok(Charge), + "connect_collection_transfer" => Ok(ConnectCollectionTransfer), + "contribution" => Ok(Contribution), + "issuing_authorization_hold" => Ok(IssuingAuthorizationHold), + "issuing_authorization_release" => Ok(IssuingAuthorizationRelease), + "issuing_dispute" => Ok(IssuingDispute), + "issuing_transaction" => Ok(IssuingTransaction), + "obligation_inbound" => Ok(ObligationInbound), + "obligation_outbound" => Ok(ObligationOutbound), + "obligation_payout" => Ok(ObligationPayout), + "obligation_payout_failure" => Ok(ObligationPayoutFailure), + "obligation_reversal_inbound" => Ok(ObligationReversalInbound), + "obligation_reversal_outbound" => Ok(ObligationReversalOutbound), + "payment" => Ok(Payment), + "payment_failure_refund" => Ok(PaymentFailureRefund), + "payment_refund" => Ok(PaymentRefund), + "payment_reversal" => Ok(PaymentReversal), + "payment_unreconciled" => Ok(PaymentUnreconciled), + "payout" => Ok(Payout), + "payout_cancel" => Ok(PayoutCancel), + "payout_failure" => Ok(PayoutFailure), + "refund" => Ok(Refund), + "refund_failure" => Ok(RefundFailure), + "reserve_transaction" => Ok(ReserveTransaction), + "reserved_funds" => Ok(ReservedFunds), + "stripe_fee" => Ok(StripeFee), + "stripe_fx_fee" => Ok(StripeFxFee), + "tax_fee" => Ok(TaxFee), + "topup" => Ok(Topup), + "topup_reversal" => Ok(TopupReversal), + "transfer" => Ok(Transfer), + "transfer_cancel" => Ok(TransferCancel), + "transfer_failure" => Ok(TransferFailure), + "transfer_refund" => Ok(TransferRefund), + _ => Err(()), + } + } +} +impl AsRef for BalanceTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for BalanceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BalanceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BalanceTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BalanceTransactionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(BalanceTransactionType::Unknown)) + } +} +impl stripe_types::Object for BalanceTransaction { + type Id = stripe_types::balance_transaction::BalanceTransactionId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(BalanceTransactionId, "txn_"); diff --git a/stripe_types/src/generated/balance_transaction_source/mod.rs b/stripe_types/src/generated/balance_transaction_source/mod.rs new file mode 100644 index 000000000..a3d032473 --- /dev/null +++ b/stripe_types/src/generated/balance_transaction_source/mod.rs @@ -0,0 +1,63 @@ +/// The resource representing a Stripe Polymorphic. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum BalanceTransactionSource { + #[serde(rename = "application_fee")] + PlatformFee(stripe_types::PlatformFee), + #[serde(rename = "charge")] + Charge(stripe_types::Charge), + #[serde(rename = "connect_collection_transfer")] + ConnectCollectionTransfer(stripe_types::ConnectCollectionTransfer), + #[serde(rename = "customer_cash_balance_transaction")] + CustomerCashBalanceTransaction(stripe_types::CustomerCashBalanceTransaction), + #[serde(rename = "dispute")] + Dispute(stripe_types::Dispute), + #[serde(rename = "fee_refund")] + FeeRefund(stripe_types::FeeRefund), + #[serde(rename = "issuing.authorization")] + IssuingAuthorization(stripe_types::IssuingAuthorization), + #[serde(rename = "issuing.dispute")] + IssuingDispute(stripe_types::IssuingDispute), + #[serde(rename = "issuing.transaction")] + IssuingTransaction(stripe_types::IssuingTransaction), + #[serde(rename = "payout")] + Payout(stripe_types::Payout), + #[serde(rename = "platform_tax_fee")] + PlatformTax(stripe_types::PlatformTax), + #[serde(rename = "refund")] + Refund(stripe_types::Refund), + #[serde(rename = "reserve_transaction")] + ReserveTransaction(stripe_types::ReserveTransaction), + #[serde(rename = "tax_deducted_at_source")] + TaxDeductedAtSource(stripe_types::TaxDeductedAtSource), + #[serde(rename = "topup")] + Topup(stripe_types::Topup), + #[serde(rename = "transfer")] + Transfer(stripe_types::Transfer), + #[serde(rename = "transfer_reversal")] + TransferReversal(stripe_types::TransferReversal), +} +impl stripe_types::Object for BalanceTransactionSource { + type Id = String; + fn id(&self) -> Option<&str> { + match self { + Self::PlatformFee(v) => Some(v.id.as_str()), + Self::Charge(v) => Some(v.id.as_str()), + Self::ConnectCollectionTransfer(v) => Some(v.id.as_str()), + Self::CustomerCashBalanceTransaction(v) => Some(v.id.as_str()), + Self::Dispute(v) => Some(v.id.as_str()), + Self::FeeRefund(v) => Some(v.id.as_str()), + Self::IssuingAuthorization(v) => Some(v.id.as_str()), + Self::IssuingDispute(v) => Some(v.id.as_str()), + Self::IssuingTransaction(v) => Some(v.id.as_str()), + Self::Payout(v) => Some(v.id.as_str()), + Self::PlatformTax(v) => Some(v.id.as_str()), + Self::Refund(v) => Some(v.id.as_str()), + Self::ReserveTransaction(v) => Some(v.id.as_str()), + Self::TaxDeductedAtSource(v) => Some(v.id.as_str()), + Self::Topup(v) => Some(v.id.as_str()), + Self::Transfer(v) => Some(v.id.as_str()), + Self::TransferReversal(v) => Some(v.id.as_str()), + } + } +} diff --git a/stripe_types/src/generated/bank_account/mod.rs b/stripe_types/src/generated/bank_account/mod.rs new file mode 100644 index 000000000..a48e9c4e0 --- /dev/null +++ b/stripe_types/src/generated/bank_account/mod.rs @@ -0,0 +1,144 @@ +/// These bank accounts are payment methods on `Customer` objects. +/// +/// On the other hand [External Accounts](https://stripe.com/docs/api#external_accounts) are transfer +/// destinations on `Account` objects for [Custom accounts](https://stripe.com/docs/connect/custom-accounts). +/// They can be bank accounts or debit cards as well, and are documented in the links above. +/// +/// Related guide: [Bank debits and transfers](https://stripe.com/docs/payments/bank-debits-transfers). +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BankAccount { + /// The ID of the account that the bank account is associated with. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option>, + /// The name of the person or business that owns the bank account. + pub account_holder_name: Option, + /// The type of entity that holds the account. + /// + /// This can be either `individual` or `company`. + pub account_holder_type: Option, + /// The bank account type. + /// + /// This can only be `checking` or `savings` in most countries. + /// In Japan, this can only be `futsu` or `toza`. + pub account_type: Option, + /// A set of available payout methods for this bank account. + /// + /// Only values from this set should be passed as the `method` when creating a payout. + #[serde(skip_serializing_if = "Option::is_none")] + pub available_payout_methods: Option>, + /// Name of the bank associated with the routing number (e.g., `WELLS FARGO`). + pub bank_name: Option, + /// Two-letter ISO code representing the country the bank account is located in. + pub country: String, + /// Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account. + pub currency: stripe_types::Currency, + /// The ID of the customer that the bank account is associated with. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option>, + /// Whether this bank account is the default external account for its currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for_currency: Option, + /// Uniquely identifies this particular bank account. + /// + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Information about the [upcoming new requirements for the bank account](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when. + #[serde(skip_serializing_if = "Option::is_none")] + pub future_requirements: Option, + /// Unique identifier for the object. + pub id: stripe_types::bank_account::BankAccountId, + /// The last four digits of the bank account number. + pub last4: String, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option>, + /// Information about the requirements for the bank account, including what information needs to be collected. + #[serde(skip_serializing_if = "Option::is_none")] + pub requirements: Option, + /// The routing transit number for the bank account. + pub routing_number: Option, + /// For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, or `errored`. + /// + /// A bank account that hasn't had any activity or validation performed is `new`. + /// If Stripe can determine that the bank account exists, its status will be `validated`. + /// Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. + /// If customer bank account verification has succeeded, the bank account status will be `verified`. + /// If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. + /// If a payout sent to this bank account fails, we'll set the status to `errored` and will not continue to send [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) until the bank details are updated. For external accounts, possible values are `new`, `errored` and `verification_failed`. + /// If a payouts fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. + /// In India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. + /// Other validations aren't run against external accounts because they're only used for payouts. + /// This means the other statuses don't apply. + pub status: String, +} +/// A set of available payout methods for this bank account. +/// +/// Only values from this set should be passed as the `method` when creating a payout. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankAccountAvailablePayoutMethods { + Instant, + Standard, +} +impl BankAccountAvailablePayoutMethods { + pub fn as_str(self) -> &'static str { + use BankAccountAvailablePayoutMethods::*; + match self { + Instant => "instant", + Standard => "standard", + } + } +} + +impl std::str::FromStr for BankAccountAvailablePayoutMethods { + type Err = (); + fn from_str(s: &str) -> Result { + use BankAccountAvailablePayoutMethods::*; + match s { + "instant" => Ok(Instant), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for BankAccountAvailablePayoutMethods { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for BankAccountAvailablePayoutMethods { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankAccountAvailablePayoutMethods { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankAccountAvailablePayoutMethods { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BankAccountAvailablePayoutMethods { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for BankAccountAvailablePayoutMethods") + }) + } +} +impl stripe_types::Object for BankAccount { + type Id = stripe_types::bank_account::BankAccountId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(BankAccountId, "ba_" | "card_"); diff --git a/stripe_types/src/generated/billing_details/mod.rs b/stripe_types/src/generated/billing_details/mod.rs new file mode 100644 index 000000000..0ad10151f --- /dev/null +++ b/stripe_types/src/generated/billing_details/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct BillingDetails { + /// Billing address. + pub address: Option, + /// Email address. + pub email: Option, + /// Full name. + pub name: Option, + /// Billing phone number (including extension). + pub phone: Option, +} diff --git a/stripe_types/src/generated/cancellation_details/mod.rs b/stripe_types/src/generated/cancellation_details/mod.rs new file mode 100644 index 000000000..e3c48d610 --- /dev/null +++ b/stripe_types/src/generated/cancellation_details/mod.rs @@ -0,0 +1,148 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CancellationDetails { + /// Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. + pub comment: Option, + /// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. + pub feedback: Option, + /// Why this subscription was canceled. + pub reason: Option, +} +/// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CancellationDetailsFeedback { + CustomerService, + LowQuality, + MissingFeatures, + Other, + SwitchedService, + TooComplex, + TooExpensive, + Unused, +} +impl CancellationDetailsFeedback { + pub fn as_str(self) -> &'static str { + use CancellationDetailsFeedback::*; + match self { + CustomerService => "customer_service", + LowQuality => "low_quality", + MissingFeatures => "missing_features", + Other => "other", + SwitchedService => "switched_service", + TooComplex => "too_complex", + TooExpensive => "too_expensive", + Unused => "unused", + } + } +} + +impl std::str::FromStr for CancellationDetailsFeedback { + type Err = (); + fn from_str(s: &str) -> Result { + use CancellationDetailsFeedback::*; + match s { + "customer_service" => Ok(CustomerService), + "low_quality" => Ok(LowQuality), + "missing_features" => Ok(MissingFeatures), + "other" => Ok(Other), + "switched_service" => Ok(SwitchedService), + "too_complex" => Ok(TooComplex), + "too_expensive" => Ok(TooExpensive), + "unused" => Ok(Unused), + _ => Err(()), + } + } +} +impl AsRef for CancellationDetailsFeedback { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CancellationDetailsFeedback { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CancellationDetailsFeedback { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CancellationDetailsFeedback { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CancellationDetailsFeedback { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CancellationDetailsFeedback")) + } +} +/// Why this subscription was canceled. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CancellationDetailsReason { + CancellationRequested, + PaymentDisputed, + PaymentFailed, +} +impl CancellationDetailsReason { + pub fn as_str(self) -> &'static str { + use CancellationDetailsReason::*; + match self { + CancellationRequested => "cancellation_requested", + PaymentDisputed => "payment_disputed", + PaymentFailed => "payment_failed", + } + } +} + +impl std::str::FromStr for CancellationDetailsReason { + type Err = (); + fn from_str(s: &str) -> Result { + use CancellationDetailsReason::*; + match s { + "cancellation_requested" => Ok(CancellationRequested), + "payment_disputed" => Ok(PaymentDisputed), + "payment_failed" => Ok(PaymentFailed), + _ => Err(()), + } + } +} +impl AsRef for CancellationDetailsReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CancellationDetailsReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CancellationDetailsReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CancellationDetailsReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CancellationDetailsReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CancellationDetailsReason")) + } +} diff --git a/stripe_types/src/generated/card/mod.rs b/stripe_types/src/generated/card/mod.rs new file mode 100644 index 000000000..d16326b13 --- /dev/null +++ b/stripe_types/src/generated/card/mod.rs @@ -0,0 +1,179 @@ +/// You can store multiple cards on a customer in order to charge the customer +/// later. +/// +/// You can also store multiple debit cards on a recipient in order to transfer to those cards later. Related guide: [Card payments with Sources](https://stripe.com/docs/sources/cards) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Card { + /// The account this card belongs to. + /// + /// This attribute will not be in the card object if the card belongs to a customer or recipient instead. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option>, + /// City/District/Suburb/Town/Village. + pub address_city: Option, + /// Billing address country, if provided when creating card. + pub address_country: Option, + /// Address line 1 (Street address/PO Box/Company name). + pub address_line1: Option, + /// If `address_line1` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. + pub address_line1_check: Option, + /// Address line 2 (Apartment/Suite/Unit/Building). + pub address_line2: Option, + /// State/County/Province/Region. + pub address_state: Option, + /// ZIP or postal code. + pub address_zip: Option, + /// If `address_zip` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. + pub address_zip_check: Option, + /// A set of available payout methods for this card. + /// + /// Only values from this set should be passed as the `method` when creating a payout. + #[serde(skip_serializing_if = "Option::is_none")] + pub available_payout_methods: Option>, + /// Card brand. + /// + /// Can be `American Express`, `Diners Club`, `Discover`, `Eftpos Australia`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. + pub brand: String, + /// Two-letter ISO code representing the country of the card. + /// + /// You could use this attribute to get a sense of the international breakdown of cards you've collected. + pub country: Option, + /// Three-letter [ISO code for currency](https://stripe.com/docs/payouts). + /// + /// Only applicable on accounts (not customers or recipients). + /// The card can be used as a transfer destination for funds in this currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The customer that this card belongs to. + /// + /// This attribute will not be in the card object if the card belongs to an account or recipient instead. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option>, + /// If a CVC was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. + /// + /// A result of unchecked indicates that CVC was provided but hasn't been checked yet. + /// Checks are typically performed when attaching a card to a Customer object, or when creating a charge. + /// For more details, see [Check if a card is valid without a charge](https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge). + pub cvc_check: Option, + /// Whether this card is the default external account for its currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for_currency: Option, + /// A high-level description of the type of cards issued in this range. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// (For tokenized numbers only.) The last four digits of the device account number. + pub dynamic_last4: Option, + /// Two-digit number representing the card's expiration month. + pub exp_month: i64, + /// Four-digit number representing the card's expiration year. + pub exp_year: i64, + /// Uniquely identifies this particular card number. + /// + /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. + /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + /// Card funding type. + /// + /// Can be `credit`, `debit`, `prepaid`, or `unknown`. + pub funding: String, + /// Unique identifier for the object. + pub id: stripe_types::card::CardId, + /// Issuer identification number of the card. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + /// The name of the card's issuing bank. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// The last four digits of the card. + pub last4: String, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// Cardholder name. + pub name: Option, + /// For external accounts that are cards, possible values are `new` and `errored`. + /// + /// If a payout fails, the status is set to `errored` and [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) are stopped until account details are updated. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// If the card number is tokenized, this is the method that was used. + /// + /// Can be `android_pay` (includes Google Pay), `apple_pay`, `masterpass`, `visa_checkout`, or null. + pub tokenization_method: Option, +} +/// A set of available payout methods for this card. +/// +/// Only values from this set should be passed as the `method` when creating a payout. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CardAvailablePayoutMethods { + Instant, + Standard, +} +impl CardAvailablePayoutMethods { + pub fn as_str(self) -> &'static str { + use CardAvailablePayoutMethods::*; + match self { + Instant => "instant", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CardAvailablePayoutMethods { + type Err = (); + fn from_str(s: &str) -> Result { + use CardAvailablePayoutMethods::*; + match s { + "instant" => Ok(Instant), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for CardAvailablePayoutMethods { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CardAvailablePayoutMethods { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CardAvailablePayoutMethods { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CardAvailablePayoutMethods { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CardAvailablePayoutMethods { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CardAvailablePayoutMethods")) + } +} +impl stripe_types::Object for Card { + type Id = stripe_types::card::CardId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(CardId, "card_"); diff --git a/stripe_types/src/generated/card_issuing_account_terms_of_service/mod.rs b/stripe_types/src/generated/card_issuing_account_terms_of_service/mod.rs new file mode 100644 index 000000000..de88385d1 --- /dev/null +++ b/stripe_types/src/generated/card_issuing_account_terms_of_service/mod.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CardIssuingAccountTermsOfService { + /// The Unix timestamp marking when the account representative accepted the service agreement. + pub date: Option, + /// The IP address from which the account representative accepted the service agreement. + pub ip: Option, + /// The user agent of the browser from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option, +} diff --git a/stripe_types/src/generated/card_mandate_payment_method_details/mod.rs b/stripe_types/src/generated/card_mandate_payment_method_details/mod.rs new file mode 100644 index 000000000..715b901ed --- /dev/null +++ b/stripe_types/src/generated/card_mandate_payment_method_details/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CardMandatePaymentMethodDetails {} diff --git a/stripe_types/src/generated/cash_balance/mod.rs b/stripe_types/src/generated/cash_balance/mod.rs new file mode 100644 index 000000000..8a27aba24 --- /dev/null +++ b/stripe_types/src/generated/cash_balance/mod.rs @@ -0,0 +1,17 @@ +/// A customer's `Cash balance` represents real funds. +/// +/// Customers can add funds to their cash balance by sending a bank transfer. +/// These funds can be used for payment and can eventually be paid out to your bank account. For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CashBalance { + /// A hash of all cash balances available to this customer. + /// + /// You cannot delete a customer with any cash balances, even if the balance is 0. + /// Amounts are represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub available: Option>, + /// The ID of the customer whose cash balance this object represents. + pub customer: String, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + pub settings: stripe_types::CustomerBalanceCustomerBalanceSettings, +} diff --git a/stripe_types/src/generated/charge/mod.rs b/stripe_types/src/generated/charge/mod.rs new file mode 100644 index 000000000..3a4ce66c5 --- /dev/null +++ b/stripe_types/src/generated/charge/mod.rs @@ -0,0 +1,218 @@ +/// The `Charge` object represents a single attempt to move money into your Stripe account. +/// PaymentIntent confirmation is the most common way to create Charges, but transferring +/// money to a different Stripe account through Connect also creates Charges. +/// Some legacy payment flows create Charges directly, which is not recommended for new integrations. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Charge { + /// Amount intended to be collected by this payment. + /// + /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + pub amount: i64, + /// Amount in cents (or local equivalent) captured (can be less than the amount attribute on the charge if a partial capture was made). + pub amount_captured: i64, + /// Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the charge if a partial refund was issued). + pub amount_refunded: i64, + /// ID of the Connect application that created the charge. + pub application: Option>, + /// The application fee (if any) for the charge. + /// + /// [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees) for details. + pub application_fee: Option>, + /// The amount of the application fee (if any) requested for the charge. + /// + /// [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees) for details. + pub application_fee_amount: Option, + /// Authorization code on the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub authorization_code: Option, + /// ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). + pub balance_transaction: Option>, + pub billing_details: stripe_types::BillingDetails, + /// The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. + /// + /// Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. + pub calculated_statement_descriptor: Option, + /// If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured. + pub captured: bool, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the customer this charge is for if one exists. + pub customer: Option>, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// Whether the charge has been disputed. + pub disputed: bool, + /// ID of the balance transaction that describes the reversal of the balance on your account due to payment failure. + pub failure_balance_transaction: + Option>, + /// Error code explaining reason for charge failure if available (see [the errors section](https://stripe.com/docs/error-codes) for a list of codes). + pub failure_code: Option, + /// Message to user further explaining reason for charge failure if available. + pub failure_message: Option, + /// Information on fraud assessments for the charge. + pub fraud_details: Option, + /// Unique identifier for the object. + pub id: stripe_types::charge::ChargeId, + /// ID of the invoice this charge is for if one exists. + pub invoice: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub level3: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The account (if any) the charge was made on behalf of without triggering an automatic transfer. + /// + /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + pub on_behalf_of: Option>, + /// Details about whether the payment was accepted, and why. + /// + /// See [understanding declines](https://stripe.com/docs/declines) for details. + pub outcome: Option, + /// `true` if the charge succeeded, or was successfully authorized for later capture. + pub paid: bool, + /// ID of the PaymentIntent associated with this charge, if one exists. + pub payment_intent: Option>, + /// ID of the payment method used in this charge. + pub payment_method: Option, + /// Details about the payment method at the time of the transaction. + pub payment_method_details: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option, + /// This is the email address that the receipt for this charge was sent to. + pub receipt_email: Option, + /// This is the transaction number that appears on email receipts sent for this charge. + /// + /// This attribute will be `null` until a receipt has been sent. + pub receipt_number: Option, + /// This is the URL to view the receipt for this charge. + /// + /// The receipt is kept up-to-date to the latest state of the charge, including any refunds. + /// If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt. + pub receipt_url: Option, + /// Whether the charge has been fully refunded. + /// + /// If the charge is only partially refunded, this attribute will still be false. + pub refunded: bool, + /// A list of refunds that have been applied to the charge. + pub refunds: stripe_types::List, + /// ID of the review associated with this charge if one exists. + pub review: Option>, + /// Shipping information for the charge. + pub shipping: Option, + /// This is a legacy field that will be removed in the future. + /// + /// It contains the Source, Card, or BankAccount object used for the charge. + /// For details about the payment method used for this charge, refer to `payment_method` or `payment_method_details` instead. + pub source: Option, + /// The transfer ID which created this charge. + /// + /// Only present if the charge came from another Stripe account. + /// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. + pub source_transfer: Option>, + /// For card charges, use `statement_descriptor_suffix` instead. + /// + /// Otherwise, you can use this value as the complete description of a charge on your customers’ statements. + /// Must contain at least one letter, maximum 22 characters. + pub statement_descriptor: Option, + /// Provides information about the charge that customers see on their statements. + /// + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters for the concatenated descriptor. + pub statement_descriptor_suffix: Option, + /// The status of the payment is either `succeeded`, `pending`, or `failed`. + pub status: ChargeStatus, + /// ID of the transfer to the `destination` account (only applicable if the charge was created using the `destination` parameter). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer: Option>, + /// An optional dictionary including the account to automatically transfer to as part of a destination charge. + /// + /// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. + pub transfer_data: Option, + /// A string that identifies this transaction as part of a group. + /// + /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + pub transfer_group: Option, +} +/// The status of the payment is either `succeeded`, `pending`, or `failed`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ChargeStatus { + Failed, + Pending, + Succeeded, +} +impl ChargeStatus { + pub fn as_str(self) -> &'static str { + use ChargeStatus::*; + match self { + Failed => "failed", + Pending => "pending", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for ChargeStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ChargeStatus::*; + match s { + "failed" => Ok(Failed), + "pending" => Ok(Pending), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl AsRef for ChargeStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ChargeStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ChargeStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ChargeStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ChargeStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ChargeStatus")) + } +} +impl stripe_types::Object for Charge { + type Id = stripe_types::charge::ChargeId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(ChargeId, "ch_" | "py_"); diff --git a/stripe_types/src/generated/charge_fraud_details/mod.rs b/stripe_types/src/generated/charge_fraud_details/mod.rs new file mode 100644 index 000000000..855afca1e --- /dev/null +++ b/stripe_types/src/generated/charge_fraud_details/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct ChargeFraudDetails { + /// Assessments from Stripe. + /// + /// If set, the value is `fraudulent`. + #[serde(skip_serializing_if = "Option::is_none")] + pub stripe_report: Option, + /// Assessments reported by you. + /// + /// If set, possible values of are `safe` and `fraudulent`. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_report: Option, +} diff --git a/stripe_types/src/generated/charge_outcome/mod.rs b/stripe_types/src/generated/charge_outcome/mod.rs new file mode 100644 index 000000000..6cbdc1ead --- /dev/null +++ b/stripe_types/src/generated/charge_outcome/mod.rs @@ -0,0 +1,39 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ChargeOutcome { + /// Possible values are `approved_by_network`, `declined_by_network`, `not_sent_to_network`, and `reversed_after_approval`. + /// + /// The value `reversed_after_approval` indicates the payment was [blocked by Stripe](https://stripe.com/docs/declines#blocked-payments) after bank authorization, and may temporarily appear as "pending" on a cardholder's statement. + pub network_status: Option, + /// An enumerated value providing a more detailed explanation of the outcome's `type`. + /// + /// Charges blocked by Radar's default block rule have the value `highest_risk_level`. + /// Charges placed in review by Radar's default review rule have the value `elevated_risk_level`. + /// Charges authorized, blocked, or placed in review by custom rules have the value `rule`. + /// See [understanding declines](https://stripe.com/docs/declines) for more details. + pub reason: Option, + /// Stripe Radar's evaluation of the riskiness of the payment. + /// + /// Possible values for evaluated payments are `normal`, `elevated`, `highest`. + /// For non-card payments, and card-based payments predating the public assignment of risk levels, this field will have the value `not_assessed`. + /// In the event of an error in the evaluation, this field will have the value `unknown`. + /// This field is only available with Radar. + #[serde(skip_serializing_if = "Option::is_none")] + pub risk_level: Option, + /// Stripe Radar's evaluation of the riskiness of the payment. + /// + /// Possible values for evaluated payments are between 0 and 100. + /// For non-card payments, card-based payments predating the public assignment of risk scores, or in the event of an error during evaluation, this field will not be present. + /// This field is only available with Radar for Fraud Teams. + #[serde(skip_serializing_if = "Option::is_none")] + pub risk_score: Option, + /// The ID of the Radar rule that matched the payment, if applicable. + #[serde(skip_serializing_if = "Option::is_none")] + pub rule: Option>, + /// A human-readable description of the outcome type and reason, designed for you (the recipient of the payment), not your customer. + pub seller_message: Option, + /// Possible values are `authorized`, `manual_review`, `issuer_declined`, `blocked`, and `invalid`. + /// + /// See [understanding declines](https://stripe.com/docs/declines) and [Radar reviews](https://stripe.com/docs/radar/reviews) for details. + #[serde(rename = "type")] + pub type_: String, +} diff --git a/stripe_types/src/generated/charge_transfer_data/mod.rs b/stripe_types/src/generated/charge_transfer_data/mod.rs new file mode 100644 index 000000000..819993ccd --- /dev/null +++ b/stripe_types/src/generated/charge_transfer_data/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ChargeTransferData { + /// The amount transferred to the destination account, if specified. + /// + /// By default, the entire charge amount is transferred to the destination account. + pub amount: Option, + /// ID of an existing, connected Stripe account to transfer funds to if `transfer_data` was specified in the charge request. + pub destination: stripe_types::Expandable, +} diff --git a/stripe_types/src/generated/connect_collection_transfer/mod.rs b/stripe_types/src/generated/connect_collection_transfer/mod.rs new file mode 100644 index 000000000..54880b8ac --- /dev/null +++ b/stripe_types/src/generated/connect_collection_transfer/mod.rs @@ -0,0 +1,22 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ConnectCollectionTransfer { + /// Amount transferred, in cents (or local equivalent). + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the account that funds are being collected for. + pub destination: stripe_types::Expandable, + /// Unique identifier for the object. + pub id: stripe_types::connect_collection_transfer::ConnectCollectionTransferId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, +} +impl stripe_types::Object for ConnectCollectionTransfer { + type Id = stripe_types::connect_collection_transfer::ConnectCollectionTransferId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(ConnectCollectionTransferId, "connct_"); diff --git a/stripe_types/src/generated/coupon/mod.rs b/stripe_types/src/generated/coupon/mod.rs new file mode 100644 index 000000000..f7300e62f --- /dev/null +++ b/stripe_types/src/generated/coupon/mod.rs @@ -0,0 +1,125 @@ +/// A coupon contains information about a percent-off or amount-off discount you +/// might want to apply to a customer. +/// +/// Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices), [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. +/// Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents). For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Coupon { + /// Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. + pub amount_off: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub applies_to: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// If `amount_off` has been set, the three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the amount to take off. + pub currency: Option, + /// Coupons defined in each available currency option. + /// + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + std::collections::HashMap, + >, + /// One of `forever`, `once`, and `repeating`. + /// + /// Describes how long a customer who applies this coupon will get the discount. + pub duration: CouponDuration, + /// If `duration` is `repeating`, the number of months the coupon applies. + /// + /// Null if coupon `duration` is `forever` or `once`. + pub duration_in_months: Option, + /// Unique identifier for the object. + pub id: stripe_types::coupon::CouponId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid. + pub max_redemptions: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// Name of the coupon displayed to customers on for instance invoices or receipts. + pub name: Option, + /// Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. + /// + /// For example, a coupon with percent_off of 50 will make a $ (or local equivalent)100 invoice $ (or local equivalent)50 instead. + pub percent_off: Option, + /// Date after which the coupon can no longer be redeemed. + pub redeem_by: Option, + /// Number of times this coupon has been applied to a customer. + pub times_redeemed: i64, + /// Taking account of the above properties, whether this coupon can still be applied to a customer. + pub valid: bool, +} +/// One of `forever`, `once`, and `repeating`. +/// +/// Describes how long a customer who applies this coupon will get the discount. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CouponDuration { + Forever, + Once, + Repeating, +} +impl CouponDuration { + pub fn as_str(self) -> &'static str { + use CouponDuration::*; + match self { + Forever => "forever", + Once => "once", + Repeating => "repeating", + } + } +} + +impl std::str::FromStr for CouponDuration { + type Err = (); + fn from_str(s: &str) -> Result { + use CouponDuration::*; + match s { + "forever" => Ok(Forever), + "once" => Ok(Once), + "repeating" => Ok(Repeating), + _ => Err(()), + } + } +} +impl AsRef for CouponDuration { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CouponDuration { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CouponDuration { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CouponDuration { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CouponDuration { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CouponDuration")) + } +} +impl stripe_types::Object for Coupon { + type Id = stripe_types::coupon::CouponId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(CouponId); diff --git a/stripe_types/src/generated/coupon_applies_to/mod.rs b/stripe_types/src/generated/coupon_applies_to/mod.rs new file mode 100644 index 000000000..6d19b24e1 --- /dev/null +++ b/stripe_types/src/generated/coupon_applies_to/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CouponAppliesTo { + /// A list of product IDs this coupon applies to. + pub products: Vec, +} diff --git a/stripe_types/src/generated/coupon_currency_option/mod.rs b/stripe_types/src/generated/coupon_currency_option/mod.rs new file mode 100644 index 000000000..4e1881dbc --- /dev/null +++ b/stripe_types/src/generated/coupon_currency_option/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CouponCurrencyOption { + /// Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. + pub amount_off: i64, +} diff --git a/stripe_types/src/generated/credit_note/mod.rs b/stripe_types/src/generated/credit_note/mod.rs new file mode 100644 index 000000000..162be4a01 --- /dev/null +++ b/stripe_types/src/generated/credit_note/mod.rs @@ -0,0 +1,276 @@ +/// Issue a credit note to adjust an invoice's amount after the invoice is finalized. +/// +/// Related guide: [Credit notes](https://stripe.com/docs/billing/invoices/credit-notes) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CreditNote { + /// The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax. + pub amount: i64, + /// This is the sum of all the shipping amounts. + pub amount_shipping: i64, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the customer. + pub customer: stripe_types::Expandable, + /// Customer balance transaction related to this credit note. + pub customer_balance_transaction: + Option>, + /// The integer amount in cents (or local equivalent) representing the total amount of discount that was credited. + pub discount_amount: i64, + /// The aggregate amounts calculated per discount for all line items. + pub discount_amounts: Vec, + /// The date when this credit note is in effect. + /// + /// Same as `created` unless overwritten. + /// When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. + pub effective_at: Option, + /// Unique identifier for the object. + pub id: stripe_types::credit_note::CreditNoteId, + /// ID of the invoice. + pub invoice: stripe_types::Expandable, + /// Line items that make up the credit note. + pub lines: stripe_types::List, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Customer-facing text that appears on the credit note PDF. + pub memo: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice. + pub number: String, + /// Amount that was credited outside of Stripe. + pub out_of_band_amount: Option, + /// The link to download the PDF of the credit note. + pub pdf: String, + /// Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`. + pub reason: Option, + /// Refund related to this credit note. + pub refund: Option>, + /// The details of the cost of shipping, including the ShippingRate applied to the invoice. + pub shipping_cost: Option, + /// Status of this credit note, one of `issued` or `void`. + /// + /// Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). + pub status: CreditNoteStatus, + /// The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding exclusive tax and invoice level discounts. + pub subtotal: i64, + /// The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding all tax and invoice level discounts. + pub subtotal_excluding_tax: Option, + /// The aggregate amounts calculated per tax rate for all line items. + pub tax_amounts: Vec, + /// The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount. + pub total: i64, + /// The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts. + pub total_excluding_tax: Option, + /// Type of this credit note, one of `pre_payment` or `post_payment`. + /// + /// A `pre_payment` credit note means it was issued when the invoice was open. + /// A `post_payment` credit note means it was issued when the invoice was paid. + #[serde(rename = "type")] + pub type_: CreditNoteType, + /// The time that the credit note was voided. + pub voided_at: Option, +} +/// Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreditNoteReason { + Duplicate, + Fraudulent, + OrderChange, + ProductUnsatisfactory, +} +impl CreditNoteReason { + pub fn as_str(self) -> &'static str { + use CreditNoteReason::*; + match self { + Duplicate => "duplicate", + Fraudulent => "fraudulent", + OrderChange => "order_change", + ProductUnsatisfactory => "product_unsatisfactory", + } + } +} + +impl std::str::FromStr for CreditNoteReason { + type Err = (); + fn from_str(s: &str) -> Result { + use CreditNoteReason::*; + match s { + "duplicate" => Ok(Duplicate), + "fraudulent" => Ok(Fraudulent), + "order_change" => Ok(OrderChange), + "product_unsatisfactory" => Ok(ProductUnsatisfactory), + _ => Err(()), + } + } +} +impl AsRef for CreditNoteReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreditNoteReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreditNoteReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreditNoteReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CreditNoteReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CreditNoteReason")) + } +} +/// Status of this credit note, one of `issued` or `void`. +/// +/// Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreditNoteStatus { + Issued, + Void, +} +impl CreditNoteStatus { + pub fn as_str(self) -> &'static str { + use CreditNoteStatus::*; + match self { + Issued => "issued", + Void => "void", + } + } +} + +impl std::str::FromStr for CreditNoteStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use CreditNoteStatus::*; + match s { + "issued" => Ok(Issued), + "void" => Ok(Void), + _ => Err(()), + } + } +} +impl AsRef for CreditNoteStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreditNoteStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreditNoteStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreditNoteStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CreditNoteStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CreditNoteStatus")) + } +} +/// Type of this credit note, one of `pre_payment` or `post_payment`. +/// +/// A `pre_payment` credit note means it was issued when the invoice was open. +/// A `post_payment` credit note means it was issued when the invoice was paid. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreditNoteType { + PostPayment, + PrePayment, +} +impl CreditNoteType { + pub fn as_str(self) -> &'static str { + use CreditNoteType::*; + match self { + PostPayment => "post_payment", + PrePayment => "pre_payment", + } + } +} + +impl std::str::FromStr for CreditNoteType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreditNoteType::*; + match s { + "post_payment" => Ok(PostPayment), + "pre_payment" => Ok(PrePayment), + _ => Err(()), + } + } +} +impl AsRef for CreditNoteType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreditNoteType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreditNoteType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreditNoteType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CreditNoteType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreditNoteType")) + } +} +impl stripe_types::Object for CreditNote { + type Id = stripe_types::credit_note::CreditNoteId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(CreditNoteId, "cn_"); diff --git a/stripe_types/src/generated/credit_note_line_item/mod.rs b/stripe_types/src/generated/credit_note_line_item/mod.rs new file mode 100644 index 000000000..ac48960cd --- /dev/null +++ b/stripe_types/src/generated/credit_note_line_item/mod.rs @@ -0,0 +1,108 @@ +/// The credit note line item object +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CreditNoteLineItem { + /// The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts. + pub amount: i64, + /// The integer amount in cents (or local equivalent) representing the amount being credited for this line item, excluding all tax and discounts. + pub amount_excluding_tax: Option, + /// Description of the item being credited. + pub description: Option, + /// The integer amount in cents (or local equivalent) representing the discount being credited for this line item. + pub discount_amount: i64, + /// The amount of discount calculated per discount for this line item. + pub discount_amounts: Vec, + /// Unique identifier for the object. + pub id: stripe_types::credit_note_line_item::CreditNoteLineItemId, + /// ID of the invoice line item being credited. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_line_item: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The number of units of product being credited. + pub quantity: Option, + /// The amount of tax calculated per tax rate for this line item. + pub tax_amounts: Vec, + /// The tax rates which apply to the line item. + pub tax_rates: Vec, + /// The type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. + /// + /// When the type is `invoice_line_item` there is an additional `invoice_line_item` property on the resource the value of which is the id of the credited line item on the invoice. + #[serde(rename = "type")] + pub type_: CreditNoteLineItemType, + /// The cost of each unit of product being credited. + pub unit_amount: Option, + /// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + pub unit_amount_decimal: Option, + /// The amount in cents (or local equivalent) representing the unit amount being credited for this line item, excluding all tax and discounts. + pub unit_amount_excluding_tax: Option, +} +/// The type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. +/// +/// When the type is `invoice_line_item` there is an additional `invoice_line_item` property on the resource the value of which is the id of the credited line item on the invoice. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreditNoteLineItemType { + CustomLineItem, + InvoiceLineItem, +} +impl CreditNoteLineItemType { + pub fn as_str(self) -> &'static str { + use CreditNoteLineItemType::*; + match self { + CustomLineItem => "custom_line_item", + InvoiceLineItem => "invoice_line_item", + } + } +} + +impl std::str::FromStr for CreditNoteLineItemType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreditNoteLineItemType::*; + match s { + "custom_line_item" => Ok(CustomLineItem), + "invoice_line_item" => Ok(InvoiceLineItem), + _ => Err(()), + } + } +} +impl AsRef for CreditNoteLineItemType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreditNoteLineItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreditNoteLineItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreditNoteLineItemType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CreditNoteLineItemType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CreditNoteLineItemType")) + } +} +impl stripe_types::Object for CreditNoteLineItem { + type Id = stripe_types::credit_note_line_item::CreditNoteLineItemId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(CreditNoteLineItemId, "cnli_"); diff --git a/stripe_types/src/generated/credit_note_tax_amount/mod.rs b/stripe_types/src/generated/credit_note_tax_amount/mod.rs new file mode 100644 index 000000000..da232c378 --- /dev/null +++ b/stripe_types/src/generated/credit_note_tax_amount/mod.rs @@ -0,0 +1,118 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CreditNoteTaxAmount { + /// The amount, in cents (or local equivalent), of the tax. + pub amount: i64, + /// Whether this tax amount is inclusive or exclusive. + pub inclusive: bool, + /// The tax rate that was applied to get this tax amount. + pub tax_rate: stripe_types::Expandable, + /// The reasoning behind this tax, for example, if the product is tax exempt. + /// + /// The possible values for this field may be extended as new tax rules are supported. + pub taxability_reason: Option, + /// The amount on which tax is calculated, in cents (or local equivalent). + pub taxable_amount: Option, +} +/// The reasoning behind this tax, for example, if the product is tax exempt. +/// +/// The possible values for this field may be extended as new tax rules are supported. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreditNoteTaxAmountTaxabilityReason { + CustomerExempt, + NotCollecting, + NotSubjectToTax, + NotSupported, + PortionProductExempt, + PortionReducedRated, + PortionStandardRated, + ProductExempt, + ProductExemptHoliday, + ProportionallyRated, + ReducedRated, + ReverseCharge, + StandardRated, + TaxableBasisReduced, + ZeroRated, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreditNoteTaxAmountTaxabilityReason { + pub fn as_str(self) -> &'static str { + use CreditNoteTaxAmountTaxabilityReason::*; + match self { + CustomerExempt => "customer_exempt", + NotCollecting => "not_collecting", + NotSubjectToTax => "not_subject_to_tax", + NotSupported => "not_supported", + PortionProductExempt => "portion_product_exempt", + PortionReducedRated => "portion_reduced_rated", + PortionStandardRated => "portion_standard_rated", + ProductExempt => "product_exempt", + ProductExemptHoliday => "product_exempt_holiday", + ProportionallyRated => "proportionally_rated", + ReducedRated => "reduced_rated", + ReverseCharge => "reverse_charge", + StandardRated => "standard_rated", + TaxableBasisReduced => "taxable_basis_reduced", + ZeroRated => "zero_rated", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreditNoteTaxAmountTaxabilityReason { + type Err = (); + fn from_str(s: &str) -> Result { + use CreditNoteTaxAmountTaxabilityReason::*; + match s { + "customer_exempt" => Ok(CustomerExempt), + "not_collecting" => Ok(NotCollecting), + "not_subject_to_tax" => Ok(NotSubjectToTax), + "not_supported" => Ok(NotSupported), + "portion_product_exempt" => Ok(PortionProductExempt), + "portion_reduced_rated" => Ok(PortionReducedRated), + "portion_standard_rated" => Ok(PortionStandardRated), + "product_exempt" => Ok(ProductExempt), + "product_exempt_holiday" => Ok(ProductExemptHoliday), + "proportionally_rated" => Ok(ProportionallyRated), + "reduced_rated" => Ok(ReducedRated), + "reverse_charge" => Ok(ReverseCharge), + "standard_rated" => Ok(StandardRated), + "taxable_basis_reduced" => Ok(TaxableBasisReduced), + "zero_rated" => Ok(ZeroRated), + _ => Err(()), + } + } +} +impl AsRef for CreditNoteTaxAmountTaxabilityReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CreditNoteTaxAmountTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreditNoteTaxAmountTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreditNoteTaxAmountTaxabilityReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CreditNoteTaxAmountTaxabilityReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(CreditNoteTaxAmountTaxabilityReason::Unknown)) + } +} diff --git a/stripe_types/src/generated/currency_option/mod.rs b/stripe_types/src/generated/currency_option/mod.rs new file mode 100644 index 000000000..0d082370b --- /dev/null +++ b/stripe_types/src/generated/currency_option/mod.rs @@ -0,0 +1,91 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CurrencyOption { + /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + pub custom_unit_amount: Option, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + pub tax_behavior: Option, + /// Each element represents a pricing tier. + /// + /// This parameter requires `billing_scheme` to be set to `tiered`. + /// See also the documentation for `billing_scheme`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers: Option>, + /// The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. + /// + /// Only set if `billing_scheme=per_unit`. + pub unit_amount: Option, + /// The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. + /// + /// Only set if `billing_scheme=per_unit`. + pub unit_amount_decimal: Option, +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CurrencyOptionTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CurrencyOptionTaxBehavior { + pub fn as_str(self) -> &'static str { + use CurrencyOptionTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CurrencyOptionTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CurrencyOptionTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for CurrencyOptionTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CurrencyOptionTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CurrencyOptionTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CurrencyOptionTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CurrencyOptionTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CurrencyOptionTaxBehavior")) + } +} diff --git a/stripe_types/src/generated/custom_unit_amount/mod.rs b/stripe_types/src/generated/custom_unit_amount/mod.rs new file mode 100644 index 000000000..f74687d68 --- /dev/null +++ b/stripe_types/src/generated/custom_unit_amount/mod.rs @@ -0,0 +1,11 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CustomUnitAmount { + /// The maximum unit amount the customer can specify for this item. + pub maximum: Option, + /// The minimum unit amount the customer can specify for this item. + /// + /// Must be at least the minimum charge amount. + pub minimum: Option, + /// The starting unit amount which can be updated by the customer. + pub preset: Option, +} diff --git a/stripe_types/src/generated/customer/mod.rs b/stripe_types/src/generated/customer/mod.rs new file mode 100644 index 000000000..3f30cd46b --- /dev/null +++ b/stripe_types/src/generated/customer/mod.rs @@ -0,0 +1,180 @@ +/// This object represents a customer of your business. +/// +/// Use it to create recurring charges and track payments that belong to the same customer. Related guide: [Save a card during payment](https://stripe.com/docs/payments/save-during-payment) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Customer { + /// The customer's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option, + /// The current balance, if any, that's stored on the customer. + /// + /// If negative, the customer has credit to apply to their next invoice. + /// If positive, the customer has an amount owed that's added to their next invoice. + /// The balance only considers amounts that Stripe hasn't successfully applied to any invoice. + /// It doesn't reflect unpaid invoices. + /// This balance is only taken into account after invoices finalize. + #[serde(skip_serializing_if = "Option::is_none")] + pub balance: Option, + /// The current funds being held by Stripe on behalf of the customer. + /// + /// You can apply these funds towards payment intents when the source is "cash_balance". + /// The `settings[reconciliation_mode]` field describes if these funds apply to these payment intents manually or automatically. + #[serde(skip_serializing_if = "Option::is_none")] + pub cash_balance: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) the customer can be charged in for recurring billing purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// ID of the default payment source for the customer. + /// + /// If you use payment methods created through the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) field instead. + pub default_source: Option>, + /// Tracks the most recent state change on any invoice belonging to the customer. + /// + /// Paying an invoice or marking it uncollectible via the API will set this field to false. + /// An automatic payment failure or passing the `invoice.due_date` will set this field to `true`. If an invoice becomes uncollectible by [dunning](https://stripe.com/docs/billing/automatic-collection), `delinquent` doesn't reset to `false`. If you care whether the customer has paid their most recent subscription invoice, use `subscription.status` instead. + /// Paying or marking uncollectible any customer invoice regardless of whether it is the latest invoice for a subscription will always set this field to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub delinquent: Option, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// Describes the current discount active on the customer, if there is one. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option, + /// The customer's email address. + pub email: Option, + /// Unique identifier for the object. + pub id: stripe_types::customer::CustomerId, + /// The current multi-currency balances, if any, that's stored on the customer. + /// + /// If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. + /// If negative, the customer has an amount owed that's added to their next invoice denominated in that currency. + /// These balances don't apply to unpaid invoices. + /// They solely track amounts that Stripe hasn't successfully applied to any invoice. + /// Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_credit_balance: Option>, + /// The prefix for the customer used to generate unique invoice numbers. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_prefix: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option>, + /// The customer's full name or business name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + /// The suffix of the customer's next invoice number (for example, 0001). + #[serde(skip_serializing_if = "Option::is_none")] + pub next_invoice_sequence: Option, + /// The customer's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option, + /// The customer's preferred locales (languages), ordered by preference. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locales: Option>, + /// Mailing and shipping address for the customer. + /// + /// Appears on invoices emailed to this customer. + pub shipping: Option, + /// The customer's payment sources, if any. + #[serde(default)] + pub sources: stripe_types::List, + /// The customer's current subscriptions, if any. + #[serde(default)] + pub subscriptions: stripe_types::List, + #[serde(skip_serializing_if = "Option::is_none")] + pub tax: Option, + /// Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. + /// + /// When set to `reverse`, invoice and receipt PDFs include the following text: **"Reverse charge"**. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_exempt: Option, + /// The customer's tax IDs. + #[serde(default)] + pub tax_ids: stripe_types::List, + /// ID of the test clock that this customer belongs to. + #[serde(skip_serializing_if = "Option::is_none")] + pub test_clock: Option>, +} +/// Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. +/// +/// When set to `reverse`, invoice and receipt PDFs include the following text: **"Reverse charge"**. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerTaxExempt { + Exempt, + None, + Reverse, +} +impl CustomerTaxExempt { + pub fn as_str(self) -> &'static str { + use CustomerTaxExempt::*; + match self { + Exempt => "exempt", + None => "none", + Reverse => "reverse", + } + } +} + +impl std::str::FromStr for CustomerTaxExempt { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerTaxExempt::*; + match s { + "exempt" => Ok(Exempt), + "none" => Ok(None), + "reverse" => Ok(Reverse), + _ => Err(()), + } + } +} +impl AsRef for CustomerTaxExempt { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CustomerTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerTaxExempt { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerTaxExempt { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CustomerTaxExempt")) + } +} +impl stripe_types::Object for Customer { + type Id = stripe_types::customer::CustomerId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(CustomerId, "cus_"); diff --git a/stripe_types/src/generated/customer_acceptance/mod.rs b/stripe_types/src/generated/customer_acceptance/mod.rs new file mode 100644 index 000000000..a2d264a40 --- /dev/null +++ b/stripe_types/src/generated/customer_acceptance/mod.rs @@ -0,0 +1,71 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerAcceptance { + /// The time that the customer accepts the mandate. + pub accepted_at: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub online: Option, + /// The mandate includes the type of customer acceptance information, such as: `online` or `offline`. + #[serde(rename = "type")] + pub type_: CustomerAcceptanceType, +} +/// The mandate includes the type of customer acceptance information, such as: `online` or `offline`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerAcceptanceType { + Offline, + Online, +} +impl CustomerAcceptanceType { + pub fn as_str(self) -> &'static str { + use CustomerAcceptanceType::*; + match self { + Offline => "offline", + Online => "online", + } + } +} + +impl std::str::FromStr for CustomerAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerAcceptanceType::*; + match s { + "offline" => Ok(Offline), + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl AsRef for CustomerAcceptanceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerAcceptanceType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CustomerAcceptanceType")) + } +} diff --git a/stripe_types/src/generated/customer_balance_customer_balance_settings/mod.rs b/stripe_types/src/generated/customer_balance_customer_balance_settings/mod.rs new file mode 100644 index 000000000..b35e77ee3 --- /dev/null +++ b/stripe_types/src/generated/customer_balance_customer_balance_settings/mod.rs @@ -0,0 +1,69 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceCustomerBalanceSettings { + /// The configuration for how funds that land in the customer cash balance are reconciled. + pub reconciliation_mode: CustomerBalanceCustomerBalanceSettingsReconciliationMode, + /// A flag to indicate if reconciliation mode returned is the user's default or is specific to this customer cash balance. + pub using_merchant_default: bool, +} +/// The configuration for how funds that land in the customer cash balance are reconciled. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerBalanceCustomerBalanceSettingsReconciliationMode { + Automatic, + Manual, +} +impl CustomerBalanceCustomerBalanceSettingsReconciliationMode { + pub fn as_str(self) -> &'static str { + use CustomerBalanceCustomerBalanceSettingsReconciliationMode::*; + match self { + Automatic => "automatic", + Manual => "manual", + } + } +} + +impl std::str::FromStr for CustomerBalanceCustomerBalanceSettingsReconciliationMode { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerBalanceCustomerBalanceSettingsReconciliationMode::*; + match s { + "automatic" => Ok(Automatic), + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for CustomerBalanceCustomerBalanceSettingsReconciliationMode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CustomerBalanceCustomerBalanceSettingsReconciliationMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerBalanceCustomerBalanceSettingsReconciliationMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerBalanceCustomerBalanceSettingsReconciliationMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerBalanceCustomerBalanceSettingsReconciliationMode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CustomerBalanceCustomerBalanceSettingsReconciliationMode", + ) + }) + } +} diff --git a/stripe_types/src/generated/customer_balance_funding_instructions_customer_balance_funding_instructions/mod.rs b/stripe_types/src/generated/customer_balance_funding_instructions_customer_balance_funding_instructions/mod.rs new file mode 100644 index 000000000..1bbc02826 --- /dev/null +++ b/stripe_types/src/generated/customer_balance_funding_instructions_customer_balance_funding_instructions/mod.rs @@ -0,0 +1,85 @@ +/// Each customer has a [`balance`](https://stripe.com/docs/api/customers/object#customer_object-balance) that is +/// automatically applied to future invoices and payments using the `customer_balance` payment method. +/// Customers can fund this balance by initiating a bank transfer to any account in the +/// `financial_addresses` field. +/// Related guide: [Customer balance funding instructions](https://stripe.com/docs/payments/customer-balance/funding-instructions). +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructions { + pub bank_transfer: stripe_types::FundingInstructionsBankTransfer, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The `funding_type` of the returned instructions. + pub funding_type: + CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructionsFundingType, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, +} +/// The `funding_type` of the returned instructions. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructionsFundingType { + BankTransfer, +} +impl CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructionsFundingType { + pub fn as_str(self) -> &'static str { + use CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructionsFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr + for CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructionsFundingType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructionsFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl AsRef + for CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructionsFundingType +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructionsFundingType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructionsFundingType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructionsFundingType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructionsFundingType +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructionsFundingType")) + } +} diff --git a/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft/mod.rs b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft/mod.rs new file mode 100644 index 000000000..7e248cee2 --- /dev/null +++ b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceAdjustedForOverdraft { + /// The [Balance Transaction](https://stripe.com/docs/api/balance_transactions/object) that corresponds to funds taken out of your Stripe balance. + pub balance_transaction: stripe_types::Expandable, + /// The [Cash Balance Transaction](https://stripe.com/docs/api/cash_balance_transactions/object) that brought the customer balance negative, triggering the clawback of funds. + pub linked_transaction: stripe_types::Expandable, +} diff --git a/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction/mod.rs b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction/mod.rs new file mode 100644 index 000000000..ac6110222 --- /dev/null +++ b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceAppliedToPaymentTransaction { + /// The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were applied to. + pub payment_intent: stripe_types::Expandable, +} diff --git a/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction/mod.rs b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction/mod.rs new file mode 100644 index 000000000..fd1dfe13a --- /dev/null +++ b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransaction { +pub bank_transfer: stripe_types::CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransfer, + +} diff --git a/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer/mod.rs b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer/mod.rs new file mode 100644 index 000000000..53e6370b7 --- /dev/null +++ b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer/mod.rs @@ -0,0 +1,89 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransfer { +#[serde(skip_serializing_if = "Option::is_none")] +pub eu_bank_transfer: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub gb_bank_transfer: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub jp_bank_transfer: Option, + /// The user-supplied reference field on the bank transfer. +pub reference: Option, + /// The funding method type used to fund the customer balance. + /// + /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[serde(rename = "type")] +pub type_: CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType, +#[serde(skip_serializing_if = "Option::is_none")] +pub us_bank_transfer: Option, + +} +/// The funding method type used to fund the customer balance. +/// +/// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType +{ + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl + CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType +{ + pub fn as_str(self) -> &'static str { + use CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), +"gb_bank_transfer" => Ok(GbBankTransfer), +"jp_bank_transfer" => Ok(JpBankTransfer), +"mx_bank_transfer" => Ok(MxBankTransfer), +"us_bank_transfer" => Ok(UsBankTransfer), +_ => Err(()) + + } + } +} +impl AsRef for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType")) + } +} diff --git a/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer/mod.rs b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer/mod.rs new file mode 100644 index 000000000..47a2dd437 --- /dev/null +++ b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer/mod.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceEuBankTransfer +{ + /// The BIC of the bank of the sender of the funding. + pub bic: Option, + /// The last 4 digits of the IBAN of the sender of the funding. + pub iban_last4: Option, + /// The full name of the sender, as supplied by the sending bank. + pub sender_name: Option, +} diff --git a/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer/mod.rs b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer/mod.rs new file mode 100644 index 000000000..fcc571261 --- /dev/null +++ b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer/mod.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceGbBankTransfer +{ + /// The last 4 digits of the account number of the sender of the funding. + pub account_number_last4: Option, + /// The full name of the sender, as supplied by the sending bank. + pub sender_name: Option, + /// The sort code of the bank of the sender of the funding. + pub sort_code: Option, +} diff --git a/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer/mod.rs b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer/mod.rs new file mode 100644 index 000000000..694874cb8 --- /dev/null +++ b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer/mod.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceJpBankTransfer +{ + /// The name of the bank of the sender of the funding. + pub sender_bank: Option, + /// The name of the bank branch of the sender of the funding. + pub sender_branch: Option, + /// The full name of the sender, as supplied by the sending bank. + pub sender_name: Option, +} diff --git a/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer/mod.rs b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer/mod.rs new file mode 100644 index 000000000..b387dc936 --- /dev/null +++ b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer/mod.rs @@ -0,0 +1,70 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransfer { + /// The banking network used for this funding. +#[serde(skip_serializing_if = "Option::is_none")] +pub network: Option, + /// The full name of the sender, as supplied by the sending bank. +pub sender_name: Option, + +} +/// The banking network used for this funding. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork +{ + Ach, + DomesticWireUs, + Swift, +} +impl CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { + pub fn as_str(self) -> &'static str { + use CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork::*; + match self { +Ach => "ach", +DomesticWireUs => "domestic_wire_us", +Swift => "swift", + + } + } +} + +impl std::str::FromStr for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork::*; + match s { + "ach" => Ok(Ach), +"domestic_wire_us" => Ok(DomesticWireUs), +"swift" => Ok(Swift), +_ => Err(()) + + } + } +} +impl AsRef for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork")) + } +} diff --git a/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction/mod.rs b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction/mod.rs new file mode 100644 index 000000000..5196330b3 --- /dev/null +++ b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceRefundedFromPaymentTransaction { + /// The [Refund](https://stripe.com/docs/api/refunds/object) that moved these funds into the customer's cash balance. + pub refund: stripe_types::Expandable, +} diff --git a/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction/mod.rs b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction/mod.rs new file mode 100644 index 000000000..927127d3a --- /dev/null +++ b/stripe_types/src/generated/customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceUnappliedFromPaymentTransaction { + /// The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were unapplied from. + pub payment_intent: stripe_types::Expandable, +} diff --git a/stripe_types/src/generated/customer_balance_transaction/mod.rs b/stripe_types/src/generated/customer_balance_transaction/mod.rs new file mode 100644 index 000000000..b633eb0d5 --- /dev/null +++ b/stripe_types/src/generated/customer_balance_transaction/mod.rs @@ -0,0 +1,144 @@ +/// Each customer has a [Balance](https://stripe.com/docs/api/customers/object#customer_object-balance) value, +/// which denotes a debit or credit that's automatically applied to their next invoice upon finalization. +/// You may modify the value directly by using the [update customer API](https://stripe.com/docs/api/customers/update), +/// or by creating a Customer Balance Transaction, which increments or decrements the customer's `balance` by the specified `amount`. +/// +/// Related guide: [Customer balance](https://stripe.com/docs/billing/customer/balance) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceTransaction { + /// The amount of the transaction. + /// + /// A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's `balance`. + pub amount: i64, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The ID of the credit note (if any) related to the transaction. + pub credit_note: Option>, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the customer the transaction belongs to. + pub customer: stripe_types::Expandable, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// The customer's `balance` after the transaction was applied. + /// + /// A negative value decreases the amount due on the customer's next invoice. + /// A positive value increases the amount due on the customer's next invoice. + pub ending_balance: i64, + /// Unique identifier for the object. + pub id: stripe_types::customer_balance_transaction::CustomerBalanceTransactionId, + /// The ID of the invoice (if any) related to the transaction. + pub invoice: Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, or `unapplied_from_invoice`. + /// + /// See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types. + #[serde(rename = "type")] + pub type_: CustomerBalanceTransactionType, +} +/// Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, or `unapplied_from_invoice`. +/// +/// See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerBalanceTransactionType { + Adjustment, + AppliedToInvoice, + CreditNote, + Initial, + InvoiceOverpaid, + InvoiceTooLarge, + InvoiceTooSmall, + Migration, + UnappliedFromInvoice, + UnspentReceiverCredit, +} +impl CustomerBalanceTransactionType { + pub fn as_str(self) -> &'static str { + use CustomerBalanceTransactionType::*; + match self { + Adjustment => "adjustment", + AppliedToInvoice => "applied_to_invoice", + CreditNote => "credit_note", + Initial => "initial", + InvoiceOverpaid => "invoice_overpaid", + InvoiceTooLarge => "invoice_too_large", + InvoiceTooSmall => "invoice_too_small", + Migration => "migration", + UnappliedFromInvoice => "unapplied_from_invoice", + UnspentReceiverCredit => "unspent_receiver_credit", + } + } +} + +impl std::str::FromStr for CustomerBalanceTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerBalanceTransactionType::*; + match s { + "adjustment" => Ok(Adjustment), + "applied_to_invoice" => Ok(AppliedToInvoice), + "credit_note" => Ok(CreditNote), + "initial" => Ok(Initial), + "invoice_overpaid" => Ok(InvoiceOverpaid), + "invoice_too_large" => Ok(InvoiceTooLarge), + "invoice_too_small" => Ok(InvoiceTooSmall), + "migration" => Ok(Migration), + "unapplied_from_invoice" => Ok(UnappliedFromInvoice), + "unspent_receiver_credit" => Ok(UnspentReceiverCredit), + _ => Err(()), + } + } +} +impl AsRef for CustomerBalanceTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CustomerBalanceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerBalanceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerBalanceTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerBalanceTransactionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for CustomerBalanceTransactionType") + }) + } +} +impl stripe_types::Object for CustomerBalanceTransaction { + type Id = stripe_types::customer_balance_transaction::CustomerBalanceTransactionId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(CustomerBalanceTransactionId, "cbtxn_"); diff --git a/stripe_types/src/generated/customer_cash_balance_transaction/mod.rs b/stripe_types/src/generated/customer_cash_balance_transaction/mod.rs new file mode 100644 index 000000000..0995279e2 --- /dev/null +++ b/stripe_types/src/generated/customer_cash_balance_transaction/mod.rs @@ -0,0 +1,138 @@ +/// Customers with certain payments enabled have a cash balance, representing funds that were paid +/// by the customer to a merchant, but have not yet been allocated to a payment. +/// +/// Cash Balance Transactions represent when funds are moved into or out of this balance. +/// This includes funding by the customer, allocation to payments, and refunds to the customer. For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerCashBalanceTransaction { +#[serde(skip_serializing_if = "Option::is_none")] +pub adjusted_for_overdraft: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub applied_to_payment: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. +pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). +pub currency: stripe_types::Currency, + /// The customer whose available cash balance changed as a result of this transaction. +pub customer: stripe_types::Expandable, + /// The total available cash balance for the specified currency after this transaction was applied. + /// + /// Represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). +pub ending_balance: i64, +#[serde(skip_serializing_if = "Option::is_none")] +pub funded: Option, + /// Unique identifier for the object. +pub id: stripe_types::customer_cash_balance_transaction::CustomerCashBalanceTransactionId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. +pub livemode: bool, + /// The amount by which the cash balance changed, represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// + /// A positive value represents funds being added to the cash balance, a negative value represents funds being removed from the cash balance. +pub net_amount: i64, +#[serde(skip_serializing_if = "Option::is_none")] +pub refunded_from_payment: Option, + /// The type of the cash balance transaction. + /// + /// New types may be added in future. + /// See [Customer Balance](https://stripe.com/docs/payments/customer-balance#types) to learn more about these types. +#[serde(rename = "type")] +pub type_: CustomerCashBalanceTransactionType, +#[serde(skip_serializing_if = "Option::is_none")] +pub unapplied_from_payment: Option, + +} +/// The type of the cash balance transaction. +/// +/// New types may be added in future. +/// See [Customer Balance](https://stripe.com/docs/payments/customer-balance#types) to learn more about these types. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerCashBalanceTransactionType { + AdjustedForOverdraft, + AppliedToPayment, + Funded, + FundingReversed, + RefundedFromPayment, + ReturnCanceled, + ReturnInitiated, + TransferredToBalance, + UnappliedFromPayment, +} +impl CustomerCashBalanceTransactionType { + pub fn as_str(self) -> &'static str { + use CustomerCashBalanceTransactionType::*; + match self { + AdjustedForOverdraft => "adjusted_for_overdraft", + AppliedToPayment => "applied_to_payment", + Funded => "funded", + FundingReversed => "funding_reversed", + RefundedFromPayment => "refunded_from_payment", + ReturnCanceled => "return_canceled", + ReturnInitiated => "return_initiated", + TransferredToBalance => "transferred_to_balance", + UnappliedFromPayment => "unapplied_from_payment", + } + } +} + +impl std::str::FromStr for CustomerCashBalanceTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerCashBalanceTransactionType::*; + match s { + "adjusted_for_overdraft" => Ok(AdjustedForOverdraft), + "applied_to_payment" => Ok(AppliedToPayment), + "funded" => Ok(Funded), + "funding_reversed" => Ok(FundingReversed), + "refunded_from_payment" => Ok(RefundedFromPayment), + "return_canceled" => Ok(ReturnCanceled), + "return_initiated" => Ok(ReturnInitiated), + "transferred_to_balance" => Ok(TransferredToBalance), + "unapplied_from_payment" => Ok(UnappliedFromPayment), + _ => Err(()), + } + } +} +impl AsRef for CustomerCashBalanceTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CustomerCashBalanceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerCashBalanceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerCashBalanceTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerCashBalanceTransactionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for CustomerCashBalanceTransactionType") + }) + } +} +impl stripe_types::Object for CustomerCashBalanceTransaction { + type Id = stripe_types::customer_cash_balance_transaction::CustomerCashBalanceTransactionId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(CustomerCashBalanceTransactionId); diff --git a/stripe_types/src/generated/customer_tax/mod.rs b/stripe_types/src/generated/customer_tax/mod.rs new file mode 100644 index 000000000..6f630c07a --- /dev/null +++ b/stripe_types/src/generated/customer_tax/mod.rs @@ -0,0 +1,74 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerTax { + /// Surfaces if automatic tax computation is possible given the current customer location information. + pub automatic_tax: CustomerTaxAutomaticTax, + /// A recent IP address of the customer used for tax reporting and tax location inference. + pub ip_address: Option, + /// The customer's location as identified by Stripe Tax. + pub location: Option, +} +/// Surfaces if automatic tax computation is possible given the current customer location information. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerTaxAutomaticTax { + Failed, + NotCollecting, + Supported, + UnrecognizedLocation, +} +impl CustomerTaxAutomaticTax { + pub fn as_str(self) -> &'static str { + use CustomerTaxAutomaticTax::*; + match self { + Failed => "failed", + NotCollecting => "not_collecting", + Supported => "supported", + UnrecognizedLocation => "unrecognized_location", + } + } +} + +impl std::str::FromStr for CustomerTaxAutomaticTax { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerTaxAutomaticTax::*; + match s { + "failed" => Ok(Failed), + "not_collecting" => Ok(NotCollecting), + "supported" => Ok(Supported), + "unrecognized_location" => Ok(UnrecognizedLocation), + _ => Err(()), + } + } +} +impl AsRef for CustomerTaxAutomaticTax { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CustomerTaxAutomaticTax { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerTaxAutomaticTax { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerTaxAutomaticTax { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerTaxAutomaticTax { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CustomerTaxAutomaticTax")) + } +} diff --git a/stripe_types/src/generated/customer_tax_location/mod.rs b/stripe_types/src/generated/customer_tax_location/mod.rs new file mode 100644 index 000000000..c4968ef9e --- /dev/null +++ b/stripe_types/src/generated/customer_tax_location/mod.rs @@ -0,0 +1,74 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerTaxLocation { + /// The customer's country as identified by Stripe Tax. + pub country: String, + /// The data source used to infer the customer's location. + pub source: CustomerTaxLocationSource, + /// The customer's state, county, province, or region as identified by Stripe Tax. + pub state: Option, +} +/// The data source used to infer the customer's location. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerTaxLocationSource { + BillingAddress, + IpAddress, + PaymentMethod, + ShippingDestination, +} +impl CustomerTaxLocationSource { + pub fn as_str(self) -> &'static str { + use CustomerTaxLocationSource::*; + match self { + BillingAddress => "billing_address", + IpAddress => "ip_address", + PaymentMethod => "payment_method", + ShippingDestination => "shipping_destination", + } + } +} + +impl std::str::FromStr for CustomerTaxLocationSource { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerTaxLocationSource::*; + match s { + "billing_address" => Ok(BillingAddress), + "ip_address" => Ok(IpAddress), + "payment_method" => Ok(PaymentMethod), + "shipping_destination" => Ok(ShippingDestination), + _ => Err(()), + } + } +} +impl AsRef for CustomerTaxLocationSource { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for CustomerTaxLocationSource { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerTaxLocationSource { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerTaxLocationSource { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerTaxLocationSource { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CustomerTaxLocationSource")) + } +} diff --git a/stripe_types/src/generated/deleted_account/mod.rs b/stripe_types/src/generated/deleted_account/mod.rs new file mode 100644 index 000000000..6cdf2ea4d --- /dev/null +++ b/stripe_types/src/generated/deleted_account/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedAccount { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_types::account::AccountId, +} +impl stripe_types::Object for DeletedAccount { + type Id = stripe_types::account::AccountId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/stripe_types/src/generated/deleted_bank_account/mod.rs b/stripe_types/src/generated/deleted_bank_account/mod.rs new file mode 100644 index 000000000..60d4f56e5 --- /dev/null +++ b/stripe_types/src/generated/deleted_bank_account/mod.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedBankAccount { + /// Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_types::bank_account::BankAccountId, +} +impl stripe_types::Object for DeletedBankAccount { + type Id = stripe_types::bank_account::BankAccountId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/stripe_types/src/generated/deleted_card/mod.rs b/stripe_types/src/generated/deleted_card/mod.rs new file mode 100644 index 000000000..e55b5a3f2 --- /dev/null +++ b/stripe_types/src/generated/deleted_card/mod.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedCard { + /// Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_types::card::CardId, +} +impl stripe_types::Object for DeletedCard { + type Id = stripe_types::card::CardId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/stripe_types/src/generated/deleted_coupon/mod.rs b/stripe_types/src/generated/deleted_coupon/mod.rs new file mode 100644 index 000000000..bd2db0b8a --- /dev/null +++ b/stripe_types/src/generated/deleted_coupon/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedCoupon { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_types::coupon::CouponId, +} +impl stripe_types::Object for DeletedCoupon { + type Id = stripe_types::coupon::CouponId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/stripe_types/src/generated/deleted_customer/mod.rs b/stripe_types/src/generated/deleted_customer/mod.rs new file mode 100644 index 000000000..7ebfa6f2b --- /dev/null +++ b/stripe_types/src/generated/deleted_customer/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedCustomer { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_types::customer::CustomerId, +} +impl stripe_types::Object for DeletedCustomer { + type Id = stripe_types::customer::CustomerId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/stripe_types/src/generated/deleted_discount/mod.rs b/stripe_types/src/generated/deleted_discount/mod.rs new file mode 100644 index 000000000..3d7664171 --- /dev/null +++ b/stripe_types/src/generated/deleted_discount/mod.rs @@ -0,0 +1,33 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedDiscount { + /// The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. + /// + /// Will not be present for subscription mode. + pub checkout_session: Option, + pub coupon: stripe_types::Coupon, + /// The ID of the customer associated with this discount. + pub customer: Option>, + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// The ID of the discount object. + /// + /// Discounts cannot be fetched by ID. + /// Use `expand[]=discounts` in API calls to expand discount IDs in an array. + pub id: stripe_types::discount::DiscountId, + /// The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice. + pub invoice: Option, + /// The invoice item `id` (or invoice line item `id` for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item. + pub invoice_item: Option, + /// The promotion code applied to create this discount. + pub promotion_code: Option>, + /// Date that the coupon was applied. + pub start: stripe_types::Timestamp, + /// The subscription that this coupon is applied to, if it is applied to a particular subscription. + pub subscription: Option, +} +impl stripe_types::Object for DeletedDiscount { + type Id = stripe_types::discount::DiscountId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/stripe_types/src/generated/deleted_external_account/mod.rs b/stripe_types/src/generated/deleted_external_account/mod.rs new file mode 100644 index 000000000..03e8b9e40 --- /dev/null +++ b/stripe_types/src/generated/deleted_external_account/mod.rs @@ -0,0 +1,18 @@ +/// The resource representing a Stripe Polymorphic. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum DeletedExternalAccount { + #[serde(rename = "bank_account")] + DeletedBankAccount(stripe_types::DeletedBankAccount), + #[serde(rename = "card")] + DeletedCard(stripe_types::DeletedCard), +} +impl stripe_types::Object for DeletedExternalAccount { + type Id = String; + fn id(&self) -> Option<&str> { + match self { + Self::DeletedBankAccount(v) => Some(v.id.as_str()), + Self::DeletedCard(v) => Some(v.id.as_str()), + } + } +} diff --git a/stripe_types/src/generated/deleted_invoice/mod.rs b/stripe_types/src/generated/deleted_invoice/mod.rs new file mode 100644 index 000000000..21e7f68bb --- /dev/null +++ b/stripe_types/src/generated/deleted_invoice/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedInvoice { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_types::invoice::InvoiceId, +} +impl stripe_types::Object for DeletedInvoice { + type Id = stripe_types::invoice::InvoiceId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/stripe_types/src/generated/deleted_invoice_item/mod.rs b/stripe_types/src/generated/deleted_invoice_item/mod.rs new file mode 100644 index 000000000..565179c24 --- /dev/null +++ b/stripe_types/src/generated/deleted_invoice_item/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedInvoiceItem { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_types::invoice_item::InvoiceitemId, +} +impl stripe_types::Object for DeletedInvoiceItem { + type Id = stripe_types::invoice_item::InvoiceitemId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/stripe_types/src/generated/deleted_payment_source/mod.rs b/stripe_types/src/generated/deleted_payment_source/mod.rs new file mode 100644 index 000000000..6506ae23a --- /dev/null +++ b/stripe_types/src/generated/deleted_payment_source/mod.rs @@ -0,0 +1,18 @@ +/// The resource representing a Stripe Polymorphic. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum DeletedPaymentSource { + #[serde(rename = "bank_account")] + DeletedBankAccount(stripe_types::DeletedBankAccount), + #[serde(rename = "card")] + DeletedCard(stripe_types::DeletedCard), +} +impl stripe_types::Object for DeletedPaymentSource { + type Id = String; + fn id(&self) -> Option<&str> { + match self { + Self::DeletedBankAccount(v) => Some(v.id.as_str()), + Self::DeletedCard(v) => Some(v.id.as_str()), + } + } +} diff --git a/stripe_types/src/generated/deleted_person/mod.rs b/stripe_types/src/generated/deleted_person/mod.rs new file mode 100644 index 000000000..260156b60 --- /dev/null +++ b/stripe_types/src/generated/deleted_person/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedPerson { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_types::person::PersonId, +} +impl stripe_types::Object for DeletedPerson { + type Id = stripe_types::person::PersonId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/stripe_types/src/generated/deleted_plan/mod.rs b/stripe_types/src/generated/deleted_plan/mod.rs new file mode 100644 index 000000000..b20300349 --- /dev/null +++ b/stripe_types/src/generated/deleted_plan/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedPlan { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_types::plan::PlanId, +} +impl stripe_types::Object for DeletedPlan { + type Id = stripe_types::plan::PlanId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/stripe_types/src/generated/deleted_product/mod.rs b/stripe_types/src/generated/deleted_product/mod.rs new file mode 100644 index 000000000..eeff62f22 --- /dev/null +++ b/stripe_types/src/generated/deleted_product/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedProduct { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_types::product::ProductId, +} +impl stripe_types::Object for DeletedProduct { + type Id = stripe_types::product::ProductId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/stripe_types/src/generated/deleted_subscription_item/mod.rs b/stripe_types/src/generated/deleted_subscription_item/mod.rs new file mode 100644 index 000000000..7d4288bf9 --- /dev/null +++ b/stripe_types/src/generated/deleted_subscription_item/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedSubscriptionItem { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_types::subscription_item::SubscriptionItemId, +} +impl stripe_types::Object for DeletedSubscriptionItem { + type Id = stripe_types::subscription_item::SubscriptionItemId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/stripe_types/src/generated/deleted_tax_id/mod.rs b/stripe_types/src/generated/deleted_tax_id/mod.rs new file mode 100644 index 000000000..79216757a --- /dev/null +++ b/stripe_types/src/generated/deleted_tax_id/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedTaxId { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_types::tax_id::TaxIdId, +} +impl stripe_types::Object for DeletedTaxId { + type Id = stripe_types::tax_id::TaxIdId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/stripe_types/src/generated/deleted_test_clock/mod.rs b/stripe_types/src/generated/deleted_test_clock/mod.rs new file mode 100644 index 000000000..6dab662b3 --- /dev/null +++ b/stripe_types/src/generated/deleted_test_clock/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedTestClock { + /// Always true for a deleted object. + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_types::test_clock::TestHelpersTestClockId, +} +impl stripe_types::Object for DeletedTestClock { + type Id = stripe_types::test_clock::TestHelpersTestClockId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} diff --git a/stripe_types/src/generated/discount/mod.rs b/stripe_types/src/generated/discount/mod.rs new file mode 100644 index 000000000..a5e6920ea --- /dev/null +++ b/stripe_types/src/generated/discount/mod.rs @@ -0,0 +1,42 @@ +/// A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). +/// It contains information about when the discount began, when it will end, and what it is applied to. +/// +/// Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Discount { + /// The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. + /// + /// Will not be present for subscription mode. + pub checkout_session: Option, + pub coupon: stripe_types::Coupon, + /// The ID of the customer associated with this discount. + pub customer: Option>, + /// If the coupon has a duration of `repeating`, the date that this discount will end. + /// + /// If the coupon has a duration of `once` or `forever`, this attribute will be null. + pub end: Option, + /// The ID of the discount object. + /// + /// Discounts cannot be fetched by ID. + /// Use `expand[]=discounts` in API calls to expand discount IDs in an array. + pub id: stripe_types::discount::DiscountId, + /// The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice. + pub invoice: Option, + /// The invoice item `id` (or invoice line item `id` for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item. + pub invoice_item: Option, + /// The promotion code applied to create this discount. + pub promotion_code: Option>, + /// Date that the coupon was applied. + pub start: stripe_types::Timestamp, + /// The subscription that this coupon is applied to, if it is applied to a particular subscription. + pub subscription: Option, +} +impl stripe_types::Object for Discount { + type Id = stripe_types::discount::DiscountId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(DiscountId, "di_"); diff --git a/stripe_types/src/generated/discounts_resource_discount_amount/mod.rs b/stripe_types/src/generated/discounts_resource_discount_amount/mod.rs new file mode 100644 index 000000000..d7d8387c1 --- /dev/null +++ b/stripe_types/src/generated/discounts_resource_discount_amount/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DiscountsResourceDiscountAmount { + /// The amount, in cents (or local equivalent), of the discount. + pub amount: i64, + /// The discount that was applied to get this discount amount. + pub discount: stripe_types::Expandable, +} diff --git a/stripe_types/src/generated/dispute/mod.rs b/stripe_types/src/generated/dispute/mod.rs new file mode 100644 index 000000000..eea900289 --- /dev/null +++ b/stripe_types/src/generated/dispute/mod.rs @@ -0,0 +1,138 @@ +/// A dispute occurs when a customer questions your charge with their card issuer. +/// When this happens, you have the opportunity to respond to the dispute with +/// evidence that shows that the charge is legitimate. +/// +/// Related guide: [Disputes and fraud](https://stripe.com/docs/disputes) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Dispute { + /// Disputed amount. + /// + /// Usually the amount of the charge, but it can differ (usually because of currency fluctuation or because only part of the order is disputed). + pub amount: i64, + /// List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute. + pub balance_transactions: Vec, + /// ID of the charge that's disputed. + pub charge: stripe_types::Expandable, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + pub evidence: stripe_types::DisputeEvidence, + pub evidence_details: stripe_types::DisputeEvidenceDetails, + /// Unique identifier for the object. + pub id: stripe_types::dispute::DisputeId, + /// If true, it's still possible to refund the disputed payment. + /// + /// After the payment has been fully refunded, no further funds are withdrawn from your Stripe account as a result of this dispute. + pub is_charge_refundable: bool, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Network-dependent reason code for the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub network_reason_code: Option, + /// ID of the PaymentIntent that's disputed. + pub payment_intent: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_details: Option, + /// Reason given by cardholder for dispute. + /// + /// Possible values are `bank_cannot_process`, `check_returned`, `credit_not_processed`, `customer_initiated`, `debit_not_authorized`, `duplicate`, `fraudulent`, `general`, `incorrect_account_details`, `insufficient_funds`, `product_not_received`, `product_unacceptable`, `subscription_canceled`, or `unrecognized`. + /// Learn more about [dispute reasons](https://stripe.com/docs/disputes/categories). + pub reason: String, + /// Current status of dispute. + /// + /// Possible values are `warning_needs_response`, `warning_under_review`, `warning_closed`, `needs_response`, `under_review`, `won`, or `lost`. + pub status: DisputeStatus, +} +/// Current status of dispute. +/// +/// Possible values are `warning_needs_response`, `warning_under_review`, `warning_closed`, `needs_response`, `under_review`, `won`, or `lost`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum DisputeStatus { + Lost, + NeedsResponse, + UnderReview, + WarningClosed, + WarningNeedsResponse, + WarningUnderReview, + Won, +} +impl DisputeStatus { + pub fn as_str(self) -> &'static str { + use DisputeStatus::*; + match self { + Lost => "lost", + NeedsResponse => "needs_response", + UnderReview => "under_review", + WarningClosed => "warning_closed", + WarningNeedsResponse => "warning_needs_response", + WarningUnderReview => "warning_under_review", + Won => "won", + } + } +} + +impl std::str::FromStr for DisputeStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use DisputeStatus::*; + match s { + "lost" => Ok(Lost), + "needs_response" => Ok(NeedsResponse), + "under_review" => Ok(UnderReview), + "warning_closed" => Ok(WarningClosed), + "warning_needs_response" => Ok(WarningNeedsResponse), + "warning_under_review" => Ok(WarningUnderReview), + "won" => Ok(Won), + _ => Err(()), + } + } +} +impl AsRef for DisputeStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for DisputeStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for DisputeStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for DisputeStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for DisputeStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for DisputeStatus")) + } +} +impl stripe_types::Object for Dispute { + type Id = stripe_types::dispute::DisputeId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(DisputeId, "dp_" | "du_"); diff --git a/stripe_types/src/generated/dispute_evidence/mod.rs b/stripe_types/src/generated/dispute_evidence/mod.rs new file mode 100644 index 000000000..15744fea3 --- /dev/null +++ b/stripe_types/src/generated/dispute_evidence/mod.rs @@ -0,0 +1,75 @@ +/// For more details see <>. +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct DisputeEvidence { + /// Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. + /// + /// This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. + pub access_activity_log: Option, + /// The billing address provided by the customer. + pub billing_address: Option, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your subscription cancellation policy, as shown to the customer. + pub cancellation_policy: Option>, + /// An explanation of how and when the customer was shown your refund policy prior to purchase. + pub cancellation_policy_disclosure: Option, + /// A justification for why the customer's subscription was not canceled. + pub cancellation_rebuttal: Option, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any communication with the customer that you feel is relevant to your case. + /// + /// Examples include emails proving that the customer received the product or service, or demonstrating their use of or satisfaction with the product or service. + pub customer_communication: Option>, + /// The email address of the customer. + pub customer_email_address: Option, + /// The name of the customer. + pub customer_name: Option, + /// The IP address that the customer used when making the purchase. + pub customer_purchase_ip: Option, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A relevant document or contract showing the customer's signature. + pub customer_signature: Option>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation for the prior charge that can uniquely identify the charge, such as a receipt, shipping label, work order, etc. + /// + /// This document should be paired with a similar document from the disputed payment that proves the two payments are separate. + pub duplicate_charge_documentation: Option>, + /// An explanation of the difference between the disputed charge versus the prior charge that appears to be a duplicate. + pub duplicate_charge_explanation: Option, + /// The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. + pub duplicate_charge_id: Option, + /// A description of the product or service that was sold. + pub product_description: Option, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any receipt or message sent to the customer notifying them of the charge. + pub receipt: Option>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your refund policy, as shown to the customer. + pub refund_policy: Option>, + /// Documentation demonstrating that the customer was shown your refund policy prior to purchase. + pub refund_policy_disclosure: Option, + /// A justification for why the customer is not entitled to a refund. + pub refund_refusal_explanation: Option, + /// The date on which the customer received or began receiving the purchased service, in a clear human-readable format. + pub service_date: Option, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a service was provided to the customer. + /// + /// This could include a copy of a signed contract, work order, or other form of written agreement. + pub service_documentation: Option>, + /// The address to which a physical product was shipped. + /// + /// You should try to include as complete address information as possible. + pub shipping_address: Option, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + /// + /// If multiple carriers were used for this purchase, please separate them with commas. + pub shipping_carrier: Option, + /// The date on which a physical product began its route to the shipping address, in a clear human-readable format. + pub shipping_date: Option, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a product was shipped to the customer at the same address the customer provided to you. + /// + /// This could include a copy of the shipment receipt, shipping label, etc. + /// It should show the customer's full shipping address, if possible. + pub shipping_documentation: Option>, + /// The tracking number for a physical product, obtained from the delivery service. + /// + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + pub shipping_tracking_number: Option, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any additional evidence or statements. + pub uncategorized_file: Option>, + /// Any additional evidence or statements. + pub uncategorized_text: Option, +} diff --git a/stripe_types/src/generated/dispute_evidence_details/mod.rs b/stripe_types/src/generated/dispute_evidence_details/mod.rs new file mode 100644 index 000000000..5f829bfd9 --- /dev/null +++ b/stripe_types/src/generated/dispute_evidence_details/mod.rs @@ -0,0 +1,18 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DisputeEvidenceDetails { + /// Date by which evidence must be submitted in order to successfully challenge dispute. + /// + /// Will be 0 if the customer's bank or credit card company doesn't allow a response for this particular dispute. + pub due_by: Option, + /// Whether evidence has been staged for this dispute. + pub has_evidence: bool, + /// Whether the last evidence submission was submitted past the due date. + /// + /// Defaults to `false` if no evidence submissions have occurred. + /// If `true`, then delivery of the latest evidence is *not* guaranteed. + pub past_due: bool, + /// The number of times evidence has been submitted. + /// + /// Typically, you may only submit evidence once. + pub submission_count: u64, +} diff --git a/stripe_types/src/generated/dispute_payment_method_details/mod.rs b/stripe_types/src/generated/dispute_payment_method_details/mod.rs new file mode 100644 index 000000000..7b89a8d4b --- /dev/null +++ b/stripe_types/src/generated/dispute_payment_method_details/mod.rs @@ -0,0 +1,65 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DisputePaymentMethodDetails { + /// Card specific dispute details. + pub card: Option, + /// Payment method type. + #[serde(rename = "type")] + pub type_: DisputePaymentMethodDetailsType, +} +/// Payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum DisputePaymentMethodDetailsType { + Card, +} +impl DisputePaymentMethodDetailsType { + pub fn as_str(self) -> &'static str { + use DisputePaymentMethodDetailsType::*; + match self { + Card => "card", + } + } +} + +impl std::str::FromStr for DisputePaymentMethodDetailsType { + type Err = (); + fn from_str(s: &str) -> Result { + use DisputePaymentMethodDetailsType::*; + match s { + "card" => Ok(Card), + _ => Err(()), + } + } +} +impl AsRef for DisputePaymentMethodDetailsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for DisputePaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for DisputePaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for DisputePaymentMethodDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for DisputePaymentMethodDetailsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for DisputePaymentMethodDetailsType") + }) + } +} diff --git a/stripe_types/src/generated/dispute_payment_method_details_card/mod.rs b/stripe_types/src/generated/dispute_payment_method_details_card/mod.rs new file mode 100644 index 000000000..db093a179 --- /dev/null +++ b/stripe_types/src/generated/dispute_payment_method_details_card/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DisputePaymentMethodDetailsCard { + /// Card brand. + /// + /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub brand: String, + /// The card network's specific dispute reason code, which maps to one of Stripe's primary dispute categories to simplify response guidance. + /// + /// The [Network code map](https://stripe.com/docs/disputes/categories#network-code-map) lists all available dispute reason codes by network. + pub network_reason_code: Option, +} diff --git a/stripe_types/src/generated/email_sent/mod.rs b/stripe_types/src/generated/email_sent/mod.rs new file mode 100644 index 000000000..da23740ac --- /dev/null +++ b/stripe_types/src/generated/email_sent/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct EmailSent { + /// The timestamp when the email was sent. + pub email_sent_at: stripe_types::Timestamp, + /// The recipient's email address. + pub email_sent_to: String, +} diff --git a/stripe_types/src/generated/error/mod.rs b/stripe_types/src/generated/error/mod.rs new file mode 100644 index 000000000..4466fba6f --- /dev/null +++ b/stripe_types/src/generated/error/mod.rs @@ -0,0 +1,5 @@ +/// An error response from the Stripe API. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Error { + pub error: Box, +} diff --git a/stripe_types/src/generated/external_account/mod.rs b/stripe_types/src/generated/external_account/mod.rs new file mode 100644 index 000000000..43166cda3 --- /dev/null +++ b/stripe_types/src/generated/external_account/mod.rs @@ -0,0 +1,18 @@ +/// The resource representing a Stripe Polymorphic. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum ExternalAccount { + #[serde(rename = "bank_account")] + BankAccount(stripe_types::BankAccount), + #[serde(rename = "card")] + Card(stripe_types::Card), +} +impl stripe_types::Object for ExternalAccount { + type Id = String; + fn id(&self) -> Option<&str> { + match self { + Self::BankAccount(v) => Some(v.id.as_str()), + Self::Card(v) => Some(v.id.as_str()), + } + } +} diff --git a/stripe_types/src/generated/external_account_requirements/mod.rs b/stripe_types/src/generated/external_account_requirements/mod.rs new file mode 100644 index 000000000..a1ec1b752 --- /dev/null +++ b/stripe_types/src/generated/external_account_requirements/mod.rs @@ -0,0 +1,18 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct ExternalAccountRequirements { + /// Fields that need to be collected to keep the external account enabled. + /// + /// If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. + pub currently_due: Option>, + /// Fields that are `currently_due` and need to be collected again because validation or verification failed. + pub errors: Option>, + /// Fields that weren't collected by `current_deadline`. + /// + /// These fields need to be collected to enable the external account. + pub past_due: Option>, + /// Fields that may become required depending on the results of verification or review. + /// + /// Will be an empty array unless an asynchronous verification is pending. + /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + pub pending_verification: Option>, +} diff --git a/stripe_types/src/generated/fee/mod.rs b/stripe_types/src/generated/fee/mod.rs new file mode 100644 index 000000000..f76db4f14 --- /dev/null +++ b/stripe_types/src/generated/fee/mod.rs @@ -0,0 +1,18 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Fee { + /// Amount of the fee, in cents. + pub amount: i64, + /// ID of the Connect application that earned the fee. + pub application: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// Type of the fee, one of: `application_fee`, `stripe_fee` or `tax`. + #[serde(rename = "type")] + pub type_: String, +} diff --git a/stripe_types/src/generated/fee_refund/mod.rs b/stripe_types/src/generated/fee_refund/mod.rs new file mode 100644 index 000000000..dca9f9a59 --- /dev/null +++ b/stripe_types/src/generated/fee_refund/mod.rs @@ -0,0 +1,34 @@ +/// `Application Fee Refund` objects allow you to refund an application fee that +/// has previously been created but not yet refunded. +/// +/// Funds will be refunded to the Stripe account from which the fee was originally collected. Related guide: [Refunding application fees](https://stripe.com/docs/connect/destination-charges#refunding-app-fee) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FeeRefund { + /// Amount, in cents (or local equivalent). + pub amount: i64, + /// Balance transaction that describes the impact on your account balance. + pub balance_transaction: Option>, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the application fee that was refunded. + pub fee: stripe_types::Expandable, + /// Unique identifier for the object. + pub id: stripe_types::fee_refund::FeeRefundId, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, +} +impl stripe_types::Object for FeeRefund { + type Id = stripe_types::fee_refund::FeeRefundId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(FeeRefundId); diff --git a/stripe_types/src/generated/file/mod.rs b/stripe_types/src/generated/file/mod.rs new file mode 100644 index 000000000..3fa2e03a3 --- /dev/null +++ b/stripe_types/src/generated/file/mod.rs @@ -0,0 +1,139 @@ +/// This object represents files hosted on Stripe's servers. +/// +/// You can upload files with the [create file](https://stripe.com/docs/api#create_file) request (for example, when uploading dispute evidence). +/// Stripe also creates files independetly (for example, the results of a [Sigma scheduled query](#scheduled_queries)). Related guide: [File upload guide](https://stripe.com/docs/file-upload) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct File { + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The file expires and isn't available at this time in epoch seconds. + pub expires_at: Option, + /// The suitable name for saving the file to a filesystem. + pub filename: Option, + /// Unique identifier for the object. + pub id: stripe_types::file::FileId, + /// A list of [file links](https://stripe.com/docs/api#file_links) that point at this file. + #[serde(default)] + pub links: stripe_types::List, + /// The [purpose](https://stripe.com/docs/file-upload#uploading-a-file) of the uploaded file. + pub purpose: FilePurpose, + /// The size of the file object in bytes. + pub size: u64, + /// A suitable title for the document. + pub title: Option, + /// The returned file type (for example, `csv`, `pdf`, `jpg`, or `png`). + #[serde(rename = "type")] + pub type_: Option, + /// Use your live secret API key to download the file from this URL. + pub url: Option, +} +/// The [purpose](https://stripe.com/docs/file-upload#uploading-a-file) of the uploaded file. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum FilePurpose { + AccountRequirement, + AdditionalVerification, + BusinessIcon, + BusinessLogo, + CustomerSignature, + DisputeEvidence, + DocumentProviderIdentityDocument, + FinanceReportRun, + IdentityDocument, + IdentityDocumentDownloadable, + PciDocument, + Selfie, + SigmaScheduledQuery, + TaxDocumentUserUpload, + TerminalReaderSplashscreen, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl FilePurpose { + pub fn as_str(self) -> &'static str { + use FilePurpose::*; + match self { + AccountRequirement => "account_requirement", + AdditionalVerification => "additional_verification", + BusinessIcon => "business_icon", + BusinessLogo => "business_logo", + CustomerSignature => "customer_signature", + DisputeEvidence => "dispute_evidence", + DocumentProviderIdentityDocument => "document_provider_identity_document", + FinanceReportRun => "finance_report_run", + IdentityDocument => "identity_document", + IdentityDocumentDownloadable => "identity_document_downloadable", + PciDocument => "pci_document", + Selfie => "selfie", + SigmaScheduledQuery => "sigma_scheduled_query", + TaxDocumentUserUpload => "tax_document_user_upload", + TerminalReaderSplashscreen => "terminal_reader_splashscreen", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for FilePurpose { + type Err = (); + fn from_str(s: &str) -> Result { + use FilePurpose::*; + match s { + "account_requirement" => Ok(AccountRequirement), + "additional_verification" => Ok(AdditionalVerification), + "business_icon" => Ok(BusinessIcon), + "business_logo" => Ok(BusinessLogo), + "customer_signature" => Ok(CustomerSignature), + "dispute_evidence" => Ok(DisputeEvidence), + "document_provider_identity_document" => Ok(DocumentProviderIdentityDocument), + "finance_report_run" => Ok(FinanceReportRun), + "identity_document" => Ok(IdentityDocument), + "identity_document_downloadable" => Ok(IdentityDocumentDownloadable), + "pci_document" => Ok(PciDocument), + "selfie" => Ok(Selfie), + "sigma_scheduled_query" => Ok(SigmaScheduledQuery), + "tax_document_user_upload" => Ok(TaxDocumentUserUpload), + "terminal_reader_splashscreen" => Ok(TerminalReaderSplashscreen), + _ => Err(()), + } + } +} +impl AsRef for FilePurpose { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for FilePurpose { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FilePurpose { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FilePurpose { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for FilePurpose { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(FilePurpose::Unknown)) + } +} +impl stripe_types::Object for File { + type Id = stripe_types::file::FileId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(FileId, "file_"); diff --git a/stripe_types/src/generated/file_link/mod.rs b/stripe_types/src/generated/file_link/mod.rs new file mode 100644 index 000000000..116f0f84a --- /dev/null +++ b/stripe_types/src/generated/file_link/mod.rs @@ -0,0 +1,34 @@ +/// To share the contents of a `File` object with non-Stripe users, you can +/// create a `FileLink`. +/// +/// `FileLink`s contain a URL that you can use to retrieve the contents of the file without authentication. For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FileLink { + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Returns if the link is already expired. + pub expired: bool, + /// Time that the link expires. + pub expires_at: Option, + /// The file object this link points to. + pub file: stripe_types::Expandable, + /// Unique identifier for the object. + pub id: stripe_types::file_link::FileLinkId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The publicly accessible URL to download the file. + pub url: Option, +} +impl stripe_types::Object for FileLink { + type Id = stripe_types::file_link::FileLinkId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(FileLinkId, "link_"); diff --git a/stripe_types/src/generated/funding_instructions_bank_transfer/mod.rs b/stripe_types/src/generated/funding_instructions_bank_transfer/mod.rs new file mode 100644 index 000000000..04e51217f --- /dev/null +++ b/stripe_types/src/generated/funding_instructions_bank_transfer/mod.rs @@ -0,0 +1,70 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FundingInstructionsBankTransfer { + /// The country of the bank account to fund. + pub country: String, + /// A list of financial addresses that can be used to fund a particular balance. + pub financial_addresses: Vec, + /// The bank_transfer type. + #[serde(rename = "type")] + pub type_: FundingInstructionsBankTransferType, +} +/// The bank_transfer type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FundingInstructionsBankTransferType { + EuBankTransfer, + JpBankTransfer, +} +impl FundingInstructionsBankTransferType { + pub fn as_str(self) -> &'static str { + use FundingInstructionsBankTransferType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + } + } +} + +impl std::str::FromStr for FundingInstructionsBankTransferType { + type Err = (); + fn from_str(s: &str) -> Result { + use FundingInstructionsBankTransferType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + _ => Err(()), + } + } +} +impl AsRef for FundingInstructionsBankTransferType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for FundingInstructionsBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FundingInstructionsBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FundingInstructionsBankTransferType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for FundingInstructionsBankTransferType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for FundingInstructionsBankTransferType") + }) + } +} diff --git a/stripe_types/src/generated/funding_instructions_bank_transfer_aba_record/mod.rs b/stripe_types/src/generated/funding_instructions_bank_transfer_aba_record/mod.rs new file mode 100644 index 000000000..d7c2dbd61 --- /dev/null +++ b/stripe_types/src/generated/funding_instructions_bank_transfer_aba_record/mod.rs @@ -0,0 +1,12 @@ +/// ABA Records contain U.S. +/// +/// bank account details per the ABA format. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FundingInstructionsBankTransferAbaRecord { + /// The ABA account number. + pub account_number: String, + /// The bank name. + pub bank_name: String, + /// The ABA routing number. + pub routing_number: String, +} diff --git a/stripe_types/src/generated/funding_instructions_bank_transfer_financial_address/mod.rs b/stripe_types/src/generated/funding_instructions_bank_transfer_financial_address/mod.rs new file mode 100644 index 000000000..9868f2b71 --- /dev/null +++ b/stripe_types/src/generated/funding_instructions_bank_transfer_financial_address/mod.rs @@ -0,0 +1,175 @@ +/// FinancialAddresses contain identifying information that resolves to a FinancialAccount. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FundingInstructionsBankTransferFinancialAddress { + #[serde(skip_serializing_if = "Option::is_none")] + pub aba: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub iban: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sort_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub spei: Option, + /// The payment networks supported by this FinancialAddress. + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_networks: + Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub swift: Option, + /// The type of financial address. + #[serde(rename = "type")] + pub type_: FundingInstructionsBankTransferFinancialAddressType, + #[serde(skip_serializing_if = "Option::is_none")] + pub zengin: Option, +} +/// The payment networks supported by this FinancialAddress. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FundingInstructionsBankTransferFinancialAddressSupportedNetworks { + Ach, + Bacs, + DomesticWireUs, + Fps, + Sepa, + Spei, + Swift, + Zengin, +} +impl FundingInstructionsBankTransferFinancialAddressSupportedNetworks { + pub fn as_str(self) -> &'static str { + use FundingInstructionsBankTransferFinancialAddressSupportedNetworks::*; + match self { + Ach => "ach", + Bacs => "bacs", + DomesticWireUs => "domestic_wire_us", + Fps => "fps", + Sepa => "sepa", + Spei => "spei", + Swift => "swift", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { + type Err = (); + fn from_str(s: &str) -> Result { + use FundingInstructionsBankTransferFinancialAddressSupportedNetworks::*; + match s { + "ach" => Ok(Ach), + "bacs" => Ok(Bacs), + "domestic_wire_us" => Ok(DomesticWireUs), + "fps" => Ok(Fps), + "sepa" => Ok(Sepa), + "spei" => Ok(Spei), + "swift" => Ok(Swift), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl AsRef for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for FundingInstructionsBankTransferFinancialAddressSupportedNetworks +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for FundingInstructionsBankTransferFinancialAddressSupportedNetworks")) + } +} +/// The type of financial address. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FundingInstructionsBankTransferFinancialAddressType { + Aba, + Iban, + SortCode, + Spei, + Swift, + Zengin, +} +impl FundingInstructionsBankTransferFinancialAddressType { + pub fn as_str(self) -> &'static str { + use FundingInstructionsBankTransferFinancialAddressType::*; + match self { + Aba => "aba", + Iban => "iban", + SortCode => "sort_code", + Spei => "spei", + Swift => "swift", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr for FundingInstructionsBankTransferFinancialAddressType { + type Err = (); + fn from_str(s: &str) -> Result { + use FundingInstructionsBankTransferFinancialAddressType::*; + match s { + "aba" => Ok(Aba), + "iban" => Ok(Iban), + "sort_code" => Ok(SortCode), + "spei" => Ok(Spei), + "swift" => Ok(Swift), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl AsRef for FundingInstructionsBankTransferFinancialAddressType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for FundingInstructionsBankTransferFinancialAddressType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FundingInstructionsBankTransferFinancialAddressType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FundingInstructionsBankTransferFinancialAddressType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for FundingInstructionsBankTransferFinancialAddressType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for FundingInstructionsBankTransferFinancialAddressType", + ) + }) + } +} diff --git a/stripe_types/src/generated/funding_instructions_bank_transfer_iban_record/mod.rs b/stripe_types/src/generated/funding_instructions_bank_transfer_iban_record/mod.rs new file mode 100644 index 000000000..a99bf99ed --- /dev/null +++ b/stripe_types/src/generated/funding_instructions_bank_transfer_iban_record/mod.rs @@ -0,0 +1,14 @@ +/// Iban Records contain E.U. +/// +/// bank account details per the SEPA format. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FundingInstructionsBankTransferIbanRecord { + /// The name of the person or business that owns the bank account. + pub account_holder_name: String, + /// The BIC/SWIFT code of the account. + pub bic: String, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: String, + /// The IBAN of the account. + pub iban: String, +} diff --git a/stripe_types/src/generated/funding_instructions_bank_transfer_sort_code_record/mod.rs b/stripe_types/src/generated/funding_instructions_bank_transfer_sort_code_record/mod.rs new file mode 100644 index 000000000..8c31e9934 --- /dev/null +++ b/stripe_types/src/generated/funding_instructions_bank_transfer_sort_code_record/mod.rs @@ -0,0 +1,12 @@ +/// Sort Code Records contain U.K. +/// +/// bank account details per the sort code format. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FundingInstructionsBankTransferSortCodeRecord { + /// The name of the person or business that owns the bank account. + pub account_holder_name: String, + /// The account number. + pub account_number: String, + /// The six-digit sort code. + pub sort_code: String, +} diff --git a/stripe_types/src/generated/funding_instructions_bank_transfer_spei_record/mod.rs b/stripe_types/src/generated/funding_instructions_bank_transfer_spei_record/mod.rs new file mode 100644 index 000000000..b2d401a13 --- /dev/null +++ b/stripe_types/src/generated/funding_instructions_bank_transfer_spei_record/mod.rs @@ -0,0 +1,10 @@ +/// SPEI Records contain Mexico bank account details per the SPEI format. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FundingInstructionsBankTransferSpeiRecord { + /// The three-digit bank code. + pub bank_code: String, + /// The short banking institution name. + pub bank_name: String, + /// The CLABE number. + pub clabe: String, +} diff --git a/stripe_types/src/generated/funding_instructions_bank_transfer_swift_record/mod.rs b/stripe_types/src/generated/funding_instructions_bank_transfer_swift_record/mod.rs new file mode 100644 index 000000000..f97db6412 --- /dev/null +++ b/stripe_types/src/generated/funding_instructions_bank_transfer_swift_record/mod.rs @@ -0,0 +1,12 @@ +/// SWIFT Records contain U.S. +/// +/// bank account details per the SWIFT format. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FundingInstructionsBankTransferSwiftRecord { + /// The account number. + pub account_number: String, + /// The bank name. + pub bank_name: String, + /// The SWIFT code. + pub swift_code: String, +} diff --git a/stripe_types/src/generated/funding_instructions_bank_transfer_zengin_record/mod.rs b/stripe_types/src/generated/funding_instructions_bank_transfer_zengin_record/mod.rs new file mode 100644 index 000000000..3e6357d95 --- /dev/null +++ b/stripe_types/src/generated/funding_instructions_bank_transfer_zengin_record/mod.rs @@ -0,0 +1,20 @@ +/// Zengin Records contain Japan bank account details per the Zengin format. +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct FundingInstructionsBankTransferZenginRecord { + /// The account holder name. + pub account_holder_name: Option, + /// The account number. + pub account_number: Option, + /// The bank account type. + /// + /// In Japan, this can only be `futsu` or `toza`. + pub account_type: Option, + /// The bank code of the account. + pub bank_code: Option, + /// The bank name of the account. + pub bank_name: Option, + /// The branch code of the account. + pub branch_code: Option, + /// The branch name of the account. + pub branch_name: Option, +} diff --git a/stripe_types/src/generated/invoice/mod.rs b/stripe_types/src/generated/invoice/mod.rs new file mode 100644 index 000000000..457dfeb02 --- /dev/null +++ b/stripe_types/src/generated/invoice/mod.rs @@ -0,0 +1,586 @@ +/// Invoices are statements of amounts owed by a customer, and are either +/// generated one-off, or generated periodically from a subscription. +/// +/// They contain [invoice items](https://stripe.com/docs/api#invoiceitems), and proration adjustments +/// that may be caused by subscription upgrades/downgrades (if necessary). +/// +/// If your invoice is configured to be billed through automatic charges, +/// Stripe automatically finalizes your invoice and attempts payment. +/// +/// Note that finalizing the invoice, [when automatic](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection), does not happen immediately as the invoice is created. +/// Stripe waits until one hour after the last webhook was successfully sent (or the last webhook timed out after failing). +/// If you (and the platforms you may have connected to) have no webhooks configured, Stripe waits one hour after creation to finalize the invoice. If your invoice is configured to be billed by sending an email, then based on your [email settings](https://dashboard.stripe.com/account/billing/automatic), Stripe will email the invoice to your customer and await payment. +/// These emails can contain a link to a hosted page to pay the invoice. Stripe applies any customer credit on the account before determining the amount due for the invoice (i.e., the amount that will be actually charged). +/// If the amount due for the invoice is less than Stripe's [minimum allowed charge per currency](/docs/currencies#minimum-and-maximum-charge-amounts), the invoice is automatically marked paid, and we add the amount due to the customer's credit balance which is applied to the next invoice. More details on the customer's credit balance are [here](https://stripe.com/docs/billing/customer/balance). Related guide: [Send invoices to customers](https://stripe.com/docs/billing/invoices/sending) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Invoice { + /// The country of the business associated with this invoice, most often the business creating the invoice. + pub account_country: Option, + /// The public name of the business associated with this invoice, most often the business creating the invoice. + pub account_name: Option, + /// The account tax IDs associated with the invoice. + /// + /// Only editable when the invoice is a draft. + pub account_tax_ids: Option>>, + /// Final amount due at this time for this invoice. + /// + /// If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. + /// If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. + /// The charge that gets generated for the invoice will be for the amount specified in `amount_due`. + pub amount_due: i64, + /// The amount, in cents (or local equivalent), that was paid. + pub amount_paid: i64, + /// The difference between amount_due and amount_paid, in cents (or local equivalent). + pub amount_remaining: i64, + /// This is the sum of all the shipping amounts. + pub amount_shipping: i64, + /// ID of the Connect Application that created the invoice. + pub application: Option>, + /// The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. + pub application_fee_amount: Option, + /// Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. + /// + /// Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. + /// In other words, manual payment attempts after the first attempt do not affect the retry schedule. + pub attempt_count: u64, + /// Whether an attempt has been made to pay the invoice. + /// + /// An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users. + pub attempted: bool, + /// Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. + /// + /// If `false`, the invoice's state doesn't automatically advance without an explicit action. + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_advance: Option, + pub automatic_tax: stripe_types::AutomaticTax, + /// Indicates the reason why the invoice was created. + /// + /// * `manual`: Unrelated to a subscription, for example, created via the invoice editor. + /// * `subscription`: No longer in use. + /// + /// Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. * `subscription_create`: A new subscription was created. * `subscription_cycle`: A subscription advanced into a new period. * `subscription_threshold`: A subscription reached a billing threshold. * `subscription_update`: A subscription was updated. * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint. + pub billing_reason: Option, + /// ID of the latest charge generated for this invoice, if any. + pub charge: Option>, + /// Either `charge_automatically`, or `send_invoice`. + /// + /// When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. + /// When sending an invoice, Stripe will email this invoice to the customer with payment instructions. + pub collection_method: InvoiceCollectionMethod, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Custom fields displayed on the invoice. + pub custom_fields: Option>, + /// The ID of the customer who will be billed. + pub customer: Option>, + /// The customer's address. + /// + /// Until the invoice is finalized, this field will equal `customer.address`. + /// Once the invoice is finalized, this field will no longer be updated. + pub customer_address: Option, + /// The customer's email. + /// + /// Until the invoice is finalized, this field will equal `customer.email`. + /// Once the invoice is finalized, this field will no longer be updated. + pub customer_email: Option, + /// The customer's name. + /// + /// Until the invoice is finalized, this field will equal `customer.name`. + /// Once the invoice is finalized, this field will no longer be updated. + pub customer_name: Option, + /// The customer's phone number. + /// + /// Until the invoice is finalized, this field will equal `customer.phone`. + /// Once the invoice is finalized, this field will no longer be updated. + pub customer_phone: Option, + /// The customer's shipping information. + /// + /// Until the invoice is finalized, this field will equal `customer.shipping`. + /// Once the invoice is finalized, this field will no longer be updated. + pub customer_shipping: Option, + /// The customer's tax exempt status. + /// + /// Until the invoice is finalized, this field will equal `customer.tax_exempt`. + /// Once the invoice is finalized, this field will no longer be updated. + pub customer_tax_exempt: Option, + /// The customer's tax IDs. + /// + /// Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. + /// Once the invoice is finalized, this field will no longer be updated. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_tax_ids: Option>, + /// ID of the default payment method for the invoice. + /// + /// It must belong to the customer associated with the invoice. + /// If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + pub default_payment_method: Option>, + /// ID of the default payment source for the invoice. + /// + /// It must belong to the customer associated with the invoice and be in a chargeable state. + /// If not set, defaults to the subscription's default source, if any, or to the customer's default source. + pub default_source: Option>, + /// The tax rates applied to this invoice, if any. + pub default_tax_rates: Vec, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + /// Referenced as 'memo' in the Dashboard. + pub description: Option, + /// Describes the current discount applied to this invoice, if there is one. + /// + /// Not populated if there are multiple discounts. + pub discount: Option, + /// The discounts applied to the invoice. + /// + /// Line item discounts are applied before invoice discounts. + /// Use `expand[]=discounts` to expand each discount. + pub discounts: Option>>, + /// The date on which payment for this invoice is due. + /// + /// This value will be `null` for invoices where `collection_method=charge_automatically`. + pub due_date: Option, + /// The date when this invoice is in effect. + /// + /// Same as `finalized_at` unless overwritten. + /// When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. + pub effective_at: Option, + /// Ending customer balance after the invoice is finalized. + /// + /// Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. + /// If the invoice has not been finalized yet, this will be null. + pub ending_balance: Option, + /// Footer displayed on the invoice. + pub footer: Option, + /// Details of the invoice that was cloned. + /// + /// See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. + pub from_invoice: Option, + /// The URL for the hosted invoice page, which allows customers to view and pay an invoice. + /// + /// If the invoice has not been finalized yet, this will be null. + #[serde(skip_serializing_if = "Option::is_none")] + pub hosted_invoice_url: Option, + /// Unique identifier for the object. + /// + /// This property is always present unless the invoice is an upcoming invoice. + /// See [Retrieve an upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + /// The link to download the PDF for the invoice. + /// + /// If the invoice has not been finalized yet, this will be null. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_pdf: Option, + /// The error encountered during the previous attempt to finalize the invoice. + /// + /// This field is cleared when the invoice is successfully finalized. + pub last_finalization_error: Option>, + /// The ID of the most recent non-draft revision of this invoice. + pub latest_revision: Option>, + /// The individual line items that make up the invoice. + /// + /// `lines` is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order. + pub lines: stripe_types::List, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// The time at which payment will next be attempted. + /// + /// This value will be `null` for invoices where `collection_method=send_invoice`. + pub next_payment_attempt: Option, + /// A unique, identifying string that appears on emails sent to the customer for this invoice. + /// + /// This starts with the customer's unique invoice_prefix if it is specified. + pub number: Option, + /// The account (if any) for which the funds of the invoice payment are intended. + /// + /// If set, the invoice will be presented with the branding and support information of the specified account. + /// See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + pub on_behalf_of: Option>, + /// Whether payment was successfully collected for this invoice. + /// + /// An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. + pub paid: bool, + /// Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe. + pub paid_out_of_band: bool, + /// The PaymentIntent associated with this invoice. + /// + /// The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. + /// Note that voiding an invoice will cancel the PaymentIntent. + pub payment_intent: Option>, + pub payment_settings: stripe_types::InvoicesPaymentSettings, + /// End of the usage period during which invoice items were added to this invoice. + pub period_end: stripe_types::Timestamp, + /// Start of the usage period during which invoice items were added to this invoice. + pub period_start: stripe_types::Timestamp, + /// Total amount of all post-payment credit notes issued for this invoice. + pub post_payment_credit_notes_amount: i64, + /// Total amount of all pre-payment credit notes issued for this invoice. + pub pre_payment_credit_notes_amount: i64, + /// The quote this invoice was generated from. + pub quote: Option>, + /// This is the transaction number that appears on email receipts sent for this invoice. + pub receipt_number: Option, + /// The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + pub rendering: Option, + /// This is a legacy field that will be removed soon. + /// + /// For details about `rendering_options`, refer to `rendering` instead. + /// Options for invoice PDF rendering. + pub rendering_options: Option, + /// The details of the cost of shipping, including the ShippingRate applied on the invoice. + pub shipping_cost: Option, + /// Shipping details for the invoice. + /// + /// The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. + pub shipping_details: Option, + /// Starting customer balance before the invoice is finalized. + /// + /// If the invoice has not been finalized yet, this will be the current customer balance. + /// For revision invoices, this also includes any customer balance that was applied to the original invoice. + pub starting_balance: i64, + /// Extra information about an invoice for the customer's credit card statement. + pub statement_descriptor: Option, + /// The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. + /// + /// [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview). + pub status: Option, + pub status_transitions: stripe_types::InvoicesStatusTransitions, + /// The subscription that this invoice was prepared for, if any. + pub subscription: Option>, + /// Details about the subscription that created this invoice. + pub subscription_details: Option, + /// Only set for upcoming invoices that preview prorations. + /// + /// The time used to calculate prorations. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_proration_date: Option, + /// Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. + /// + /// Item discounts are already incorporated. + pub subtotal: i64, + /// The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. + /// + /// Item discounts are already incorporated. + pub subtotal_excluding_tax: Option, + /// The amount of tax on this invoice. + /// + /// This is the sum of all the tax amounts on this invoice. + pub tax: Option, + /// ID of the test clock this invoice belongs to. + pub test_clock: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold_reason: Option, + /// Total after discounts and taxes. + pub total: i64, + /// The aggregate amounts calculated per discount across all line items. + pub total_discount_amounts: Option>, + /// The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax. + pub total_excluding_tax: Option, + /// The aggregate amounts calculated per tax rate for all line items. + pub total_tax_amounts: Vec, + /// The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice. + pub transfer_data: Option, + /// Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://stripe.com/docs/billing/webhooks#understand). + /// + /// This field tracks the time when webhooks for this invoice were successfully delivered. + /// If the invoice had no webhooks to deliver, this will be set while the invoice is being created. + pub webhooks_delivered_at: Option, +} +/// Indicates the reason why the invoice was created. +/// +/// * `manual`: Unrelated to a subscription, for example, created via the invoice editor. +/// * `subscription`: No longer in use. +/// +/// Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. * `subscription_create`: A new subscription was created. * `subscription_cycle`: A subscription advanced into a new period. * `subscription_threshold`: A subscription reached a billing threshold. * `subscription_update`: A subscription was updated. * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoiceBillingReason { + AutomaticPendingInvoiceItemInvoice, + Manual, + QuoteAccept, + Subscription, + SubscriptionCreate, + SubscriptionCycle, + SubscriptionThreshold, + SubscriptionUpdate, + Upcoming, +} +impl InvoiceBillingReason { + pub fn as_str(self) -> &'static str { + use InvoiceBillingReason::*; + match self { + AutomaticPendingInvoiceItemInvoice => "automatic_pending_invoice_item_invoice", + Manual => "manual", + QuoteAccept => "quote_accept", + Subscription => "subscription", + SubscriptionCreate => "subscription_create", + SubscriptionCycle => "subscription_cycle", + SubscriptionThreshold => "subscription_threshold", + SubscriptionUpdate => "subscription_update", + Upcoming => "upcoming", + } + } +} + +impl std::str::FromStr for InvoiceBillingReason { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoiceBillingReason::*; + match s { + "automatic_pending_invoice_item_invoice" => Ok(AutomaticPendingInvoiceItemInvoice), + "manual" => Ok(Manual), + "quote_accept" => Ok(QuoteAccept), + "subscription" => Ok(Subscription), + "subscription_create" => Ok(SubscriptionCreate), + "subscription_cycle" => Ok(SubscriptionCycle), + "subscription_threshold" => Ok(SubscriptionThreshold), + "subscription_update" => Ok(SubscriptionUpdate), + "upcoming" => Ok(Upcoming), + _ => Err(()), + } + } +} +impl AsRef for InvoiceBillingReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoiceBillingReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoiceBillingReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoiceBillingReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoiceBillingReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for InvoiceBillingReason")) + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// +/// When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. +/// When sending an invoice, Stripe will email this invoice to the customer with payment instructions. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoiceCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl InvoiceCollectionMethod { + pub fn as_str(self) -> &'static str { + use InvoiceCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for InvoiceCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoiceCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl AsRef for InvoiceCollectionMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoiceCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoiceCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoiceCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoiceCollectionMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for InvoiceCollectionMethod")) + } +} +/// The customer's tax exempt status. +/// +/// Until the invoice is finalized, this field will equal `customer.tax_exempt`. +/// Once the invoice is finalized, this field will no longer be updated. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoiceCustomerTaxExempt { + Exempt, + None, + Reverse, +} +impl InvoiceCustomerTaxExempt { + pub fn as_str(self) -> &'static str { + use InvoiceCustomerTaxExempt::*; + match self { + Exempt => "exempt", + None => "none", + Reverse => "reverse", + } + } +} + +impl std::str::FromStr for InvoiceCustomerTaxExempt { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoiceCustomerTaxExempt::*; + match s { + "exempt" => Ok(Exempt), + "none" => Ok(None), + "reverse" => Ok(Reverse), + _ => Err(()), + } + } +} +impl AsRef for InvoiceCustomerTaxExempt { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoiceCustomerTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoiceCustomerTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoiceCustomerTaxExempt { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoiceCustomerTaxExempt { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for InvoiceCustomerTaxExempt")) + } +} +/// The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. +/// +/// [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoiceStatus { + Draft, + Open, + Paid, + Uncollectible, + Void, +} +impl InvoiceStatus { + pub fn as_str(self) -> &'static str { + use InvoiceStatus::*; + match self { + Draft => "draft", + Open => "open", + Paid => "paid", + Uncollectible => "uncollectible", + Void => "void", + } + } +} + +impl std::str::FromStr for InvoiceStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoiceStatus::*; + match s { + "draft" => Ok(Draft), + "open" => Ok(Open), + "paid" => Ok(Paid), + "uncollectible" => Ok(Uncollectible), + "void" => Ok(Void), + _ => Err(()), + } + } +} +impl AsRef for InvoiceStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoiceStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoiceStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoiceStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoiceStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for InvoiceStatus")) + } +} +impl stripe_types::Object for Invoice { + type Id = Option; + fn id(&self) -> Option<&str> { + self.id.as_deref() + } +} +stripe_types::def_id!(InvoiceId, "in_"); diff --git a/stripe_types/src/generated/invoice_installments_card/mod.rs b/stripe_types/src/generated/invoice_installments_card/mod.rs new file mode 100644 index 000000000..eb15116d7 --- /dev/null +++ b/stripe_types/src/generated/invoice_installments_card/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoiceInstallmentsCard { + /// Whether Installments are enabled for this Invoice. + pub enabled: Option, +} diff --git a/stripe_types/src/generated/invoice_item/mod.rs b/stripe_types/src/generated/invoice_item/mod.rs new file mode 100644 index 000000000..4feee67c4 --- /dev/null +++ b/stripe_types/src/generated/invoice_item/mod.rs @@ -0,0 +1,79 @@ +/// Invoice Items represent the component lines of an [invoice](https://stripe.com/docs/api/invoices). +/// +/// An invoice item is added to an invoice by creating or updating it with an `invoice` field, at which point it will be included as [an invoice line item](https://stripe.com/docs/api/invoices/line_item) within [invoice.lines](https://stripe.com/docs/api/invoices/object#invoice_object-lines). Invoice Items can be created before you are ready to actually send the invoice. +/// This can be particularly useful when combined with a [subscription](https://stripe.com/docs/api/subscriptions). +/// Sometimes you want to add a charge or credit to a customer, but actually charge or credit the customer’s card only at the end of a regular billing cycle. +/// This is useful for combining several charges (to minimize per-transaction fees), or for having Stripe tabulate your usage-based billing totals. Related guides: [Integrate with the Invoicing API](https://stripe.com/docs/invoicing/integration), [Subscription Invoices](https://stripe.com/docs/billing/invoices/subscription#adding-upcoming-invoice-items). For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceItem { + /// Amount (in the `currency` specified) of the invoice item. + /// + /// This should always be equal to `unit_amount * quantity`. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the customer who will be billed when this invoice item is billed. + pub customer: stripe_types::Expandable, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub date: stripe_types::Timestamp, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// If true, discounts will apply to this invoice item. + /// + /// Always false for prorations. + pub discountable: bool, + /// The discounts which apply to the invoice item. + /// + /// Item discounts are applied before invoice discounts. + /// Use `expand[]=discounts` to expand each discount. + pub discounts: Option>>, + /// Unique identifier for the object. + pub id: stripe_types::invoice_item::InvoiceitemId, + /// The ID of the invoice this invoice item belongs to. + pub invoice: Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + pub period: stripe_types::InvoiceLineItemPeriod, + /// If the invoice item is a proration, the plan of the subscription that the proration was computed for. + pub plan: Option, + /// The price of the invoice item. + pub price: Option, + /// Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. + pub proration: bool, + /// Quantity of units for the invoice item. + /// + /// If the invoice item is a proration, the quantity of the subscription that the proration was computed for. + pub quantity: u64, + /// The subscription that this invoice item has been created for, if any. + pub subscription: Option>, + /// The subscription item that this invoice item has been created for, if any. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_item: Option, + /// The tax rates which apply to the invoice item. + /// + /// When set, the `default_tax_rates` on the invoice do not apply to this invoice item. + pub tax_rates: Option>, + /// ID of the test clock this invoice item belongs to. + pub test_clock: Option>, + /// Unit amount (in the `currency` specified) of the invoice item. + pub unit_amount: Option, + /// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + pub unit_amount_decimal: Option, +} +impl stripe_types::Object for InvoiceItem { + type Id = stripe_types::invoice_item::InvoiceitemId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(InvoiceitemId, "ii_"); diff --git a/stripe_types/src/generated/invoice_item_threshold_reason/mod.rs b/stripe_types/src/generated/invoice_item_threshold_reason/mod.rs new file mode 100644 index 000000000..76947aae7 --- /dev/null +++ b/stripe_types/src/generated/invoice_item_threshold_reason/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceItemThresholdReason { + /// The IDs of the line items that triggered the threshold invoice. + pub line_item_ids: Vec, + /// The quantity threshold boundary that applied to the given line item. + pub usage_gte: i64, +} diff --git a/stripe_types/src/generated/invoice_line_item/mod.rs b/stripe_types/src/generated/invoice_line_item/mod.rs new file mode 100644 index 000000000..eb8f118eb --- /dev/null +++ b/stripe_types/src/generated/invoice_line_item/mod.rs @@ -0,0 +1,133 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceLineItem { + /// The amount, in cents (or local equivalent). + pub amount: i64, + /// The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts. + pub amount_excluding_tax: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// The amount of discount calculated per discount for this line item. + pub discount_amounts: Option>, + /// If true, discounts will apply to this line item. + /// + /// Always false for prorations. + pub discountable: bool, + /// The discounts applied to the invoice line item. + /// + /// Line item discounts are applied before invoice discounts. + /// Use `expand[]=discounts` to expand each discount. + pub discounts: Option>>, + /// Unique identifier for the object. + pub id: stripe_types::invoice_line_item::LineItemId, + /// The ID of the [invoice item](https://stripe.com/docs/api/invoiceitems) associated with this line item if any. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_item: Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Note that for line items with `type=subscription` this will reflect the metadata of the subscription that caused the line item to be created. + pub metadata: std::collections::HashMap, + pub period: stripe_types::InvoiceLineItemPeriod, + /// The plan of the subscription, if the line item is a subscription or a proration. + pub plan: Option, + /// The price of the line item. + pub price: Option, + /// Whether this is a proration. + pub proration: bool, + /// Additional details for proration line items. + pub proration_details: Option, + /// The quantity of the subscription, if the line item is a subscription or a proration. + pub quantity: Option, + /// The subscription that the invoice item pertains to, if any. + pub subscription: Option>, + /// The subscription item that generated this line item. + /// + /// Left empty if the line item is not an explicit result of a subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_item: Option>, + /// The amount of tax calculated per tax rate for this line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_amounts: Option>, + /// The tax rates which apply to the line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option>, + /// A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`. + #[serde(rename = "type")] + pub type_: InvoiceLineItemType, + /// The amount in cents (or local equivalent) representing the unit amount for this line item, excluding all tax and discounts. + pub unit_amount_excluding_tax: Option, +} +/// A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoiceLineItemType { + Invoiceitem, + Subscription, +} +impl InvoiceLineItemType { + pub fn as_str(self) -> &'static str { + use InvoiceLineItemType::*; + match self { + Invoiceitem => "invoiceitem", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for InvoiceLineItemType { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoiceLineItemType::*; + match s { + "invoiceitem" => Ok(Invoiceitem), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl AsRef for InvoiceLineItemType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoiceLineItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoiceLineItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoiceLineItemType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoiceLineItemType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for InvoiceLineItemType")) + } +} +impl stripe_types::Object for InvoiceLineItem { + type Id = stripe_types::invoice_line_item::LineItemId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(LineItemId); diff --git a/stripe_types/src/generated/invoice_line_item_period/mod.rs b/stripe_types/src/generated/invoice_line_item_period/mod.rs new file mode 100644 index 000000000..a1349a236 --- /dev/null +++ b/stripe_types/src/generated/invoice_line_item_period/mod.rs @@ -0,0 +1,11 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceLineItemPeriod { + /// The end of the period, which must be greater than or equal to the start. + /// + /// This value is inclusive. + pub end: stripe_types::Timestamp, + /// The start of the period. + /// + /// This value is inclusive. + pub start: stripe_types::Timestamp, +} diff --git a/stripe_types/src/generated/invoice_mandate_options_card/mod.rs b/stripe_types/src/generated/invoice_mandate_options_card/mod.rs new file mode 100644 index 000000000..3f5719cb9 --- /dev/null +++ b/stripe_types/src/generated/invoice_mandate_options_card/mod.rs @@ -0,0 +1,75 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoiceMandateOptionsCard { + /// Amount to be charged for future payments. + pub amount: Option, + /// One of `fixed` or `maximum`. + /// + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: Option, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + pub description: Option, +} +/// One of `fixed` or `maximum`. +/// +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoiceMandateOptionsCardAmountType { + Fixed, + Maximum, +} +impl InvoiceMandateOptionsCardAmountType { + pub fn as_str(self) -> &'static str { + use InvoiceMandateOptionsCardAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for InvoiceMandateOptionsCardAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoiceMandateOptionsCardAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl AsRef for InvoiceMandateOptionsCardAmountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoiceMandateOptionsCardAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoiceMandateOptionsCardAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoiceMandateOptionsCardAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoiceMandateOptionsCardAmountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for InvoiceMandateOptionsCardAmountType") + }) + } +} diff --git a/stripe_types/src/generated/invoice_payment_method_options_acss_debit/mod.rs b/stripe_types/src/generated/invoice_payment_method_options_acss_debit/mod.rs new file mode 100644 index 000000000..60e981c8b --- /dev/null +++ b/stripe_types/src/generated/invoice_payment_method_options_acss_debit/mod.rs @@ -0,0 +1,73 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsAcssDebit { + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option, +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl InvoicePaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for InvoicePaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for InvoicePaymentMethodOptionsAcssDebitVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoicePaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicePaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicePaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoicePaymentMethodOptionsAcssDebitVerificationMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for InvoicePaymentMethodOptionsAcssDebitVerificationMethod", + ) + }) + } +} diff --git a/stripe_types/src/generated/invoice_payment_method_options_acss_debit_mandate_options/mod.rs b/stripe_types/src/generated/invoice_payment_method_options_acss_debit_mandate_options/mod.rs new file mode 100644 index 000000000..65c56aa45 --- /dev/null +++ b/stripe_types/src/generated/invoice_payment_method_options_acss_debit_mandate_options/mod.rs @@ -0,0 +1,65 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsAcssDebitMandateOptions { + /// Transaction type of the mandate. + pub transaction_type: Option, +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl AsRef for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType")) + } +} diff --git a/stripe_types/src/generated/invoice_payment_method_options_bancontact/mod.rs b/stripe_types/src/generated/invoice_payment_method_options_bancontact/mod.rs new file mode 100644 index 000000000..c85b7b25c --- /dev/null +++ b/stripe_types/src/generated/invoice_payment_method_options_bancontact/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + pub preferred_language: InvoicePaymentMethodOptionsBancontactPreferredLanguage, +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl InvoicePaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr for InvoicePaymentMethodOptionsBancontactPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for InvoicePaymentMethodOptionsBancontactPreferredLanguage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoicePaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicePaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicePaymentMethodOptionsBancontactPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoicePaymentMethodOptionsBancontactPreferredLanguage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for InvoicePaymentMethodOptionsBancontactPreferredLanguage", + ) + }) + } +} diff --git a/stripe_types/src/generated/invoice_payment_method_options_card/mod.rs b/stripe_types/src/generated/invoice_payment_method_options_card/mod.rs new file mode 100644 index 000000000..fc83dca6c --- /dev/null +++ b/stripe_types/src/generated/invoice_payment_method_options_card/mod.rs @@ -0,0 +1,75 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsCard { + #[serde(skip_serializing_if = "Option::is_none")] + pub installments: Option, + /// 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). + /// + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// 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. + pub request_three_d_secure: Option, +} +/// 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). +/// +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// 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. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, +} +impl InvoicePaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + } + } +} + +impl std::str::FromStr for InvoicePaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + _ => Err(()), + } + } +} +impl AsRef for InvoicePaymentMethodOptionsCardRequestThreeDSecure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoicePaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicePaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicePaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoicePaymentMethodOptionsCardRequestThreeDSecure { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for InvoicePaymentMethodOptionsCardRequestThreeDSecure", + ) + }) + } +} diff --git a/stripe_types/src/generated/invoice_payment_method_options_customer_balance/mod.rs b/stripe_types/src/generated/invoice_payment_method_options_customer_balance/mod.rs new file mode 100644 index 000000000..f4a6f293a --- /dev/null +++ b/stripe_types/src/generated/invoice_payment_method_options_customer_balance/mod.rs @@ -0,0 +1,70 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsCustomerBalance { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: Option, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// + /// Permitted values include: `bank_transfer`. + pub funding_type: Option, +} +/// The funding method type to be used when there are not enough funds in the customer balance. +/// +/// Permitted values include: `bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsCustomerBalanceFundingType { + BankTransfer, +} +impl InvoicePaymentMethodOptionsCustomerBalanceFundingType { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsCustomerBalanceFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr for InvoicePaymentMethodOptionsCustomerBalanceFundingType { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsCustomerBalanceFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl AsRef for InvoicePaymentMethodOptionsCustomerBalanceFundingType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoicePaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicePaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicePaymentMethodOptionsCustomerBalanceFundingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoicePaymentMethodOptionsCustomerBalanceFundingType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for InvoicePaymentMethodOptionsCustomerBalanceFundingType", + ) + }) + } +} diff --git a/stripe_types/src/generated/invoice_payment_method_options_customer_balance_bank_transfer/mod.rs b/stripe_types/src/generated/invoice_payment_method_options_customer_balance_bank_transfer/mod.rs new file mode 100644 index 000000000..47101eac2 --- /dev/null +++ b/stripe_types/src/generated/invoice_payment_method_options_customer_balance_bank_transfer/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsCustomerBalanceBankTransfer { + #[serde(skip_serializing_if = "Option::is_none")] + pub eu_bank_transfer: + Option, + /// The bank transfer type that can be used for funding. + /// + /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + #[serde(rename = "type")] + pub type_: Option, +} diff --git a/stripe_types/src/generated/invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer/mod.rs b/stripe_types/src/generated/invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer/mod.rs new file mode 100644 index 000000000..c321b10b1 --- /dev/null +++ b/stripe_types/src/generated/invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer/mod.rs @@ -0,0 +1,89 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer { + /// The desired country code of the bank account information. + /// + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry, +} +/// The desired country code of the bank account information. +/// +/// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry { + Be, + De, + Es, + Fr, + Ie, + Nl, +} +impl InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::*; + match self { + Be => "BE", + De => "DE", + Es => "ES", + Fr => "FR", + Ie => "IE", + Nl => "NL", + } + } +} + +impl std::str::FromStr + for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry +{ + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::*; + match s { + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "FR" => Ok(Fr), + "IE" => Ok(Ie), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry")) + } +} diff --git a/stripe_types/src/generated/invoice_payment_method_options_konbini/mod.rs b/stripe_types/src/generated/invoice_payment_method_options_konbini/mod.rs new file mode 100644 index 000000000..676a93018 --- /dev/null +++ b/stripe_types/src/generated/invoice_payment_method_options_konbini/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsKonbini {} diff --git a/stripe_types/src/generated/invoice_payment_method_options_us_bank_account/mod.rs b/stripe_types/src/generated/invoice_payment_method_options_us_bank_account/mod.rs new file mode 100644 index 000000000..c49e510a3 --- /dev/null +++ b/stripe_types/src/generated/invoice_payment_method_options_us_bank_account/mod.rs @@ -0,0 +1,74 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsUsBankAccount { + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: + Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option, +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod", + ) + }) + } +} diff --git a/stripe_types/src/generated/invoice_payment_method_options_us_bank_account_linked_account_options/mod.rs b/stripe_types/src/generated/invoice_payment_method_options_us_bank_account_linked_account_options/mod.rs new file mode 100644 index 000000000..877079283 --- /dev/null +++ b/stripe_types/src/generated/invoice_payment_method_options_us_bank_account_linked_account_options/mod.rs @@ -0,0 +1,133 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptions { + /// The list of permissions to request. + /// + /// The `payment_method` permission must be included. + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: + Option>, + /// Data features requested to be retrieved upon account creation. + pub prefetch: Option>, +} +/// The list of permissions to request. +/// +/// The `payment_method` permission must be included. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { + Balances, + PaymentMethod, + Transactions, +} +impl InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions::*; + match self { + Balances => "balances", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions::*; + match s { + "balances" => Ok(Balances), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl AsRef for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions")) + } +} +/// Data features requested to be retrieved upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { + Balances, +} +impl InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch::*; + match self { + Balances => "balances", + } + } +} + +impl std::str::FromStr for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch::*; + match s { + "balances" => Ok(Balances), + _ => Err(()), + } + } +} +impl AsRef for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch")) + } +} diff --git a/stripe_types/src/generated/invoice_rendering_pdf/mod.rs b/stripe_types/src/generated/invoice_rendering_pdf/mod.rs new file mode 100644 index 000000000..2518af28c --- /dev/null +++ b/stripe_types/src/generated/invoice_rendering_pdf/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoiceRenderingPdf { + /// Page size of invoice pdf. + /// + /// Options include a4, letter, and auto. + /// If set to auto, page size will be switched to a4 or letter based on customer locale. + pub page_size: Option, +} +/// Page size of invoice pdf. +/// +/// Options include a4, letter, and auto. +/// If set to auto, page size will be switched to a4 or letter based on customer locale. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoiceRenderingPdfPageSize { + A4, + Auto, + Letter, +} +impl InvoiceRenderingPdfPageSize { + pub fn as_str(self) -> &'static str { + use InvoiceRenderingPdfPageSize::*; + match self { + A4 => "a4", + Auto => "auto", + Letter => "letter", + } + } +} + +impl std::str::FromStr for InvoiceRenderingPdfPageSize { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoiceRenderingPdfPageSize::*; + match s { + "a4" => Ok(A4), + "auto" => Ok(Auto), + "letter" => Ok(Letter), + _ => Err(()), + } + } +} +impl AsRef for InvoiceRenderingPdfPageSize { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoiceRenderingPdfPageSize { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoiceRenderingPdfPageSize { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoiceRenderingPdfPageSize { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoiceRenderingPdfPageSize { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for InvoiceRenderingPdfPageSize")) + } +} diff --git a/stripe_types/src/generated/invoice_setting_custom_field/mod.rs b/stripe_types/src/generated/invoice_setting_custom_field/mod.rs new file mode 100644 index 000000000..6a3c97ccc --- /dev/null +++ b/stripe_types/src/generated/invoice_setting_custom_field/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceSettingCustomField { + /// The name of the custom field. + pub name: String, + /// The value of the custom field. + pub value: String, +} diff --git a/stripe_types/src/generated/invoice_setting_customer_setting/mod.rs b/stripe_types/src/generated/invoice_setting_customer_setting/mod.rs new file mode 100644 index 000000000..89500475d --- /dev/null +++ b/stripe_types/src/generated/invoice_setting_customer_setting/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoiceSettingCustomerSetting { + /// Default custom fields to be displayed on invoices for this customer. + pub custom_fields: Option>, + /// ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. + pub default_payment_method: Option>, + /// Default footer to be displayed on invoices for this customer. + pub footer: Option, + /// Default options for invoice PDF rendering for this customer. + pub rendering_options: Option, +} diff --git a/stripe_types/src/generated/invoice_setting_quote_setting/mod.rs b/stripe_types/src/generated/invoice_setting_quote_setting/mod.rs new file mode 100644 index 000000000..ef0fab4d6 --- /dev/null +++ b/stripe_types/src/generated/invoice_setting_quote_setting/mod.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoiceSettingQuoteSetting { + /// Number of days within which a customer must pay invoices generated by this quote. + /// + /// This value will be `null` for quotes where `collection_method=charge_automatically`. + pub days_until_due: Option, +} diff --git a/stripe_types/src/generated/invoice_setting_rendering_options/mod.rs b/stripe_types/src/generated/invoice_setting_rendering_options/mod.rs new file mode 100644 index 000000000..152f5561f --- /dev/null +++ b/stripe_types/src/generated/invoice_setting_rendering_options/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoiceSettingRenderingOptions { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + pub amount_tax_display: Option, +} diff --git a/stripe_types/src/generated/invoice_setting_subscription_schedule_phase_setting/mod.rs b/stripe_types/src/generated/invoice_setting_subscription_schedule_phase_setting/mod.rs new file mode 100644 index 000000000..c3d3ae9aa --- /dev/null +++ b/stripe_types/src/generated/invoice_setting_subscription_schedule_phase_setting/mod.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoiceSettingSubscriptionSchedulePhaseSetting { + /// Number of days within which a customer must pay invoices generated by this subscription schedule. + /// + /// This value will be `null` for subscription schedules where `billing=charge_automatically`. + pub days_until_due: Option, +} diff --git a/stripe_types/src/generated/invoice_setting_subscription_schedule_setting/mod.rs b/stripe_types/src/generated/invoice_setting_subscription_schedule_setting/mod.rs new file mode 100644 index 000000000..ea67e1563 --- /dev/null +++ b/stripe_types/src/generated/invoice_setting_subscription_schedule_setting/mod.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoiceSettingSubscriptionScheduleSetting { + /// Number of days within which a customer must pay invoices generated by this subscription schedule. + /// + /// This value will be `null` for subscription schedules where `billing=charge_automatically`. + pub days_until_due: Option, +} diff --git a/stripe_types/src/generated/invoice_tax_amount/mod.rs b/stripe_types/src/generated/invoice_tax_amount/mod.rs new file mode 100644 index 000000000..14ccb0851 --- /dev/null +++ b/stripe_types/src/generated/invoice_tax_amount/mod.rs @@ -0,0 +1,118 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceTaxAmount { + /// The amount, in cents (or local equivalent), of the tax. + pub amount: i64, + /// Whether this tax amount is inclusive or exclusive. + pub inclusive: bool, + /// The tax rate that was applied to get this tax amount. + pub tax_rate: stripe_types::Expandable, + /// The reasoning behind this tax, for example, if the product is tax exempt. + /// + /// The possible values for this field may be extended as new tax rules are supported. + pub taxability_reason: Option, + /// The amount on which tax is calculated, in cents (or local equivalent). + pub taxable_amount: Option, +} +/// The reasoning behind this tax, for example, if the product is tax exempt. +/// +/// The possible values for this field may be extended as new tax rules are supported. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum InvoiceTaxAmountTaxabilityReason { + CustomerExempt, + NotCollecting, + NotSubjectToTax, + NotSupported, + PortionProductExempt, + PortionReducedRated, + PortionStandardRated, + ProductExempt, + ProductExemptHoliday, + ProportionallyRated, + ReducedRated, + ReverseCharge, + StandardRated, + TaxableBasisReduced, + ZeroRated, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl InvoiceTaxAmountTaxabilityReason { + pub fn as_str(self) -> &'static str { + use InvoiceTaxAmountTaxabilityReason::*; + match self { + CustomerExempt => "customer_exempt", + NotCollecting => "not_collecting", + NotSubjectToTax => "not_subject_to_tax", + NotSupported => "not_supported", + PortionProductExempt => "portion_product_exempt", + PortionReducedRated => "portion_reduced_rated", + PortionStandardRated => "portion_standard_rated", + ProductExempt => "product_exempt", + ProductExemptHoliday => "product_exempt_holiday", + ProportionallyRated => "proportionally_rated", + ReducedRated => "reduced_rated", + ReverseCharge => "reverse_charge", + StandardRated => "standard_rated", + TaxableBasisReduced => "taxable_basis_reduced", + ZeroRated => "zero_rated", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for InvoiceTaxAmountTaxabilityReason { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoiceTaxAmountTaxabilityReason::*; + match s { + "customer_exempt" => Ok(CustomerExempt), + "not_collecting" => Ok(NotCollecting), + "not_subject_to_tax" => Ok(NotSubjectToTax), + "not_supported" => Ok(NotSupported), + "portion_product_exempt" => Ok(PortionProductExempt), + "portion_reduced_rated" => Ok(PortionReducedRated), + "portion_standard_rated" => Ok(PortionStandardRated), + "product_exempt" => Ok(ProductExempt), + "product_exempt_holiday" => Ok(ProductExemptHoliday), + "proportionally_rated" => Ok(ProportionallyRated), + "reduced_rated" => Ok(ReducedRated), + "reverse_charge" => Ok(ReverseCharge), + "standard_rated" => Ok(StandardRated), + "taxable_basis_reduced" => Ok(TaxableBasisReduced), + "zero_rated" => Ok(ZeroRated), + _ => Err(()), + } + } +} +impl AsRef for InvoiceTaxAmountTaxabilityReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoiceTaxAmountTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoiceTaxAmountTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoiceTaxAmountTaxabilityReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoiceTaxAmountTaxabilityReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(InvoiceTaxAmountTaxabilityReason::Unknown)) + } +} diff --git a/stripe_types/src/generated/invoice_threshold_reason/mod.rs b/stripe_types/src/generated/invoice_threshold_reason/mod.rs new file mode 100644 index 000000000..b1870ea8e --- /dev/null +++ b/stripe_types/src/generated/invoice_threshold_reason/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceThresholdReason { + /// The total invoice amount threshold boundary if it triggered the threshold invoice. + pub amount_gte: Option, + /// Indicates which line items triggered a threshold invoice. + pub item_reasons: Vec, +} diff --git a/stripe_types/src/generated/invoice_transfer_data/mod.rs b/stripe_types/src/generated/invoice_transfer_data/mod.rs new file mode 100644 index 000000000..405606eca --- /dev/null +++ b/stripe_types/src/generated/invoice_transfer_data/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceTransferData { + /// The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. + /// + /// By default, the entire amount is transferred to the destination. + pub amount: Option, + /// The account where funds from the payment will be transferred to upon payment success. + pub destination: stripe_types::Expandable, +} diff --git a/stripe_types/src/generated/invoices_from_invoice/mod.rs b/stripe_types/src/generated/invoices_from_invoice/mod.rs new file mode 100644 index 000000000..1d54ebe53 --- /dev/null +++ b/stripe_types/src/generated/invoices_from_invoice/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoicesFromInvoice { + /// The relation between this invoice and the cloned invoice. + pub action: String, + /// The invoice that was cloned. + pub invoice: stripe_types::Expandable, +} diff --git a/stripe_types/src/generated/invoices_invoice_rendering/mod.rs b/stripe_types/src/generated/invoices_invoice_rendering/mod.rs new file mode 100644 index 000000000..60495b711 --- /dev/null +++ b/stripe_types/src/generated/invoices_invoice_rendering/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicesInvoiceRendering { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + pub amount_tax_display: Option, + /// Invoice pdf rendering options. + pub pdf: Option, +} diff --git a/stripe_types/src/generated/invoices_payment_method_options/mod.rs b/stripe_types/src/generated/invoices_payment_method_options/mod.rs new file mode 100644 index 000000000..3cca06799 --- /dev/null +++ b/stripe_types/src/generated/invoices_payment_method_options/mod.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicesPaymentMethodOptions { + /// If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. + pub acss_debit: Option, + /// If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. + pub bancontact: Option, + /// If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. + pub card: Option, + /// If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. + pub customer_balance: Option, + /// If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. + pub konbini: Option, + /// If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. + pub us_bank_account: Option, +} diff --git a/stripe_types/src/generated/invoices_payment_settings/mod.rs b/stripe_types/src/generated/invoices_payment_settings/mod.rs new file mode 100644 index 000000000..a48e57d26 --- /dev/null +++ b/stripe_types/src/generated/invoices_payment_settings/mod.rs @@ -0,0 +1,145 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicesPaymentSettings { + /// ID of the mandate to be used for this invoice. + /// + /// It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. + pub default_mandate: Option, + /// Payment-method-specific configuration to provide to the invoice’s PaymentIntent. + pub payment_method_options: Option, + /// The list of payment method types (e.g. + /// + /// card) to provide to the invoice’s PaymentIntent. + /// 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). + pub payment_method_types: Option>, +} +/// The list of payment method types (e.g. +/// +/// card) to provide to the invoice’s PaymentIntent. +/// 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). +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum InvoicesPaymentSettingsPaymentMethodTypes { + AchCreditTransfer, + AchDebit, + AcssDebit, + AuBecsDebit, + BacsDebit, + Bancontact, + Boleto, + Card, + Cashapp, + CustomerBalance, + Fpx, + Giropay, + Grabpay, + Ideal, + Konbini, + Link, + Paynow, + Paypal, + Promptpay, + SepaCreditTransfer, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl InvoicesPaymentSettingsPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use InvoicesPaymentSettingsPaymentMethodTypes::*; + match self { + AchCreditTransfer => "ach_credit_transfer", + AchDebit => "ach_debit", + AcssDebit => "acss_debit", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Konbini => "konbini", + Link => "link", + Paynow => "paynow", + Paypal => "paypal", + Promptpay => "promptpay", + SepaCreditTransfer => "sepa_credit_transfer", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for InvoicesPaymentSettingsPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicesPaymentSettingsPaymentMethodTypes::*; + match s { + "ach_credit_transfer" => Ok(AchCreditTransfer), + "ach_debit" => Ok(AchDebit), + "acss_debit" => Ok(AcssDebit), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "promptpay" => Ok(Promptpay), + "sepa_credit_transfer" => Ok(SepaCreditTransfer), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + _ => Err(()), + } + } +} +impl AsRef for InvoicesPaymentSettingsPaymentMethodTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoicesPaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicesPaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicesPaymentSettingsPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoicesPaymentSettingsPaymentMethodTypes { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(InvoicesPaymentSettingsPaymentMethodTypes::Unknown)) + } +} diff --git a/stripe_types/src/generated/invoices_resource_invoice_tax_id/mod.rs b/stripe_types/src/generated/invoices_resource_invoice_tax_id/mod.rs new file mode 100644 index 000000000..755bc0841 --- /dev/null +++ b/stripe_types/src/generated/invoices_resource_invoice_tax_id/mod.rs @@ -0,0 +1,263 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoicesResourceInvoiceTaxId { + /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. + #[serde(rename = "type")] + pub type_: InvoicesResourceInvoiceTaxIdType, + /// The value of the tax ID. + pub value: Option, +} +/// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicesResourceInvoiceTaxIdType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + Unknown, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, +} +impl InvoicesResourceInvoiceTaxIdType { + pub fn as_str(self) -> &'static str { + use InvoicesResourceInvoiceTaxIdType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + Unknown => "unknown", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + } + } +} + +impl std::str::FromStr for InvoicesResourceInvoiceTaxIdType { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicesResourceInvoiceTaxIdType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "unknown" => Ok(Unknown), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl AsRef for InvoicesResourceInvoiceTaxIdType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for InvoicesResourceInvoiceTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicesResourceInvoiceTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicesResourceInvoiceTaxIdType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoicesResourceInvoiceTaxIdType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for InvoicesResourceInvoiceTaxIdType") + }) + } +} diff --git a/stripe_types/src/generated/invoices_resource_line_items_credited_items/mod.rs b/stripe_types/src/generated/invoices_resource_line_items_credited_items/mod.rs new file mode 100644 index 000000000..ebb9ec470 --- /dev/null +++ b/stripe_types/src/generated/invoices_resource_line_items_credited_items/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoicesResourceLineItemsCreditedItems { + /// Invoice containing the credited invoice line items. + pub invoice: String, + /// Credited invoice line items. + pub invoice_line_items: Vec, +} diff --git a/stripe_types/src/generated/invoices_resource_line_items_proration_details/mod.rs b/stripe_types/src/generated/invoices_resource_line_items_proration_details/mod.rs new file mode 100644 index 000000000..10d4c2a36 --- /dev/null +++ b/stripe_types/src/generated/invoices_resource_line_items_proration_details/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicesResourceLineItemsProrationDetails { + /// For a credit proration `line_item`, the original debit line_items to which the credit proration applies. + pub credited_items: Option, +} diff --git a/stripe_types/src/generated/invoices_shipping_cost/mod.rs b/stripe_types/src/generated/invoices_shipping_cost/mod.rs new file mode 100644 index 000000000..a73fb1502 --- /dev/null +++ b/stripe_types/src/generated/invoices_shipping_cost/mod.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoicesShippingCost { + /// Total shipping cost before any taxes are applied. + pub amount_subtotal: i64, + /// Total tax amount applied due to shipping costs. + /// + /// If no tax was applied, defaults to 0. + pub amount_tax: i64, + /// Total shipping cost after taxes are applied. + pub amount_total: i64, + /// The ID of the ShippingRate for this invoice. + pub shipping_rate: Option>, + /// The taxes applied to the shipping rate. + #[serde(skip_serializing_if = "Option::is_none")] + pub taxes: Option>, +} diff --git a/stripe_types/src/generated/invoices_status_transitions/mod.rs b/stripe_types/src/generated/invoices_status_transitions/mod.rs new file mode 100644 index 000000000..6f9935f05 --- /dev/null +++ b/stripe_types/src/generated/invoices_status_transitions/mod.rs @@ -0,0 +1,11 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicesStatusTransitions { + /// The time that the invoice draft was finalized. + pub finalized_at: Option, + /// The time that the invoice was marked uncollectible. + pub marked_uncollectible_at: Option, + /// The time that the invoice was paid. + pub paid_at: Option, + /// The time that the invoice was voided. + pub voided_at: Option, +} diff --git a/stripe_types/src/generated/issuing_authorization/mod.rs b/stripe_types/src/generated/issuing_authorization/mod.rs new file mode 100644 index 000000000..f859991d9 --- /dev/null +++ b/stripe_types/src/generated/issuing_authorization/mod.rs @@ -0,0 +1,223 @@ +/// When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization` +/// object is created. +/// +/// [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the purchase to be completed successfully. Related guide: [Issued card authorizations](https://stripe.com/docs/issuing/purchases/authorizations) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorization { + /// The total amount that was authorized or rejected. + /// + /// This amount is in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// `amount` should be the same as `merchant_amount`, unless `currency` and `merchant_currency` are different. + pub amount: i64, + /// Detailed breakdown of amount components. + /// + /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount_details: Option, + /// Whether the authorization has been approved. + pub approved: bool, + /// How the card details were provided. + pub authorization_method: IssuingAuthorizationAuthorizationMethod, + /// List of balance transactions associated with this authorization. + pub balance_transactions: Vec, + pub card: stripe_types::IssuingCard, + /// The cardholder to whom this authorization belongs. + pub cardholder: Option>, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The currency of the cardholder. + /// + /// This currency can be different from the currency presented at authorization and the `merchant_currency` field on this authorization. + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Unique identifier for the object. + pub id: stripe_types::issuing_authorization::IssuingAuthorizationId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The total amount that was authorized or rejected. + /// + /// This amount is in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// `merchant_amount` should be the same as `amount`, unless `merchant_currency` and `currency` are different. + pub merchant_amount: i64, + /// The local currency that was presented to the cardholder for the authorization. + /// + /// This currency can be different from the cardholder currency and the `currency` field on this authorization. + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub merchant_currency: stripe_types::Currency, + pub merchant_data: stripe_types::IssuingAuthorizationMerchantData, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Details about the authorization, such as identifiers, set by the card network. + pub network_data: Option, + /// The pending authorization request. + /// + /// This field will only be non-null during an `issuing_authorization.request` webhook. + pub pending_request: Option, + /// History of every time a `pending_request` authorization was approved/declined, either by you directly or by Stripe (e.g. + /// + /// based on your spending_controls). + /// If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. + /// This field can be helpful in determining why a given authorization was approved/declined. + pub request_history: Vec, + /// The current status of the authorization in its lifecycle. + pub status: IssuingAuthorizationStatus, + /// [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this authorization. + /// + /// If a network token was not used for this authorization, this field will be null. + #[serde(skip_serializing_if = "Option::is_none")] + pub token: Option>, + /// List of [transactions](https://stripe.com/docs/api/issuing/transactions) associated with this authorization. + pub transactions: Vec, + /// [Treasury](https://stripe.com/docs/api/treasury) details related to this authorization if it was created on a [FinancialAccount](https://stripe.com/docs/api/treasury/financial_accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option, + pub verification_data: stripe_types::IssuingAuthorizationVerificationData, + /// The digital wallet used for this transaction. + /// + /// One of `apple_pay`, `google_pay`, or `samsung_pay`. + /// Will populate as `null` when no digital wallet was utilized. + pub wallet: Option, +} +/// How the card details were provided. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationAuthorizationMethod { + Chip, + Contactless, + KeyedIn, + Online, + Swipe, +} +impl IssuingAuthorizationAuthorizationMethod { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationAuthorizationMethod::*; + match self { + Chip => "chip", + Contactless => "contactless", + KeyedIn => "keyed_in", + Online => "online", + Swipe => "swipe", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationAuthorizationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationAuthorizationMethod::*; + match s { + "chip" => Ok(Chip), + "contactless" => Ok(Contactless), + "keyed_in" => Ok(KeyedIn), + "online" => Ok(Online), + "swipe" => Ok(Swipe), + _ => Err(()), + } + } +} +impl AsRef for IssuingAuthorizationAuthorizationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingAuthorizationAuthorizationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationAuthorizationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationAuthorizationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationAuthorizationMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingAuthorizationAuthorizationMethod") + }) + } +} +/// The current status of the authorization in its lifecycle. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationStatus { + Closed, + Pending, + Reversed, +} +impl IssuingAuthorizationStatus { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationStatus::*; + match self { + Closed => "closed", + Pending => "pending", + Reversed => "reversed", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationStatus::*; + match s { + "closed" => Ok(Closed), + "pending" => Ok(Pending), + "reversed" => Ok(Reversed), + _ => Err(()), + } + } +} +impl AsRef for IssuingAuthorizationStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingAuthorizationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingAuthorizationStatus")) + } +} +impl stripe_types::Object for IssuingAuthorization { + type Id = stripe_types::issuing_authorization::IssuingAuthorizationId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(IssuingAuthorizationId, "iauth_"); diff --git a/stripe_types/src/generated/issuing_authorization_amount_details/mod.rs b/stripe_types/src/generated/issuing_authorization_amount_details/mod.rs new file mode 100644 index 000000000..f4d63c2f2 --- /dev/null +++ b/stripe_types/src/generated/issuing_authorization_amount_details/mod.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationAmountDetails { + /// The fee charged by the ATM for the cash withdrawal. + pub atm_fee: Option, + /// The amount of cash requested by the cardholder. + pub cashback_amount: Option, +} diff --git a/stripe_types/src/generated/issuing_authorization_authentication_exemption/mod.rs b/stripe_types/src/generated/issuing_authorization_authentication_exemption/mod.rs new file mode 100644 index 000000000..ed59c7e30 --- /dev/null +++ b/stripe_types/src/generated/issuing_authorization_authentication_exemption/mod.rs @@ -0,0 +1,132 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationAuthenticationExemption { + /// The entity that requested the exemption, either the acquiring merchant or the Issuing user. + pub claimed_by: IssuingAuthorizationAuthenticationExemptionClaimedBy, + /// The specific exemption claimed for this authorization. + #[serde(rename = "type")] + pub type_: IssuingAuthorizationAuthenticationExemptionType, +} +/// The entity that requested the exemption, either the acquiring merchant or the Issuing user. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationAuthenticationExemptionClaimedBy { + Acquirer, + Issuer, +} +impl IssuingAuthorizationAuthenticationExemptionClaimedBy { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationAuthenticationExemptionClaimedBy::*; + match self { + Acquirer => "acquirer", + Issuer => "issuer", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationAuthenticationExemptionClaimedBy { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationAuthenticationExemptionClaimedBy::*; + match s { + "acquirer" => Ok(Acquirer), + "issuer" => Ok(Issuer), + _ => Err(()), + } + } +} +impl AsRef for IssuingAuthorizationAuthenticationExemptionClaimedBy { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingAuthorizationAuthenticationExemptionClaimedBy { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationAuthenticationExemptionClaimedBy { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationAuthenticationExemptionClaimedBy { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationAuthenticationExemptionClaimedBy { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingAuthorizationAuthenticationExemptionClaimedBy", + ) + }) + } +} +/// The specific exemption claimed for this authorization. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationAuthenticationExemptionType { + LowValueTransaction, + TransactionRiskAnalysis, +} +impl IssuingAuthorizationAuthenticationExemptionType { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationAuthenticationExemptionType::*; + match self { + LowValueTransaction => "low_value_transaction", + TransactionRiskAnalysis => "transaction_risk_analysis", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationAuthenticationExemptionType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationAuthenticationExemptionType::*; + match s { + "low_value_transaction" => Ok(LowValueTransaction), + "transaction_risk_analysis" => Ok(TransactionRiskAnalysis), + _ => Err(()), + } + } +} +impl AsRef for IssuingAuthorizationAuthenticationExemptionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingAuthorizationAuthenticationExemptionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationAuthenticationExemptionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationAuthenticationExemptionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationAuthenticationExemptionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingAuthorizationAuthenticationExemptionType", + ) + }) + } +} diff --git a/stripe_types/src/generated/issuing_authorization_merchant_data/mod.rs b/stripe_types/src/generated/issuing_authorization_merchant_data/mod.rs new file mode 100644 index 000000000..a7bfd5ea4 --- /dev/null +++ b/stripe_types/src/generated/issuing_authorization_merchant_data/mod.rs @@ -0,0 +1,27 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationMerchantData { + /// A categorization of the seller's type of business. + /// + /// See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. + pub category: String, + /// The merchant category code for the seller’s business. + pub category_code: String, + /// City where the seller is located. + pub city: Option, + /// Country where the seller is located. + pub country: Option, + /// Name of the seller. + pub name: Option, + /// Identifier assigned to the seller by the card network. + /// + /// Different card networks may assign different network_id fields to the same merchant. + pub network_id: String, + /// Postal code where the seller is located. + pub postal_code: Option, + /// State where the seller is located. + pub state: Option, + /// An ID assigned by the seller to the location of the sale. + pub terminal_id: Option, + /// URL provided by the merchant on a 3DS request. + pub url: Option, +} diff --git a/stripe_types/src/generated/issuing_authorization_network_data/mod.rs b/stripe_types/src/generated/issuing_authorization_network_data/mod.rs new file mode 100644 index 000000000..276e75621 --- /dev/null +++ b/stripe_types/src/generated/issuing_authorization_network_data/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationNetworkData { + /// Identifier assigned to the acquirer by the card network. + /// + /// Sometimes this value is not provided by the network; in this case, the value will be `null`. + pub acquiring_institution_id: Option, + /// The System Trace Audit Number (STAN) is a 6-digit identifier assigned by the acquirer. + /// + /// Prefer `network_data.transaction_id` if present, unless you have special requirements. + pub system_trace_audit_number: Option, + /// Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions. + pub transaction_id: Option, +} diff --git a/stripe_types/src/generated/issuing_authorization_pending_request/mod.rs b/stripe_types/src/generated/issuing_authorization_pending_request/mod.rs new file mode 100644 index 000000000..26e02712f --- /dev/null +++ b/stripe_types/src/generated/issuing_authorization_pending_request/mod.rs @@ -0,0 +1,25 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationPendingRequest { + /// The additional amount Stripe will hold if the authorization is approved, in the card's [currency](https://stripe.com/docs/api#issuing_authorization_object-pending-request-currency) and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Detailed breakdown of amount components. + /// + /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount_details: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. + pub is_amount_controllable: bool, + /// The amount the merchant is requesting to be authorized in the `merchant_currency`. + /// + /// The amount is in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub merchant_amount: i64, + /// The local currency the merchant is requesting to authorize. + pub merchant_currency: stripe_types::Currency, + /// The card network's estimate of the likelihood that an authorization is fraudulent. + /// + /// Takes on values between 1 and 99. + pub network_risk_score: Option, +} diff --git a/stripe_types/src/generated/issuing_authorization_request/mod.rs b/stripe_types/src/generated/issuing_authorization_request/mod.rs new file mode 100644 index 000000000..71b73f551 --- /dev/null +++ b/stripe_types/src/generated/issuing_authorization_request/mod.rs @@ -0,0 +1,145 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationRequest { + /// The `pending_request.amount` at the time of the request, presented in your card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// + /// Stripe held this amount from your account to fund the authorization if the request was approved. + pub amount: i64, + /// Detailed breakdown of amount components. + /// + /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount_details: Option, + /// Whether this request was approved. + pub approved: bool, + /// A code created by Stripe which is shared with the merchant to validate the authorization. + /// + /// This field will be populated if the authorization message was approved. + /// The code typically starts with the letter "S", followed by a six-digit number. + /// For example, "S498162". + /// Please note that the code is not guaranteed to be unique across authorizations. + pub authorization_code: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The `pending_request.merchant_amount` at the time of the request, presented in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub merchant_amount: i64, + /// The currency that was collected by the merchant and presented to the cardholder for the authorization. + /// + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub merchant_currency: stripe_types::Currency, + /// The card network's estimate of the likelihood that an authorization is fraudulent. + /// + /// Takes on values between 1 and 99. + pub network_risk_score: Option, + /// When an authorization is approved or declined by you or by Stripe, this field provides additional detail on the reason for the outcome. + pub reason: IssuingAuthorizationRequestReason, + /// If the `request_history.reason` is `webhook_error` because the direct webhook response is invalid (for example, parsing errors or missing parameters), we surface a more detailed error message via this field. + pub reason_message: Option, + /// Time when the card network received an authorization request from the acquirer in UTC. + /// + /// Referred to by networks as transmission time. + pub requested_at: Option, +} +/// When an authorization is approved or declined by you or by Stripe, this field provides additional detail on the reason for the outcome. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum IssuingAuthorizationRequestReason { + AccountDisabled, + CardActive, + CardInactive, + CardholderInactive, + CardholderVerificationRequired, + InsufficientFunds, + NotAllowed, + SpendingControls, + SuspectedFraud, + VerificationFailed, + WebhookApproved, + WebhookDeclined, + WebhookError, + WebhookTimeout, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl IssuingAuthorizationRequestReason { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationRequestReason::*; + match self { + AccountDisabled => "account_disabled", + CardActive => "card_active", + CardInactive => "card_inactive", + CardholderInactive => "cardholder_inactive", + CardholderVerificationRequired => "cardholder_verification_required", + InsufficientFunds => "insufficient_funds", + NotAllowed => "not_allowed", + SpendingControls => "spending_controls", + SuspectedFraud => "suspected_fraud", + VerificationFailed => "verification_failed", + WebhookApproved => "webhook_approved", + WebhookDeclined => "webhook_declined", + WebhookError => "webhook_error", + WebhookTimeout => "webhook_timeout", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationRequestReason { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationRequestReason::*; + match s { + "account_disabled" => Ok(AccountDisabled), + "card_active" => Ok(CardActive), + "card_inactive" => Ok(CardInactive), + "cardholder_inactive" => Ok(CardholderInactive), + "cardholder_verification_required" => Ok(CardholderVerificationRequired), + "insufficient_funds" => Ok(InsufficientFunds), + "not_allowed" => Ok(NotAllowed), + "spending_controls" => Ok(SpendingControls), + "suspected_fraud" => Ok(SuspectedFraud), + "verification_failed" => Ok(VerificationFailed), + "webhook_approved" => Ok(WebhookApproved), + "webhook_declined" => Ok(WebhookDeclined), + "webhook_error" => Ok(WebhookError), + "webhook_timeout" => Ok(WebhookTimeout), + _ => Err(()), + } + } +} +impl AsRef for IssuingAuthorizationRequestReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingAuthorizationRequestReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationRequestReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationRequestReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationRequestReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(IssuingAuthorizationRequestReason::Unknown)) + } +} diff --git a/stripe_types/src/generated/issuing_authorization_three_d_secure/mod.rs b/stripe_types/src/generated/issuing_authorization_three_d_secure/mod.rs new file mode 100644 index 000000000..7e8390e33 --- /dev/null +++ b/stripe_types/src/generated/issuing_authorization_three_d_secure/mod.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationThreeDSecure { + /// The outcome of the 3D Secure authentication request. + pub result: IssuingAuthorizationThreeDSecureResult, +} +/// The outcome of the 3D Secure authentication request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationThreeDSecureResult { + AttemptAcknowledged, + Authenticated, + Failed, + Required, +} +impl IssuingAuthorizationThreeDSecureResult { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationThreeDSecureResult::*; + match self { + AttemptAcknowledged => "attempt_acknowledged", + Authenticated => "authenticated", + Failed => "failed", + Required => "required", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationThreeDSecureResult { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationThreeDSecureResult::*; + match s { + "attempt_acknowledged" => Ok(AttemptAcknowledged), + "authenticated" => Ok(Authenticated), + "failed" => Ok(Failed), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl AsRef for IssuingAuthorizationThreeDSecureResult { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingAuthorizationThreeDSecureResult { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationThreeDSecureResult { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationThreeDSecureResult { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationThreeDSecureResult { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingAuthorizationThreeDSecureResult") + }) + } +} diff --git a/stripe_types/src/generated/issuing_authorization_treasury/mod.rs b/stripe_types/src/generated/issuing_authorization_treasury/mod.rs new file mode 100644 index 000000000..58eac0bde --- /dev/null +++ b/stripe_types/src/generated/issuing_authorization_treasury/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationTreasury { + /// The array of [ReceivedCredits](https://stripe.com/docs/api/treasury/received_credits) associated with this authorization. + pub received_credits: Vec, + /// The array of [ReceivedDebits](https://stripe.com/docs/api/treasury/received_debits) associated with this authorization. + pub received_debits: Vec, + /// The Treasury [Transaction](https://stripe.com/docs/api/treasury/transactions) associated with this authorization. + pub transaction: Option, +} diff --git a/stripe_types/src/generated/issuing_authorization_verification_data/mod.rs b/stripe_types/src/generated/issuing_authorization_verification_data/mod.rs new file mode 100644 index 000000000..eae34dbd3 --- /dev/null +++ b/stripe_types/src/generated/issuing_authorization_verification_data/mod.rs @@ -0,0 +1,277 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationVerificationData { + /// Whether the cardholder provided an address first line and if it matched the cardholder’s `billing.address.line1`. + pub address_line1_check: IssuingAuthorizationVerificationDataAddressLine1Check, + /// Whether the cardholder provided a postal code and if it matched the cardholder’s `billing.address.postal_code`. + pub address_postal_code_check: IssuingAuthorizationVerificationDataAddressPostalCodeCheck, + /// The exemption applied to this authorization. + pub authentication_exemption: Option, + /// Whether the cardholder provided a CVC and if it matched Stripe’s record. + pub cvc_check: IssuingAuthorizationVerificationDataCvcCheck, + /// Whether the cardholder provided an expiry date and if it matched Stripe’s record. + pub expiry_check: IssuingAuthorizationVerificationDataExpiryCheck, + /// The postal code submitted as part of the authorization used for postal code verification. + pub postal_code: Option, + /// 3D Secure details. + pub three_d_secure: Option, +} +/// Whether the cardholder provided an address first line and if it matched the cardholder’s `billing.address.line1`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationVerificationDataAddressLine1Check { + Match, + Mismatch, + NotProvided, +} +impl IssuingAuthorizationVerificationDataAddressLine1Check { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationVerificationDataAddressLine1Check::*; + match self { + Match => "match", + Mismatch => "mismatch", + NotProvided => "not_provided", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationVerificationDataAddressLine1Check { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationVerificationDataAddressLine1Check::*; + match s { + "match" => Ok(Match), + "mismatch" => Ok(Mismatch), + "not_provided" => Ok(NotProvided), + _ => Err(()), + } + } +} +impl AsRef for IssuingAuthorizationVerificationDataAddressLine1Check { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingAuthorizationVerificationDataAddressLine1Check { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationVerificationDataAddressLine1Check { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationVerificationDataAddressLine1Check { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationVerificationDataAddressLine1Check { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingAuthorizationVerificationDataAddressLine1Check", + ) + }) + } +} +/// Whether the cardholder provided a postal code and if it matched the cardholder’s `billing.address.postal_code`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationVerificationDataAddressPostalCodeCheck { + Match, + Mismatch, + NotProvided, +} +impl IssuingAuthorizationVerificationDataAddressPostalCodeCheck { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationVerificationDataAddressPostalCodeCheck::*; + match self { + Match => "match", + Mismatch => "mismatch", + NotProvided => "not_provided", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationVerificationDataAddressPostalCodeCheck { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationVerificationDataAddressPostalCodeCheck::*; + match s { + "match" => Ok(Match), + "mismatch" => Ok(Mismatch), + "not_provided" => Ok(NotProvided), + _ => Err(()), + } + } +} +impl AsRef for IssuingAuthorizationVerificationDataAddressPostalCodeCheck { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingAuthorizationVerificationDataAddressPostalCodeCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationVerificationDataAddressPostalCodeCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationVerificationDataAddressPostalCodeCheck { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationVerificationDataAddressPostalCodeCheck { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingAuthorizationVerificationDataAddressPostalCodeCheck", + ) + }) + } +} +/// Whether the cardholder provided a CVC and if it matched Stripe’s record. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationVerificationDataCvcCheck { + Match, + Mismatch, + NotProvided, +} +impl IssuingAuthorizationVerificationDataCvcCheck { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationVerificationDataCvcCheck::*; + match self { + Match => "match", + Mismatch => "mismatch", + NotProvided => "not_provided", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationVerificationDataCvcCheck { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationVerificationDataCvcCheck::*; + match s { + "match" => Ok(Match), + "mismatch" => Ok(Mismatch), + "not_provided" => Ok(NotProvided), + _ => Err(()), + } + } +} +impl AsRef for IssuingAuthorizationVerificationDataCvcCheck { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingAuthorizationVerificationDataCvcCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationVerificationDataCvcCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationVerificationDataCvcCheck { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationVerificationDataCvcCheck { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingAuthorizationVerificationDataCvcCheck", + ) + }) + } +} +/// Whether the cardholder provided an expiry date and if it matched Stripe’s record. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationVerificationDataExpiryCheck { + Match, + Mismatch, + NotProvided, +} +impl IssuingAuthorizationVerificationDataExpiryCheck { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationVerificationDataExpiryCheck::*; + match self { + Match => "match", + Mismatch => "mismatch", + NotProvided => "not_provided", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationVerificationDataExpiryCheck { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationVerificationDataExpiryCheck::*; + match s { + "match" => Ok(Match), + "mismatch" => Ok(Mismatch), + "not_provided" => Ok(NotProvided), + _ => Err(()), + } + } +} +impl AsRef for IssuingAuthorizationVerificationDataExpiryCheck { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingAuthorizationVerificationDataExpiryCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationVerificationDataExpiryCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationVerificationDataExpiryCheck { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationVerificationDataExpiryCheck { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingAuthorizationVerificationDataExpiryCheck", + ) + }) + } +} diff --git a/stripe_types/src/generated/issuing_card/mod.rs b/stripe_types/src/generated/issuing_card/mod.rs new file mode 100644 index 000000000..b2bccc4df --- /dev/null +++ b/stripe_types/src/generated/issuing_card/mod.rs @@ -0,0 +1,326 @@ +/// You can [create physical or virtual cards](https://stripe.com/docs/issuing/cards) that are issued to cardholders. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCard { + /// The brand of the card. + pub brand: String, + /// The reason why the card was canceled. + pub cancellation_reason: Option, + pub cardholder: stripe_types::IssuingCardholder, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Supported currencies are `usd` in the US, `eur` in the EU, and `gbp` in the UK. + pub currency: stripe_types::Currency, + /// The card's CVC. + /// + /// For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with [the `expand` parameter](https://stripe.com/docs/api/expanding_objects). + /// Additionally, it's only available via the ["Retrieve a card" endpoint](https://stripe.com/docs/api/issuing/cards/retrieve), not via "List all cards" or any other endpoint. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc: Option, + /// The expiration month of the card. + pub exp_month: i64, + /// The expiration year of the card. + pub exp_year: i64, + /// The financial account this card is attached to. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_account: Option, + /// Unique identifier for the object. + pub id: stripe_types::issuing_card::IssuingCardId, + /// The last 4 digits of the card number. + pub last4: String, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The full unredacted card number. + /// + /// For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with [the `expand` parameter](https://stripe.com/docs/api/expanding_objects). + /// Additionally, it's only available via the ["Retrieve a card" endpoint](https://stripe.com/docs/api/issuing/cards/retrieve), not via "List all cards" or any other endpoint. + #[serde(skip_serializing_if = "Option::is_none")] + pub number: Option, + /// The latest card that replaces this card, if any. + pub replaced_by: Option>, + /// The card this card replaces, if any. + pub replacement_for: Option>, + /// The reason why the previous card needed to be replaced. + pub replacement_reason: Option, + /// Where and how the card will be shipped. + pub shipping: Option, + pub spending_controls: stripe_types::IssuingCardAuthorizationControls, + /// Whether authorizations can be approved on this card. + /// + /// May be blocked from activating cards depending on past-due Cardholder requirements. + /// Defaults to `inactive`. + pub status: IssuingCardStatus, + /// The type of the card. + #[serde(rename = "type")] + pub type_: IssuingCardType, + /// Information relating to digital wallets (like Apple Pay and Google Pay). + pub wallets: Option, +} +/// The reason why the card was canceled. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardCancellationReason { + DesignRejected, + Lost, + Stolen, +} +impl IssuingCardCancellationReason { + pub fn as_str(self) -> &'static str { + use IssuingCardCancellationReason::*; + match self { + DesignRejected => "design_rejected", + Lost => "lost", + Stolen => "stolen", + } + } +} + +impl std::str::FromStr for IssuingCardCancellationReason { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardCancellationReason::*; + match s { + "design_rejected" => Ok(DesignRejected), + "lost" => Ok(Lost), + "stolen" => Ok(Stolen), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardCancellationReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardCancellationReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardCancellationReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingCardCancellationReason") + }) + } +} +/// The reason why the previous card needed to be replaced. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardReplacementReason { + Damaged, + Expired, + Lost, + Stolen, +} +impl IssuingCardReplacementReason { + pub fn as_str(self) -> &'static str { + use IssuingCardReplacementReason::*; + match self { + Damaged => "damaged", + Expired => "expired", + Lost => "lost", + Stolen => "stolen", + } + } +} + +impl std::str::FromStr for IssuingCardReplacementReason { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardReplacementReason::*; + match s { + "damaged" => Ok(Damaged), + "expired" => Ok(Expired), + "lost" => Ok(Lost), + "stolen" => Ok(Stolen), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardReplacementReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardReplacementReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardReplacementReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardReplacementReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardReplacementReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardReplacementReason")) + } +} +/// Whether authorizations can be approved on this card. +/// +/// May be blocked from activating cards depending on past-due Cardholder requirements. +/// Defaults to `inactive`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardStatus { + Active, + Canceled, + Inactive, +} +impl IssuingCardStatus { + pub fn as_str(self) -> &'static str { + use IssuingCardStatus::*; + match self { + Active => "active", + Canceled => "canceled", + Inactive => "inactive", + } + } +} + +impl std::str::FromStr for IssuingCardStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardStatus::*; + match s { + "active" => Ok(Active), + "canceled" => Ok(Canceled), + "inactive" => Ok(Inactive), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardStatus")) + } +} +/// The type of the card. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardType { + Physical, + Virtual, +} +impl IssuingCardType { + pub fn as_str(self) -> &'static str { + use IssuingCardType::*; + match self { + Physical => "physical", + Virtual => "virtual", + } + } +} + +impl std::str::FromStr for IssuingCardType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardType::*; + match s { + "physical" => Ok(Physical), + "virtual" => Ok(Virtual), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardType")) + } +} +impl stripe_types::Object for IssuingCard { + type Id = stripe_types::issuing_card::IssuingCardId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(IssuingCardId, "ic_"); diff --git a/stripe_types/src/generated/issuing_card_apple_pay/mod.rs b/stripe_types/src/generated/issuing_card_apple_pay/mod.rs new file mode 100644 index 000000000..ff79a2b8a --- /dev/null +++ b/stripe_types/src/generated/issuing_card_apple_pay/mod.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardApplePay { + /// Apple Pay Eligibility. + pub eligible: bool, + /// Reason the card is ineligible for Apple Pay. + pub ineligible_reason: Option, +} +/// Reason the card is ineligible for Apple Pay. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardApplePayIneligibleReason { + MissingAgreement, + MissingCardholderContact, + UnsupportedRegion, +} +impl IssuingCardApplePayIneligibleReason { + pub fn as_str(self) -> &'static str { + use IssuingCardApplePayIneligibleReason::*; + match self { + MissingAgreement => "missing_agreement", + MissingCardholderContact => "missing_cardholder_contact", + UnsupportedRegion => "unsupported_region", + } + } +} + +impl std::str::FromStr for IssuingCardApplePayIneligibleReason { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardApplePayIneligibleReason::*; + match s { + "missing_agreement" => Ok(MissingAgreement), + "missing_cardholder_contact" => Ok(MissingCardholderContact), + "unsupported_region" => Ok(UnsupportedRegion), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardApplePayIneligibleReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardApplePayIneligibleReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardApplePayIneligibleReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardApplePayIneligibleReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardApplePayIneligibleReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingCardApplePayIneligibleReason") + }) + } +} diff --git a/stripe_types/src/generated/issuing_card_authorization_controls/mod.rs b/stripe_types/src/generated/issuing_card_authorization_controls/mod.rs new file mode 100644 index 000000000..b7c16914c --- /dev/null +++ b/stripe_types/src/generated/issuing_card_authorization_controls/mod.rs @@ -0,0 +1,2091 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardAuthorizationControls { + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. + /// + /// All other categories will be blocked. + /// Cannot be set with `blocked_categories`. + pub allowed_categories: Option>, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. + /// + /// All other categories will be allowed. + /// Cannot be set with `allowed_categories`. + pub blocked_categories: Option>, + /// Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). + pub spending_limits: Option>, + /// Currency of the amounts within `spending_limits`. + /// + /// Always the same as the currency of the card. + pub spending_limits_currency: Option, +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. +/// +/// All other categories will be blocked. +/// Cannot be set with `blocked_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum IssuingCardAuthorizationControlsAllowedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl IssuingCardAuthorizationControlsAllowedCategories { + pub fn as_str(self) -> &'static str { + use IssuingCardAuthorizationControlsAllowedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for IssuingCardAuthorizationControlsAllowedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardAuthorizationControlsAllowedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardAuthorizationControlsAllowedCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardAuthorizationControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardAuthorizationControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardAuthorizationControlsAllowedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardAuthorizationControlsAllowedCategories { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(IssuingCardAuthorizationControlsAllowedCategories::Unknown)) + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. +/// +/// All other categories will be allowed. +/// Cannot be set with `allowed_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum IssuingCardAuthorizationControlsBlockedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl IssuingCardAuthorizationControlsBlockedCategories { + pub fn as_str(self) -> &'static str { + use IssuingCardAuthorizationControlsBlockedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for IssuingCardAuthorizationControlsBlockedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardAuthorizationControlsBlockedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardAuthorizationControlsBlockedCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardAuthorizationControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardAuthorizationControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardAuthorizationControlsBlockedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardAuthorizationControlsBlockedCategories { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(IssuingCardAuthorizationControlsBlockedCategories::Unknown)) + } +} diff --git a/stripe_types/src/generated/issuing_card_google_pay/mod.rs b/stripe_types/src/generated/issuing_card_google_pay/mod.rs new file mode 100644 index 000000000..4c2d5b0ac --- /dev/null +++ b/stripe_types/src/generated/issuing_card_google_pay/mod.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardGooglePay { + /// Google Pay Eligibility. + pub eligible: bool, + /// Reason the card is ineligible for Google Pay. + pub ineligible_reason: Option, +} +/// Reason the card is ineligible for Google Pay. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardGooglePayIneligibleReason { + MissingAgreement, + MissingCardholderContact, + UnsupportedRegion, +} +impl IssuingCardGooglePayIneligibleReason { + pub fn as_str(self) -> &'static str { + use IssuingCardGooglePayIneligibleReason::*; + match self { + MissingAgreement => "missing_agreement", + MissingCardholderContact => "missing_cardholder_contact", + UnsupportedRegion => "unsupported_region", + } + } +} + +impl std::str::FromStr for IssuingCardGooglePayIneligibleReason { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardGooglePayIneligibleReason::*; + match s { + "missing_agreement" => Ok(MissingAgreement), + "missing_cardholder_contact" => Ok(MissingCardholderContact), + "unsupported_region" => Ok(UnsupportedRegion), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardGooglePayIneligibleReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardGooglePayIneligibleReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardGooglePayIneligibleReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardGooglePayIneligibleReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardGooglePayIneligibleReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingCardGooglePayIneligibleReason") + }) + } +} diff --git a/stripe_types/src/generated/issuing_card_shipping/mod.rs b/stripe_types/src/generated/issuing_card_shipping/mod.rs new file mode 100644 index 000000000..a0655fd61 --- /dev/null +++ b/stripe_types/src/generated/issuing_card_shipping/mod.rs @@ -0,0 +1,291 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardShipping { + pub address: stripe_types::Address, + /// The delivery company that shipped a card. + pub carrier: Option, + /// Additional information that may be required for clearing customs. + pub customs: Option, + /// A unix timestamp representing a best estimate of when the card will be delivered. + pub eta: Option, + /// Recipient name. + pub name: String, + /// The phone number of the receiver of the shipment. + /// + /// Our courier partners will use this number to contact you in the event of card delivery issues. + /// For individual shipments to the EU/UK, if this field is empty, we will provide them with the phone number provided when the cardholder was initially created. + pub phone_number: Option, + /// Whether a signature is required for card delivery. + /// + /// This feature is only supported for US users. + /// Standard shipping service does not support signature on delivery. + /// The default value for standard shipping service is false and for express and priority services is true. + pub require_signature: Option, + /// Shipment service, such as `standard` or `express`. + pub service: IssuingCardShippingService, + /// The delivery status of the card. + pub status: Option, + /// A tracking number for a card shipment. + pub tracking_number: Option, + /// A link to the shipping carrier's site where you can view detailed information about a card shipment. + pub tracking_url: Option, + /// Packaging options. + #[serde(rename = "type")] + pub type_: IssuingCardShippingType, +} +/// The delivery company that shipped a card. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardShippingCarrier { + Dhl, + Fedex, + RoyalMail, + Usps, +} +impl IssuingCardShippingCarrier { + pub fn as_str(self) -> &'static str { + use IssuingCardShippingCarrier::*; + match self { + Dhl => "dhl", + Fedex => "fedex", + RoyalMail => "royal_mail", + Usps => "usps", + } + } +} + +impl std::str::FromStr for IssuingCardShippingCarrier { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardShippingCarrier::*; + match s { + "dhl" => Ok(Dhl), + "fedex" => Ok(Fedex), + "royal_mail" => Ok(RoyalMail), + "usps" => Ok(Usps), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardShippingCarrier { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardShippingCarrier { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardShippingCarrier { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardShippingCarrier { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardShippingCarrier { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardShippingCarrier")) + } +} +/// Shipment service, such as `standard` or `express`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardShippingService { + Express, + Priority, + Standard, +} +impl IssuingCardShippingService { + pub fn as_str(self) -> &'static str { + use IssuingCardShippingService::*; + match self { + Express => "express", + Priority => "priority", + Standard => "standard", + } + } +} + +impl std::str::FromStr for IssuingCardShippingService { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardShippingService::*; + match s { + "express" => Ok(Express), + "priority" => Ok(Priority), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardShippingService { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardShippingService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardShippingService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardShippingService { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardShippingService { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardShippingService")) + } +} +/// The delivery status of the card. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardShippingStatus { + Canceled, + Delivered, + Failure, + Pending, + Returned, + Shipped, +} +impl IssuingCardShippingStatus { + pub fn as_str(self) -> &'static str { + use IssuingCardShippingStatus::*; + match self { + Canceled => "canceled", + Delivered => "delivered", + Failure => "failure", + Pending => "pending", + Returned => "returned", + Shipped => "shipped", + } + } +} + +impl std::str::FromStr for IssuingCardShippingStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardShippingStatus::*; + match s { + "canceled" => Ok(Canceled), + "delivered" => Ok(Delivered), + "failure" => Ok(Failure), + "pending" => Ok(Pending), + "returned" => Ok(Returned), + "shipped" => Ok(Shipped), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardShippingStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardShippingStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardShippingStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardShippingStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardShippingStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardShippingStatus")) + } +} +/// Packaging options. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardShippingType { + Bulk, + Individual, +} +impl IssuingCardShippingType { + pub fn as_str(self) -> &'static str { + use IssuingCardShippingType::*; + match self { + Bulk => "bulk", + Individual => "individual", + } + } +} + +impl std::str::FromStr for IssuingCardShippingType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardShippingType::*; + match s { + "bulk" => Ok(Bulk), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardShippingType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardShippingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardShippingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardShippingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardShippingType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardShippingType")) + } +} diff --git a/stripe_types/src/generated/issuing_card_shipping_customs/mod.rs b/stripe_types/src/generated/issuing_card_shipping_customs/mod.rs new file mode 100644 index 000000000..63e76de27 --- /dev/null +++ b/stripe_types/src/generated/issuing_card_shipping_customs/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardShippingCustoms { + /// A registration number used for customs in Europe. + /// + /// See [](https://www.gov.uk/eori) for the UK and [](https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en) for the EU. + pub eori_number: Option, +} diff --git a/stripe_types/src/generated/issuing_card_spending_limit/mod.rs b/stripe_types/src/generated/issuing_card_spending_limit/mod.rs new file mode 100644 index 000000000..ebdf2b725 --- /dev/null +++ b/stripe_types/src/generated/issuing_card_spending_limit/mod.rs @@ -0,0 +1,1120 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardSpendingLimit { + /// Maximum amount allowed to spend per interval. + /// + /// This amount is in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. + /// + /// Omitting this field will apply the limit to all categories. + pub categories: Option>, + /// Interval (or event) to which the amount applies. + pub interval: IssuingCardSpendingLimitInterval, +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. +/// +/// Omitting this field will apply the limit to all categories. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum IssuingCardSpendingLimitCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl IssuingCardSpendingLimitCategories { + pub fn as_str(self) -> &'static str { + use IssuingCardSpendingLimitCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for IssuingCardSpendingLimitCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardSpendingLimitCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardSpendingLimitCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardSpendingLimitCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardSpendingLimitCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardSpendingLimitCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardSpendingLimitCategories { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(IssuingCardSpendingLimitCategories::Unknown)) + } +} +/// Interval (or event) to which the amount applies. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardSpendingLimitInterval { + AllTime, + Daily, + Monthly, + PerAuthorization, + Weekly, + Yearly, +} +impl IssuingCardSpendingLimitInterval { + pub fn as_str(self) -> &'static str { + use IssuingCardSpendingLimitInterval::*; + match self { + AllTime => "all_time", + Daily => "daily", + Monthly => "monthly", + PerAuthorization => "per_authorization", + Weekly => "weekly", + Yearly => "yearly", + } + } +} + +impl std::str::FromStr for IssuingCardSpendingLimitInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardSpendingLimitInterval::*; + match s { + "all_time" => Ok(AllTime), + "daily" => Ok(Daily), + "monthly" => Ok(Monthly), + "per_authorization" => Ok(PerAuthorization), + "weekly" => Ok(Weekly), + "yearly" => Ok(Yearly), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardSpendingLimitInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardSpendingLimitInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardSpendingLimitInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardSpendingLimitInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardSpendingLimitInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingCardSpendingLimitInterval") + }) + } +} diff --git a/stripe_types/src/generated/issuing_card_wallets/mod.rs b/stripe_types/src/generated/issuing_card_wallets/mod.rs new file mode 100644 index 000000000..8c3263727 --- /dev/null +++ b/stripe_types/src/generated/issuing_card_wallets/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardWallets { + pub apple_pay: stripe_types::IssuingCardApplePay, + pub google_pay: stripe_types::IssuingCardGooglePay, + /// Unique identifier for a card used with digital wallets. + pub primary_account_identifier: Option, +} diff --git a/stripe_types/src/generated/issuing_cardholder/mod.rs b/stripe_types/src/generated/issuing_cardholder/mod.rs new file mode 100644 index 000000000..1f6c06bb1 --- /dev/null +++ b/stripe_types/src/generated/issuing_cardholder/mod.rs @@ -0,0 +1,253 @@ +/// An Issuing `Cardholder` object represents an individual or business entity who is [issued](https://stripe.com/docs/issuing) cards. +/// +/// Related guide: [How to create a cardholder](https://stripe.com/docs/issuing/cards#create-cardholder) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholder { + pub billing: stripe_types::IssuingCardholderAddress, + /// Additional information about a `company` cardholder. + pub company: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The cardholder's email address. + pub email: Option, + /// Unique identifier for the object. + pub id: stripe_types::issuing_cardholder::IssuingCardholderId, + /// Additional information about an `individual` cardholder. + pub individual: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The cardholder's name. + /// + /// This will be printed on cards issued to them. + pub name: String, + /// The cardholder's phone number. + /// + /// This is required for all cardholders who will be creating EU cards. + /// See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. + pub phone_number: Option, + /// The cardholder’s preferred locales (languages), ordered by preference. + /// + /// Locales can be `de`, `en`, `es`, `fr`, or `it`. This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. + pub preferred_locales: Option>, + pub requirements: stripe_types::IssuingCardholderRequirements, + /// Rules that control spending across this cardholder's cards. + /// + /// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. + pub spending_controls: Option, + /// Specifies whether to permit authorizations on this cardholder's cards. + pub status: IssuingCardholderStatus, + /// One of `individual` or `company`. + /// + /// See [Choose a cardholder type](https://stripe.com/docs/issuing/other/choose-cardholder) for more details. + #[serde(rename = "type")] + pub type_: IssuingCardholderType, +} +/// The cardholder’s preferred locales (languages), ordered by preference. +/// +/// Locales can be `de`, `en`, `es`, `fr`, or `it`. This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardholderPreferredLocales { + De, + En, + Es, + Fr, + It, +} +impl IssuingCardholderPreferredLocales { + pub fn as_str(self) -> &'static str { + use IssuingCardholderPreferredLocales::*; + match self { + De => "de", + En => "en", + Es => "es", + Fr => "fr", + It => "it", + } + } +} + +impl std::str::FromStr for IssuingCardholderPreferredLocales { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderPreferredLocales::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "es" => Ok(Es), + "fr" => Ok(Fr), + "it" => Ok(It), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardholderPreferredLocales { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardholderPreferredLocales { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderPreferredLocales { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderPreferredLocales { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderPreferredLocales { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingCardholderPreferredLocales") + }) + } +} +/// Specifies whether to permit authorizations on this cardholder's cards. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardholderStatus { + Active, + Blocked, + Inactive, +} +impl IssuingCardholderStatus { + pub fn as_str(self) -> &'static str { + use IssuingCardholderStatus::*; + match self { + Active => "active", + Blocked => "blocked", + Inactive => "inactive", + } + } +} + +impl std::str::FromStr for IssuingCardholderStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderStatus::*; + match s { + "active" => Ok(Active), + "blocked" => Ok(Blocked), + "inactive" => Ok(Inactive), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardholderStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardholderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardholderStatus")) + } +} +/// One of `individual` or `company`. +/// +/// See [Choose a cardholder type](https://stripe.com/docs/issuing/other/choose-cardholder) for more details. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardholderType { + Company, + Individual, +} +impl IssuingCardholderType { + pub fn as_str(self) -> &'static str { + use IssuingCardholderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for IssuingCardholderType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardholderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardholderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardholderType")) + } +} +impl stripe_types::Object for IssuingCardholder { + type Id = stripe_types::issuing_cardholder::IssuingCardholderId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(IssuingCardholderId, "ich_"); diff --git a/stripe_types/src/generated/issuing_cardholder_address/mod.rs b/stripe_types/src/generated/issuing_cardholder_address/mod.rs new file mode 100644 index 000000000..6052d3b73 --- /dev/null +++ b/stripe_types/src/generated/issuing_cardholder_address/mod.rs @@ -0,0 +1,4 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderAddress { + pub address: stripe_types::Address, +} diff --git a/stripe_types/src/generated/issuing_cardholder_authorization_controls/mod.rs b/stripe_types/src/generated/issuing_cardholder_authorization_controls/mod.rs new file mode 100644 index 000000000..eddb4e022 --- /dev/null +++ b/stripe_types/src/generated/issuing_cardholder_authorization_controls/mod.rs @@ -0,0 +1,2091 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderAuthorizationControls { + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. + /// + /// All other categories will be blocked. + /// Cannot be set with `blocked_categories`. + pub allowed_categories: Option>, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. + /// + /// All other categories will be allowed. + /// Cannot be set with `allowed_categories`. + pub blocked_categories: Option>, + /// Limit spending with amount-based rules that apply across this cardholder's cards. + pub spending_limits: Option>, + /// Currency of the amounts within `spending_limits`. + pub spending_limits_currency: Option, +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. +/// +/// All other categories will be blocked. +/// Cannot be set with `blocked_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum IssuingCardholderAuthorizationControlsAllowedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl IssuingCardholderAuthorizationControlsAllowedCategories { + pub fn as_str(self) -> &'static str { + use IssuingCardholderAuthorizationControlsAllowedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for IssuingCardholderAuthorizationControlsAllowedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderAuthorizationControlsAllowedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardholderAuthorizationControlsAllowedCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardholderAuthorizationControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderAuthorizationControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderAuthorizationControlsAllowedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderAuthorizationControlsAllowedCategories { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s) + .unwrap_or(IssuingCardholderAuthorizationControlsAllowedCategories::Unknown)) + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. +/// +/// All other categories will be allowed. +/// Cannot be set with `allowed_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum IssuingCardholderAuthorizationControlsBlockedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl IssuingCardholderAuthorizationControlsBlockedCategories { + pub fn as_str(self) -> &'static str { + use IssuingCardholderAuthorizationControlsBlockedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for IssuingCardholderAuthorizationControlsBlockedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderAuthorizationControlsBlockedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardholderAuthorizationControlsBlockedCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardholderAuthorizationControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderAuthorizationControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderAuthorizationControlsBlockedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderAuthorizationControlsBlockedCategories { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s) + .unwrap_or(IssuingCardholderAuthorizationControlsBlockedCategories::Unknown)) + } +} diff --git a/stripe_types/src/generated/issuing_cardholder_card_issuing/mod.rs b/stripe_types/src/generated/issuing_cardholder_card_issuing/mod.rs new file mode 100644 index 000000000..ff1e0cf8c --- /dev/null +++ b/stripe_types/src/generated/issuing_cardholder_card_issuing/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderCardIssuing { + /// Information about cardholder acceptance of [Authorized User Terms](https://stripe.com/docs/issuing/cards). + pub user_terms_acceptance: Option, +} diff --git a/stripe_types/src/generated/issuing_cardholder_company/mod.rs b/stripe_types/src/generated/issuing_cardholder_company/mod.rs new file mode 100644 index 000000000..b6e397d9d --- /dev/null +++ b/stripe_types/src/generated/issuing_cardholder_company/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderCompany { + /// Whether the company's business ID number was provided. + pub tax_id_provided: bool, +} diff --git a/stripe_types/src/generated/issuing_cardholder_id_document/mod.rs b/stripe_types/src/generated/issuing_cardholder_id_document/mod.rs new file mode 100644 index 000000000..ad4c6dca4 --- /dev/null +++ b/stripe_types/src/generated/issuing_cardholder_id_document/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderIdDocument { + /// The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + pub back: Option>, + /// The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + pub front: Option>, +} diff --git a/stripe_types/src/generated/issuing_cardholder_individual/mod.rs b/stripe_types/src/generated/issuing_cardholder_individual/mod.rs new file mode 100644 index 000000000..1b40756a9 --- /dev/null +++ b/stripe_types/src/generated/issuing_cardholder_individual/mod.rs @@ -0,0 +1,20 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderIndividual { + /// Information related to the card_issuing program for this cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option, + /// The date of birth of this cardholder. + pub dob: Option, + /// The first name of this cardholder. + /// + /// Required before activating Cards. + /// This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. + pub first_name: Option, + /// The last name of this cardholder. + /// + /// Required before activating Cards. + /// This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. + pub last_name: Option, + /// Government-issued ID document for this cardholder. + pub verification: Option, +} diff --git a/stripe_types/src/generated/issuing_cardholder_individual_dob/mod.rs b/stripe_types/src/generated/issuing_cardholder_individual_dob/mod.rs new file mode 100644 index 000000000..285ff4d68 --- /dev/null +++ b/stripe_types/src/generated/issuing_cardholder_individual_dob/mod.rs @@ -0,0 +1,9 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderIndividualDob { + /// The day of birth, between 1 and 31. + pub day: Option, + /// The month of birth, between 1 and 12. + pub month: Option, + /// The four-digit year of birth. + pub year: Option, +} diff --git a/stripe_types/src/generated/issuing_cardholder_requirements/mod.rs b/stripe_types/src/generated/issuing_cardholder_requirements/mod.rs new file mode 100644 index 000000000..f6e8418fd --- /dev/null +++ b/stripe_types/src/generated/issuing_cardholder_requirements/mod.rs @@ -0,0 +1,164 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderRequirements { + /// If `disabled_reason` is present, all cards will decline authorizations with `cardholder_verification_required` reason. + pub disabled_reason: Option, + /// Array of fields that need to be collected in order to verify and re-enable the cardholder. + pub past_due: Option>, +} +/// If `disabled_reason` is present, all cards will decline authorizations with `cardholder_verification_required` reason. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardholderRequirementsDisabledReason { + Listed, + RejectedListed, + RequirementsPastDue, + UnderReview, +} +impl IssuingCardholderRequirementsDisabledReason { + pub fn as_str(self) -> &'static str { + use IssuingCardholderRequirementsDisabledReason::*; + match self { + Listed => "listed", + RejectedListed => "rejected.listed", + RequirementsPastDue => "requirements.past_due", + UnderReview => "under_review", + } + } +} + +impl std::str::FromStr for IssuingCardholderRequirementsDisabledReason { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderRequirementsDisabledReason::*; + match s { + "listed" => Ok(Listed), + "rejected.listed" => Ok(RejectedListed), + "requirements.past_due" => Ok(RequirementsPastDue), + "under_review" => Ok(UnderReview), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardholderRequirementsDisabledReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardholderRequirementsDisabledReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderRequirementsDisabledReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderRequirementsDisabledReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderRequirementsDisabledReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingCardholderRequirementsDisabledReason", + ) + }) + } +} +/// Array of fields that need to be collected in order to verify and re-enable the cardholder. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardholderRequirementsPastDue { + CompanyTaxId, + IndividualCardIssuingUserTermsAcceptanceDate, + IndividualCardIssuingUserTermsAcceptanceIp, + IndividualDobDay, + IndividualDobMonth, + IndividualDobYear, + IndividualFirstName, + IndividualLastName, + IndividualVerificationDocument, +} +impl IssuingCardholderRequirementsPastDue { + pub fn as_str(self) -> &'static str { + use IssuingCardholderRequirementsPastDue::*; + match self { + CompanyTaxId => "company.tax_id", + IndividualCardIssuingUserTermsAcceptanceDate => { + "individual.card_issuing.user_terms_acceptance.date" + } + IndividualCardIssuingUserTermsAcceptanceIp => { + "individual.card_issuing.user_terms_acceptance.ip" + } + IndividualDobDay => "individual.dob.day", + IndividualDobMonth => "individual.dob.month", + IndividualDobYear => "individual.dob.year", + IndividualFirstName => "individual.first_name", + IndividualLastName => "individual.last_name", + IndividualVerificationDocument => "individual.verification.document", + } + } +} + +impl std::str::FromStr for IssuingCardholderRequirementsPastDue { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderRequirementsPastDue::*; + match s { + "company.tax_id" => Ok(CompanyTaxId), + "individual.card_issuing.user_terms_acceptance.date" => { + Ok(IndividualCardIssuingUserTermsAcceptanceDate) + } + "individual.card_issuing.user_terms_acceptance.ip" => { + Ok(IndividualCardIssuingUserTermsAcceptanceIp) + } + "individual.dob.day" => Ok(IndividualDobDay), + "individual.dob.month" => Ok(IndividualDobMonth), + "individual.dob.year" => Ok(IndividualDobYear), + "individual.first_name" => Ok(IndividualFirstName), + "individual.last_name" => Ok(IndividualLastName), + "individual.verification.document" => Ok(IndividualVerificationDocument), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardholderRequirementsPastDue { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardholderRequirementsPastDue { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderRequirementsPastDue { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderRequirementsPastDue { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderRequirementsPastDue { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingCardholderRequirementsPastDue") + }) + } +} diff --git a/stripe_types/src/generated/issuing_cardholder_spending_limit/mod.rs b/stripe_types/src/generated/issuing_cardholder_spending_limit/mod.rs new file mode 100644 index 000000000..cc3929387 --- /dev/null +++ b/stripe_types/src/generated/issuing_cardholder_spending_limit/mod.rs @@ -0,0 +1,1120 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderSpendingLimit { + /// Maximum amount allowed to spend per interval. + /// + /// This amount is in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. + /// + /// Omitting this field will apply the limit to all categories. + pub categories: Option>, + /// Interval (or event) to which the amount applies. + pub interval: IssuingCardholderSpendingLimitInterval, +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. +/// +/// Omitting this field will apply the limit to all categories. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum IssuingCardholderSpendingLimitCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl IssuingCardholderSpendingLimitCategories { + pub fn as_str(self) -> &'static str { + use IssuingCardholderSpendingLimitCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for IssuingCardholderSpendingLimitCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderSpendingLimitCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardholderSpendingLimitCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardholderSpendingLimitCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderSpendingLimitCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderSpendingLimitCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderSpendingLimitCategories { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(IssuingCardholderSpendingLimitCategories::Unknown)) + } +} +/// Interval (or event) to which the amount applies. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardholderSpendingLimitInterval { + AllTime, + Daily, + Monthly, + PerAuthorization, + Weekly, + Yearly, +} +impl IssuingCardholderSpendingLimitInterval { + pub fn as_str(self) -> &'static str { + use IssuingCardholderSpendingLimitInterval::*; + match self { + AllTime => "all_time", + Daily => "daily", + Monthly => "monthly", + PerAuthorization => "per_authorization", + Weekly => "weekly", + Yearly => "yearly", + } + } +} + +impl std::str::FromStr for IssuingCardholderSpendingLimitInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderSpendingLimitInterval::*; + match s { + "all_time" => Ok(AllTime), + "daily" => Ok(Daily), + "monthly" => Ok(Monthly), + "per_authorization" => Ok(PerAuthorization), + "weekly" => Ok(Weekly), + "yearly" => Ok(Yearly), + _ => Err(()), + } + } +} +impl AsRef for IssuingCardholderSpendingLimitInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingCardholderSpendingLimitInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderSpendingLimitInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderSpendingLimitInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderSpendingLimitInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingCardholderSpendingLimitInterval") + }) + } +} diff --git a/stripe_types/src/generated/issuing_cardholder_user_terms_acceptance/mod.rs b/stripe_types/src/generated/issuing_cardholder_user_terms_acceptance/mod.rs new file mode 100644 index 000000000..1bc00f6b6 --- /dev/null +++ b/stripe_types/src/generated/issuing_cardholder_user_terms_acceptance/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderUserTermsAcceptance { + /// The Unix timestamp marking when the cardholder accepted the Authorized User Terms. + /// + /// Required for Celtic Spend Card users. + pub date: Option, + /// The IP address from which the cardholder accepted the Authorized User Terms. + /// + /// Required for Celtic Spend Card users. + pub ip: Option, + /// The user agent of the browser from which the cardholder accepted the Authorized User Terms. + pub user_agent: Option, +} diff --git a/stripe_types/src/generated/issuing_cardholder_verification/mod.rs b/stripe_types/src/generated/issuing_cardholder_verification/mod.rs new file mode 100644 index 000000000..d02b17854 --- /dev/null +++ b/stripe_types/src/generated/issuing_cardholder_verification/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderVerification { + /// An identifying document, either a passport or local ID card. + pub document: Option, +} diff --git a/stripe_types/src/generated/issuing_dispute/mod.rs b/stripe_types/src/generated/issuing_dispute/mod.rs new file mode 100644 index 000000000..11da2ba08 --- /dev/null +++ b/stripe_types/src/generated/issuing_dispute/mod.rs @@ -0,0 +1,111 @@ +/// As a [card issuer](https://stripe.com/docs/issuing), you can dispute transactions that the cardholder does not recognize, suspects to be fraudulent, or has other issues with. +/// +/// Related guide: [Issuing disputes](https://stripe.com/docs/issuing/purchases/disputes) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingDispute { + /// Disputed amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// + /// Usually the amount of the `transaction`, but can differ (usually because of currency fluctuation). + pub amount: i64, + /// List of balance transactions associated with the dispute. + pub balance_transactions: Option>, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The currency the `transaction` was made in. + pub currency: stripe_types::Currency, + pub evidence: stripe_types::IssuingDisputeEvidence, + /// Unique identifier for the object. + pub id: stripe_types::issuing_dispute::IssuingDisputeId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Current status of the dispute. + pub status: IssuingDisputeStatus, + /// The transaction being disputed. + pub transaction: stripe_types::Expandable, + /// [Treasury](https://stripe.com/docs/api/treasury) details related to this dispute if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option, +} +/// Current status of the dispute. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingDisputeStatus { + Expired, + Lost, + Submitted, + Unsubmitted, + Won, +} +impl IssuingDisputeStatus { + pub fn as_str(self) -> &'static str { + use IssuingDisputeStatus::*; + match self { + Expired => "expired", + Lost => "lost", + Submitted => "submitted", + Unsubmitted => "unsubmitted", + Won => "won", + } + } +} + +impl std::str::FromStr for IssuingDisputeStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingDisputeStatus::*; + match s { + "expired" => Ok(Expired), + "lost" => Ok(Lost), + "submitted" => Ok(Submitted), + "unsubmitted" => Ok(Unsubmitted), + "won" => Ok(Won), + _ => Err(()), + } + } +} +impl AsRef for IssuingDisputeStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingDisputeStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingDisputeStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingDisputeStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingDisputeStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingDisputeStatus")) + } +} +impl stripe_types::Object for IssuingDispute { + type Id = stripe_types::issuing_dispute::IssuingDisputeId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(IssuingDisputeId, "idp_"); diff --git a/stripe_types/src/generated/issuing_dispute_canceled_evidence/mod.rs b/stripe_types/src/generated/issuing_dispute_canceled_evidence/mod.rs new file mode 100644 index 000000000..7a34c3ca3 --- /dev/null +++ b/stripe_types/src/generated/issuing_dispute_canceled_evidence/mod.rs @@ -0,0 +1,143 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeCanceledEvidence { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + pub additional_documentation: Option>, + /// Date when order was canceled. + pub canceled_at: Option, + /// Whether the cardholder was provided with a cancellation policy. + pub cancellation_policy_provided: Option, + /// Reason for canceling the order. + pub cancellation_reason: Option, + /// Date when the cardholder expected to receive the product. + pub expected_at: Option, + /// Explanation of why the cardholder is disputing this transaction. + pub explanation: Option, + /// Description of the merchandise or service that was purchased. + pub product_description: Option, + /// Whether the product was a merchandise or service. + pub product_type: Option, + /// Result of cardholder's attempt to return the product. + pub return_status: Option, + /// Date when the product was returned or attempted to be returned. + pub returned_at: Option, +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingDisputeCanceledEvidenceProductType { + Merchandise, + Service, +} +impl IssuingDisputeCanceledEvidenceProductType { + pub fn as_str(self) -> &'static str { + use IssuingDisputeCanceledEvidenceProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for IssuingDisputeCanceledEvidenceProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingDisputeCanceledEvidenceProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl AsRef for IssuingDisputeCanceledEvidenceProductType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingDisputeCanceledEvidenceProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingDisputeCanceledEvidenceProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingDisputeCanceledEvidenceProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingDisputeCanceledEvidenceProductType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingDisputeCanceledEvidenceProductType") + }) + } +} +/// Result of cardholder's attempt to return the product. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingDisputeCanceledEvidenceReturnStatus { + MerchantRejected, + Successful, +} +impl IssuingDisputeCanceledEvidenceReturnStatus { + pub fn as_str(self) -> &'static str { + use IssuingDisputeCanceledEvidenceReturnStatus::*; + match self { + MerchantRejected => "merchant_rejected", + Successful => "successful", + } + } +} + +impl std::str::FromStr for IssuingDisputeCanceledEvidenceReturnStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingDisputeCanceledEvidenceReturnStatus::*; + match s { + "merchant_rejected" => Ok(MerchantRejected), + "successful" => Ok(Successful), + _ => Err(()), + } + } +} +impl AsRef for IssuingDisputeCanceledEvidenceReturnStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingDisputeCanceledEvidenceReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingDisputeCanceledEvidenceReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingDisputeCanceledEvidenceReturnStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingDisputeCanceledEvidenceReturnStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingDisputeCanceledEvidenceReturnStatus") + }) + } +} diff --git a/stripe_types/src/generated/issuing_dispute_duplicate_evidence/mod.rs b/stripe_types/src/generated/issuing_dispute_duplicate_evidence/mod.rs new file mode 100644 index 000000000..e28c32d01 --- /dev/null +++ b/stripe_types/src/generated/issuing_dispute_duplicate_evidence/mod.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeDuplicateEvidence { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + pub additional_documentation: Option>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. + pub card_statement: Option>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. + pub cash_receipt: Option>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. + pub check_image: Option>, + /// Explanation of why the cardholder is disputing this transaction. + pub explanation: Option, + /// Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. + /// + /// Of the two or more transactions that are copies of each other, this is original undisputed one. + pub original_transaction: Option, +} diff --git a/stripe_types/src/generated/issuing_dispute_evidence/mod.rs b/stripe_types/src/generated/issuing_dispute_evidence/mod.rs new file mode 100644 index 000000000..a4730aa12 --- /dev/null +++ b/stripe_types/src/generated/issuing_dispute_evidence/mod.rs @@ -0,0 +1,98 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeEvidence { + #[serde(skip_serializing_if = "Option::is_none")] + pub canceled: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub duplicate: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fraudulent: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub merchandise_not_as_described: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub not_received: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub other: Option, + /// The reason for filing the dispute. + /// + /// Its value will match the field containing the evidence. + pub reason: IssuingDisputeEvidenceReason, + #[serde(skip_serializing_if = "Option::is_none")] + pub service_not_as_described: Option, +} +/// The reason for filing the dispute. +/// +/// Its value will match the field containing the evidence. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingDisputeEvidenceReason { + Canceled, + Duplicate, + Fraudulent, + MerchandiseNotAsDescribed, + NotReceived, + Other, + ServiceNotAsDescribed, +} +impl IssuingDisputeEvidenceReason { + pub fn as_str(self) -> &'static str { + use IssuingDisputeEvidenceReason::*; + match self { + Canceled => "canceled", + Duplicate => "duplicate", + Fraudulent => "fraudulent", + MerchandiseNotAsDescribed => "merchandise_not_as_described", + NotReceived => "not_received", + Other => "other", + ServiceNotAsDescribed => "service_not_as_described", + } + } +} + +impl std::str::FromStr for IssuingDisputeEvidenceReason { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingDisputeEvidenceReason::*; + match s { + "canceled" => Ok(Canceled), + "duplicate" => Ok(Duplicate), + "fraudulent" => Ok(Fraudulent), + "merchandise_not_as_described" => Ok(MerchandiseNotAsDescribed), + "not_received" => Ok(NotReceived), + "other" => Ok(Other), + "service_not_as_described" => Ok(ServiceNotAsDescribed), + _ => Err(()), + } + } +} +impl AsRef for IssuingDisputeEvidenceReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingDisputeEvidenceReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingDisputeEvidenceReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingDisputeEvidenceReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingDisputeEvidenceReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingDisputeEvidenceReason")) + } +} diff --git a/stripe_types/src/generated/issuing_dispute_fraudulent_evidence/mod.rs b/stripe_types/src/generated/issuing_dispute_fraudulent_evidence/mod.rs new file mode 100644 index 000000000..55df3e531 --- /dev/null +++ b/stripe_types/src/generated/issuing_dispute_fraudulent_evidence/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeFraudulentEvidence { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + pub additional_documentation: Option>, + /// Explanation of why the cardholder is disputing this transaction. + pub explanation: Option, +} diff --git a/stripe_types/src/generated/issuing_dispute_merchandise_not_as_described_evidence/mod.rs b/stripe_types/src/generated/issuing_dispute_merchandise_not_as_described_evidence/mod.rs new file mode 100644 index 000000000..0f3c9d1bc --- /dev/null +++ b/stripe_types/src/generated/issuing_dispute_merchandise_not_as_described_evidence/mod.rs @@ -0,0 +1,77 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeMerchandiseNotAsDescribedEvidence { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + pub additional_documentation: Option>, + /// Explanation of why the cardholder is disputing this transaction. + pub explanation: Option, + /// Date when the product was received. + pub received_at: Option, + /// Description of the cardholder's attempt to return the product. + pub return_description: Option, + /// Result of cardholder's attempt to return the product. + pub return_status: Option, + /// Date when the product was returned or attempted to be returned. + pub returned_at: Option, +} +/// Result of cardholder's attempt to return the product. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { + MerchantRejected, + Successful, +} +impl IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { + pub fn as_str(self) -> &'static str { + use IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus::*; + match self { + MerchantRejected => "merchant_rejected", + Successful => "successful", + } + } +} + +impl std::str::FromStr for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus::*; + match s { + "merchant_rejected" => Ok(MerchantRejected), + "successful" => Ok(Successful), + _ => Err(()), + } + } +} +impl AsRef for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus", + ) + }) + } +} diff --git a/stripe_types/src/generated/issuing_dispute_not_received_evidence/mod.rs b/stripe_types/src/generated/issuing_dispute_not_received_evidence/mod.rs new file mode 100644 index 000000000..8020a247a --- /dev/null +++ b/stripe_types/src/generated/issuing_dispute_not_received_evidence/mod.rs @@ -0,0 +1,75 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeNotReceivedEvidence { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + pub additional_documentation: Option>, + /// Date when the cardholder expected to receive the product. + pub expected_at: Option, + /// Explanation of why the cardholder is disputing this transaction. + pub explanation: Option, + /// Description of the merchandise or service that was purchased. + pub product_description: Option, + /// Whether the product was a merchandise or service. + pub product_type: Option, +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingDisputeNotReceivedEvidenceProductType { + Merchandise, + Service, +} +impl IssuingDisputeNotReceivedEvidenceProductType { + pub fn as_str(self) -> &'static str { + use IssuingDisputeNotReceivedEvidenceProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for IssuingDisputeNotReceivedEvidenceProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingDisputeNotReceivedEvidenceProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl AsRef for IssuingDisputeNotReceivedEvidenceProductType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingDisputeNotReceivedEvidenceProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingDisputeNotReceivedEvidenceProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingDisputeNotReceivedEvidenceProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingDisputeNotReceivedEvidenceProductType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingDisputeNotReceivedEvidenceProductType", + ) + }) + } +} diff --git a/stripe_types/src/generated/issuing_dispute_other_evidence/mod.rs b/stripe_types/src/generated/issuing_dispute_other_evidence/mod.rs new file mode 100644 index 000000000..937e1f0f8 --- /dev/null +++ b/stripe_types/src/generated/issuing_dispute_other_evidence/mod.rs @@ -0,0 +1,71 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeOtherEvidence { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + pub additional_documentation: Option>, + /// Explanation of why the cardholder is disputing this transaction. + pub explanation: Option, + /// Description of the merchandise or service that was purchased. + pub product_description: Option, + /// Whether the product was a merchandise or service. + pub product_type: Option, +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingDisputeOtherEvidenceProductType { + Merchandise, + Service, +} +impl IssuingDisputeOtherEvidenceProductType { + pub fn as_str(self) -> &'static str { + use IssuingDisputeOtherEvidenceProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for IssuingDisputeOtherEvidenceProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingDisputeOtherEvidenceProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl AsRef for IssuingDisputeOtherEvidenceProductType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingDisputeOtherEvidenceProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingDisputeOtherEvidenceProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingDisputeOtherEvidenceProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingDisputeOtherEvidenceProductType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingDisputeOtherEvidenceProductType") + }) + } +} diff --git a/stripe_types/src/generated/issuing_dispute_service_not_as_described_evidence/mod.rs b/stripe_types/src/generated/issuing_dispute_service_not_as_described_evidence/mod.rs new file mode 100644 index 000000000..8b640af37 --- /dev/null +++ b/stripe_types/src/generated/issuing_dispute_service_not_as_described_evidence/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeServiceNotAsDescribedEvidence { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + pub additional_documentation: Option>, + /// Date when order was canceled. + pub canceled_at: Option, + /// Reason for canceling the order. + pub cancellation_reason: Option, + /// Explanation of why the cardholder is disputing this transaction. + pub explanation: Option, + /// Date when the product was received. + pub received_at: Option, +} diff --git a/stripe_types/src/generated/issuing_dispute_treasury/mod.rs b/stripe_types/src/generated/issuing_dispute_treasury/mod.rs new file mode 100644 index 000000000..dcdb0485d --- /dev/null +++ b/stripe_types/src/generated/issuing_dispute_treasury/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeTreasury { + /// The Treasury [DebitReversal](https://stripe.com/docs/api/treasury/debit_reversals) representing this Issuing dispute. + pub debit_reversal: Option, + /// The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_debits) that is being disputed. + pub received_debit: String, +} diff --git a/stripe_types/src/generated/issuing_network_token/mod.rs b/stripe_types/src/generated/issuing_network_token/mod.rs new file mode 100644 index 000000000..cd85dffe6 --- /dev/null +++ b/stripe_types/src/generated/issuing_network_token/mod.rs @@ -0,0 +1,228 @@ +/// An issuing token object is created when an issued card is added to a digital wallet. +/// +/// As a [card issuer](https://stripe.com/docs/issuing), you can [view and manage these tokens](https://stripe.com/docs/issuing/controls/token-management) through Stripe. For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingNetworkToken { + /// Card associated with this token. + pub card: stripe_types::Expandable, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The hashed ID derived from the device ID from the card network associated with the token. + pub device_fingerprint: Option, + /// Unique identifier for the object. + pub id: stripe_types::issuing_network_token::IssuingTokenId, + /// The last four digits of the token. + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The token service provider / card network associated with the token. + pub network: IssuingNetworkTokenNetwork, + #[serde(skip_serializing_if = "Option::is_none")] + pub network_data: Option, + /// Time at which the token was last updated by the card network. + /// + /// Measured in seconds since the Unix epoch. + pub network_updated_at: stripe_types::Timestamp, + /// The usage state of the token. + pub status: IssuingNetworkTokenStatus, + /// The digital wallet for this token, if one was used. + #[serde(skip_serializing_if = "Option::is_none")] + pub wallet_provider: Option, +} +/// The token service provider / card network associated with the token. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingNetworkTokenNetwork { + Mastercard, + Visa, +} +impl IssuingNetworkTokenNetwork { + pub fn as_str(self) -> &'static str { + use IssuingNetworkTokenNetwork::*; + match self { + Mastercard => "mastercard", + Visa => "visa", + } + } +} + +impl std::str::FromStr for IssuingNetworkTokenNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingNetworkTokenNetwork::*; + match s { + "mastercard" => Ok(Mastercard), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl AsRef for IssuingNetworkTokenNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingNetworkTokenNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingNetworkTokenNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingNetworkTokenNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingNetworkTokenNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingNetworkTokenNetwork")) + } +} +/// The usage state of the token. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingNetworkTokenStatus { + Active, + Deleted, + Requested, + Suspended, +} +impl IssuingNetworkTokenStatus { + pub fn as_str(self) -> &'static str { + use IssuingNetworkTokenStatus::*; + match self { + Active => "active", + Deleted => "deleted", + Requested => "requested", + Suspended => "suspended", + } + } +} + +impl std::str::FromStr for IssuingNetworkTokenStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingNetworkTokenStatus::*; + match s { + "active" => Ok(Active), + "deleted" => Ok(Deleted), + "requested" => Ok(Requested), + "suspended" => Ok(Suspended), + _ => Err(()), + } + } +} +impl AsRef for IssuingNetworkTokenStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingNetworkTokenStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingNetworkTokenStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingNetworkTokenStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingNetworkTokenStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingNetworkTokenStatus")) + } +} +/// The digital wallet for this token, if one was used. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingNetworkTokenWalletProvider { + ApplePay, + GooglePay, + SamsungPay, +} +impl IssuingNetworkTokenWalletProvider { + pub fn as_str(self) -> &'static str { + use IssuingNetworkTokenWalletProvider::*; + match self { + ApplePay => "apple_pay", + GooglePay => "google_pay", + SamsungPay => "samsung_pay", + } + } +} + +impl std::str::FromStr for IssuingNetworkTokenWalletProvider { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingNetworkTokenWalletProvider::*; + match s { + "apple_pay" => Ok(ApplePay), + "google_pay" => Ok(GooglePay), + "samsung_pay" => Ok(SamsungPay), + _ => Err(()), + } + } +} +impl AsRef for IssuingNetworkTokenWalletProvider { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingNetworkTokenWalletProvider { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingNetworkTokenWalletProvider { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingNetworkTokenWalletProvider { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingNetworkTokenWalletProvider { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingNetworkTokenWalletProvider") + }) + } +} +impl stripe_types::Object for IssuingNetworkToken { + type Id = stripe_types::issuing_network_token::IssuingTokenId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(IssuingTokenId); diff --git a/stripe_types/src/generated/issuing_network_token_address/mod.rs b/stripe_types/src/generated/issuing_network_token_address/mod.rs new file mode 100644 index 000000000..942291828 --- /dev/null +++ b/stripe_types/src/generated/issuing_network_token_address/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingNetworkTokenAddress { + /// The street address of the cardholder tokenizing the card. + pub line1: String, + /// The postal code of the cardholder tokenizing the card. + pub postal_code: String, +} diff --git a/stripe_types/src/generated/issuing_network_token_device/mod.rs b/stripe_types/src/generated/issuing_network_token_device/mod.rs new file mode 100644 index 000000000..bade9cfc9 --- /dev/null +++ b/stripe_types/src/generated/issuing_network_token_device/mod.rs @@ -0,0 +1,87 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingNetworkTokenDevice { + /// An obfuscated ID derived from the device ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub device_fingerprint: Option, + /// The IP address of the device at provisioning time. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_address: Option, + /// The geographic latitude/longitude coordinates of the device at provisioning time. + /// + /// The format is [+-]decimal/[+-]decimal. + #[serde(skip_serializing_if = "Option::is_none")] + pub location: Option, + /// The name of the device used for tokenization. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + /// The phone number of the device used for tokenization. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_number: Option, + /// The type of device used for tokenization. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +/// The type of device used for tokenization. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingNetworkTokenDeviceType { + Other, + Phone, + Watch, +} +impl IssuingNetworkTokenDeviceType { + pub fn as_str(self) -> &'static str { + use IssuingNetworkTokenDeviceType::*; + match self { + Other => "other", + Phone => "phone", + Watch => "watch", + } + } +} + +impl std::str::FromStr for IssuingNetworkTokenDeviceType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingNetworkTokenDeviceType::*; + match s { + "other" => Ok(Other), + "phone" => Ok(Phone), + "watch" => Ok(Watch), + _ => Err(()), + } + } +} +impl AsRef for IssuingNetworkTokenDeviceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingNetworkTokenDeviceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingNetworkTokenDeviceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingNetworkTokenDeviceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingNetworkTokenDeviceType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingNetworkTokenDeviceType") + }) + } +} diff --git a/stripe_types/src/generated/issuing_network_token_mastercard/mod.rs b/stripe_types/src/generated/issuing_network_token_mastercard/mod.rs new file mode 100644 index 000000000..4ffcd70da --- /dev/null +++ b/stripe_types/src/generated/issuing_network_token_mastercard/mod.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingNetworkTokenMastercard { + /// A unique reference ID from MasterCard to represent the card account number. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_reference_id: Option, + /// The network-unique identifier for the token. + pub token_reference_id: String, + /// The ID of the entity requesting tokenization, specific to MasterCard. + pub token_requestor_id: String, + /// The name of the entity requesting tokenization, if known. + /// + /// This is directly provided from MasterCard. + #[serde(skip_serializing_if = "Option::is_none")] + pub token_requestor_name: Option, +} diff --git a/stripe_types/src/generated/issuing_network_token_network_data/mod.rs b/stripe_types/src/generated/issuing_network_token_network_data/mod.rs new file mode 100644 index 000000000..c83156d52 --- /dev/null +++ b/stripe_types/src/generated/issuing_network_token_network_data/mod.rs @@ -0,0 +1,78 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingNetworkTokenNetworkData { + #[serde(skip_serializing_if = "Option::is_none")] + pub device: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mastercard: Option, + /// The network that the token is associated with. + /// + /// An additional hash is included with a name matching this value, containing tokenization data specific to the card network. + #[serde(rename = "type")] + pub type_: IssuingNetworkTokenNetworkDataType, + #[serde(skip_serializing_if = "Option::is_none")] + pub visa: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wallet_provider: Option, +} +/// The network that the token is associated with. +/// +/// An additional hash is included with a name matching this value, containing tokenization data specific to the card network. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingNetworkTokenNetworkDataType { + Mastercard, + Visa, +} +impl IssuingNetworkTokenNetworkDataType { + pub fn as_str(self) -> &'static str { + use IssuingNetworkTokenNetworkDataType::*; + match self { + Mastercard => "mastercard", + Visa => "visa", + } + } +} + +impl std::str::FromStr for IssuingNetworkTokenNetworkDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingNetworkTokenNetworkDataType::*; + match s { + "mastercard" => Ok(Mastercard), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl AsRef for IssuingNetworkTokenNetworkDataType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingNetworkTokenNetworkDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingNetworkTokenNetworkDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingNetworkTokenNetworkDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingNetworkTokenNetworkDataType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingNetworkTokenNetworkDataType") + }) + } +} diff --git a/stripe_types/src/generated/issuing_network_token_visa/mod.rs b/stripe_types/src/generated/issuing_network_token_visa/mod.rs new file mode 100644 index 000000000..abf12e44d --- /dev/null +++ b/stripe_types/src/generated/issuing_network_token_visa/mod.rs @@ -0,0 +1,14 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingNetworkTokenVisa { + /// A unique reference ID from Visa to represent the card account number. + pub card_reference_id: String, + /// The network-unique identifier for the token. + pub token_reference_id: String, + /// The ID of the entity requesting tokenization, specific to Visa. + pub token_requestor_id: String, + /// Degree of risk associated with the token between `01` and `99`, with higher number indicating higher risk. + /// + /// A `00` value indicates the token was not scored by Visa. + #[serde(skip_serializing_if = "Option::is_none")] + pub token_risk_score: Option, +} diff --git a/stripe_types/src/generated/issuing_network_token_wallet_provider/mod.rs b/stripe_types/src/generated/issuing_network_token_wallet_provider/mod.rs new file mode 100644 index 000000000..b239bb733 --- /dev/null +++ b/stripe_types/src/generated/issuing_network_token_wallet_provider/mod.rs @@ -0,0 +1,317 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingNetworkTokenWalletProvider { + /// The wallet provider-given account ID of the digital wallet the token belongs to. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_id: Option, + /// An evaluation on the trustworthiness of the wallet account between 1 and 5. + /// + /// A higher score indicates more trustworthy. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_trust_score: Option, + /// The method used for tokenizing a card. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_number_source: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cardholder_address: Option, + /// The name of the cardholder tokenizing the card. + #[serde(skip_serializing_if = "Option::is_none")] + pub cardholder_name: Option, + /// An evaluation on the trustworthiness of the device. + /// + /// A higher score indicates more trustworthy. + #[serde(skip_serializing_if = "Option::is_none")] + pub device_trust_score: Option, + /// The hashed email address of the cardholder's account with the wallet provider. + #[serde(skip_serializing_if = "Option::is_none")] + pub hashed_account_email_address: Option, + /// The reasons for suggested tokenization given by the card network. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason_codes: Option>, + /// The recommendation on responding to the tokenization request. + #[serde(skip_serializing_if = "Option::is_none")] + pub suggested_decision: Option, + /// The version of the standard for mapping reason codes followed by the wallet provider. + #[serde(skip_serializing_if = "Option::is_none")] + pub suggested_decision_version: Option, +} +/// The method used for tokenizing a card. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingNetworkTokenWalletProviderCardNumberSource { + App, + Manual, + OnFile, + Other, +} +impl IssuingNetworkTokenWalletProviderCardNumberSource { + pub fn as_str(self) -> &'static str { + use IssuingNetworkTokenWalletProviderCardNumberSource::*; + match self { + App => "app", + Manual => "manual", + OnFile => "on_file", + Other => "other", + } + } +} + +impl std::str::FromStr for IssuingNetworkTokenWalletProviderCardNumberSource { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingNetworkTokenWalletProviderCardNumberSource::*; + match s { + "app" => Ok(App), + "manual" => Ok(Manual), + "on_file" => Ok(OnFile), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl AsRef for IssuingNetworkTokenWalletProviderCardNumberSource { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingNetworkTokenWalletProviderCardNumberSource { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingNetworkTokenWalletProviderCardNumberSource { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingNetworkTokenWalletProviderCardNumberSource { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingNetworkTokenWalletProviderCardNumberSource { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingNetworkTokenWalletProviderCardNumberSource", + ) + }) + } +} +/// The reasons for suggested tokenization given by the card network. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum IssuingNetworkTokenWalletProviderReasonCodes { + AccountCardTooNew, + AccountRecentlyChanged, + AccountTooNew, + AccountTooNewSinceLaunch, + AdditionalDevice, + DataExpired, + DeferIdVDecision, + DeviceRecentlyLost, + GoodActivityHistory, + HasSuspendedTokens, + HighRisk, + InactiveAccount, + LongAccountTenure, + LowAccountScore, + LowDeviceScore, + LowPhoneNumberScore, + NetworkServiceError, + OutsideHomeTerritory, + ProvisioningCardholderMismatch, + ProvisioningDeviceAndCardholderMismatch, + ProvisioningDeviceMismatch, + SameDeviceNoPriorAuthentication, + SameDeviceSuccessfulPriorAuthentication, + SoftwareUpdate, + SuspiciousActivity, + TooManyDifferentCardholders, + TooManyRecentAttempts, + TooManyRecentTokens, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl IssuingNetworkTokenWalletProviderReasonCodes { + pub fn as_str(self) -> &'static str { + use IssuingNetworkTokenWalletProviderReasonCodes::*; + match self { + AccountCardTooNew => "account_card_too_new", + AccountRecentlyChanged => "account_recently_changed", + AccountTooNew => "account_too_new", + AccountTooNewSinceLaunch => "account_too_new_since_launch", + AdditionalDevice => "additional_device", + DataExpired => "data_expired", + DeferIdVDecision => "defer_id_v_decision", + DeviceRecentlyLost => "device_recently_lost", + GoodActivityHistory => "good_activity_history", + HasSuspendedTokens => "has_suspended_tokens", + HighRisk => "high_risk", + InactiveAccount => "inactive_account", + LongAccountTenure => "long_account_tenure", + LowAccountScore => "low_account_score", + LowDeviceScore => "low_device_score", + LowPhoneNumberScore => "low_phone_number_score", + NetworkServiceError => "network_service_error", + OutsideHomeTerritory => "outside_home_territory", + ProvisioningCardholderMismatch => "provisioning_cardholder_mismatch", + ProvisioningDeviceAndCardholderMismatch => { + "provisioning_device_and_cardholder_mismatch" + } + ProvisioningDeviceMismatch => "provisioning_device_mismatch", + SameDeviceNoPriorAuthentication => "same_device_no_prior_authentication", + SameDeviceSuccessfulPriorAuthentication => { + "same_device_successful_prior_authentication" + } + SoftwareUpdate => "software_update", + SuspiciousActivity => "suspicious_activity", + TooManyDifferentCardholders => "too_many_different_cardholders", + TooManyRecentAttempts => "too_many_recent_attempts", + TooManyRecentTokens => "too_many_recent_tokens", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for IssuingNetworkTokenWalletProviderReasonCodes { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingNetworkTokenWalletProviderReasonCodes::*; + match s { + "account_card_too_new" => Ok(AccountCardTooNew), + "account_recently_changed" => Ok(AccountRecentlyChanged), + "account_too_new" => Ok(AccountTooNew), + "account_too_new_since_launch" => Ok(AccountTooNewSinceLaunch), + "additional_device" => Ok(AdditionalDevice), + "data_expired" => Ok(DataExpired), + "defer_id_v_decision" => Ok(DeferIdVDecision), + "device_recently_lost" => Ok(DeviceRecentlyLost), + "good_activity_history" => Ok(GoodActivityHistory), + "has_suspended_tokens" => Ok(HasSuspendedTokens), + "high_risk" => Ok(HighRisk), + "inactive_account" => Ok(InactiveAccount), + "long_account_tenure" => Ok(LongAccountTenure), + "low_account_score" => Ok(LowAccountScore), + "low_device_score" => Ok(LowDeviceScore), + "low_phone_number_score" => Ok(LowPhoneNumberScore), + "network_service_error" => Ok(NetworkServiceError), + "outside_home_territory" => Ok(OutsideHomeTerritory), + "provisioning_cardholder_mismatch" => Ok(ProvisioningCardholderMismatch), + "provisioning_device_and_cardholder_mismatch" => { + Ok(ProvisioningDeviceAndCardholderMismatch) + } + "provisioning_device_mismatch" => Ok(ProvisioningDeviceMismatch), + "same_device_no_prior_authentication" => Ok(SameDeviceNoPriorAuthentication), + "same_device_successful_prior_authentication" => { + Ok(SameDeviceSuccessfulPriorAuthentication) + } + "software_update" => Ok(SoftwareUpdate), + "suspicious_activity" => Ok(SuspiciousActivity), + "too_many_different_cardholders" => Ok(TooManyDifferentCardholders), + "too_many_recent_attempts" => Ok(TooManyRecentAttempts), + "too_many_recent_tokens" => Ok(TooManyRecentTokens), + _ => Err(()), + } + } +} +impl AsRef for IssuingNetworkTokenWalletProviderReasonCodes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingNetworkTokenWalletProviderReasonCodes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingNetworkTokenWalletProviderReasonCodes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingNetworkTokenWalletProviderReasonCodes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingNetworkTokenWalletProviderReasonCodes { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(IssuingNetworkTokenWalletProviderReasonCodes::Unknown)) + } +} +/// The recommendation on responding to the tokenization request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingNetworkTokenWalletProviderSuggestedDecision { + Approve, + Decline, + RequireAuth, +} +impl IssuingNetworkTokenWalletProviderSuggestedDecision { + pub fn as_str(self) -> &'static str { + use IssuingNetworkTokenWalletProviderSuggestedDecision::*; + match self { + Approve => "approve", + Decline => "decline", + RequireAuth => "require_auth", + } + } +} + +impl std::str::FromStr for IssuingNetworkTokenWalletProviderSuggestedDecision { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingNetworkTokenWalletProviderSuggestedDecision::*; + match s { + "approve" => Ok(Approve), + "decline" => Ok(Decline), + "require_auth" => Ok(RequireAuth), + _ => Err(()), + } + } +} +impl AsRef for IssuingNetworkTokenWalletProviderSuggestedDecision { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingNetworkTokenWalletProviderSuggestedDecision { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingNetworkTokenWalletProviderSuggestedDecision { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingNetworkTokenWalletProviderSuggestedDecision { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingNetworkTokenWalletProviderSuggestedDecision { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingNetworkTokenWalletProviderSuggestedDecision", + ) + }) + } +} diff --git a/stripe_types/src/generated/issuing_transaction/mod.rs b/stripe_types/src/generated/issuing_transaction/mod.rs new file mode 100644 index 000000000..8e7259769 --- /dev/null +++ b/stripe_types/src/generated/issuing_transaction/mod.rs @@ -0,0 +1,200 @@ +/// Any use of an [issued card](https://stripe.com/docs/issuing) that results in funds entering or leaving +/// your Stripe account, such as a completed purchase or refund, is represented by an Issuing +/// `Transaction` object. +/// +/// Related guide: [Issued card transactions](https://stripe.com/docs/issuing/purchases/transactions) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransaction { + /// The transaction amount, which will be reflected in your balance. + /// + /// This amount is in your currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Detailed breakdown of amount components. + /// + /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount_details: Option, + /// The `Authorization` object that led to this transaction. + pub authorization: Option>, + /// ID of the [balance transaction](https://stripe.com/docs/api/balance_transactions) associated with this transaction. + pub balance_transaction: Option>, + /// The card used to make this transaction. + pub card: stripe_types::Expandable, + /// The cardholder to whom this transaction belongs. + pub cardholder: Option>, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// If you've disputed the transaction, the ID of the dispute. + pub dispute: Option>, + /// Unique identifier for the object. + pub id: stripe_types::issuing_transaction::IssuingTransactionId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The amount that the merchant will receive, denominated in `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// + /// It will be different from `amount` if the merchant is taking payment in a different currency. + pub merchant_amount: i64, + /// The currency with which the merchant is taking payment. + pub merchant_currency: stripe_types::Currency, + pub merchant_data: stripe_types::IssuingAuthorizationMerchantData, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Details about the transaction, such as processing dates, set by the card network. + pub network_data: Option, + /// Additional purchase information that is optionally provided by the merchant. + pub purchase_details: Option, + /// [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this transaction. + /// + /// If a network token was not used for this transaction, this field will be null. + #[serde(skip_serializing_if = "Option::is_none")] + pub token: Option>, + /// [Treasury](https://stripe.com/docs/api/treasury) details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option, + /// The nature of the transaction. + #[serde(rename = "type")] + pub type_: IssuingTransactionType, + /// The digital wallet used for this transaction. + /// + /// One of `apple_pay`, `google_pay`, or `samsung_pay`. + pub wallet: Option, +} +/// The nature of the transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingTransactionType { + Capture, + Refund, +} +impl IssuingTransactionType { + pub fn as_str(self) -> &'static str { + use IssuingTransactionType::*; + match self { + Capture => "capture", + Refund => "refund", + } + } +} + +impl std::str::FromStr for IssuingTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingTransactionType::*; + match s { + "capture" => Ok(Capture), + "refund" => Ok(Refund), + _ => Err(()), + } + } +} +impl AsRef for IssuingTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingTransactionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingTransactionType")) + } +} +/// The digital wallet used for this transaction. +/// +/// One of `apple_pay`, `google_pay`, or `samsung_pay`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingTransactionWallet { + ApplePay, + GooglePay, + SamsungPay, +} +impl IssuingTransactionWallet { + pub fn as_str(self) -> &'static str { + use IssuingTransactionWallet::*; + match self { + ApplePay => "apple_pay", + GooglePay => "google_pay", + SamsungPay => "samsung_pay", + } + } +} + +impl std::str::FromStr for IssuingTransactionWallet { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingTransactionWallet::*; + match s { + "apple_pay" => Ok(ApplePay), + "google_pay" => Ok(GooglePay), + "samsung_pay" => Ok(SamsungPay), + _ => Err(()), + } + } +} +impl AsRef for IssuingTransactionWallet { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for IssuingTransactionWallet { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingTransactionWallet { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingTransactionWallet { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingTransactionWallet { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingTransactionWallet")) + } +} +impl stripe_types::Object for IssuingTransaction { + type Id = stripe_types::issuing_transaction::IssuingTransactionId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(IssuingTransactionId, "ipi_"); diff --git a/stripe_types/src/generated/issuing_transaction_amount_details/mod.rs b/stripe_types/src/generated/issuing_transaction_amount_details/mod.rs new file mode 100644 index 000000000..8c5db148b --- /dev/null +++ b/stripe_types/src/generated/issuing_transaction_amount_details/mod.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionAmountDetails { + /// The fee charged by the ATM for the cash withdrawal. + pub atm_fee: Option, + /// The amount of cash requested by the cardholder. + pub cashback_amount: Option, +} diff --git a/stripe_types/src/generated/issuing_transaction_flight_data/mod.rs b/stripe_types/src/generated/issuing_transaction_flight_data/mod.rs new file mode 100644 index 000000000..f22593d92 --- /dev/null +++ b/stripe_types/src/generated/issuing_transaction_flight_data/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionFlightData { + /// The time that the flight departed. + pub departure_at: Option, + /// The name of the passenger. + pub passenger_name: Option, + /// Whether the ticket is refundable. + pub refundable: Option, + /// The legs of the trip. + pub segments: Option>, + /// The travel agency that issued the ticket. + pub travel_agency: Option, +} diff --git a/stripe_types/src/generated/issuing_transaction_flight_data_leg/mod.rs b/stripe_types/src/generated/issuing_transaction_flight_data_leg/mod.rs new file mode 100644 index 000000000..18571a91d --- /dev/null +++ b/stripe_types/src/generated/issuing_transaction_flight_data_leg/mod.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionFlightDataLeg { + /// The three-letter IATA airport code of the flight's destination. + pub arrival_airport_code: Option, + /// The airline carrier code. + pub carrier: Option, + /// The three-letter IATA airport code that the flight departed from. + pub departure_airport_code: Option, + /// The flight number. + pub flight_number: Option, + /// The flight's service class. + pub service_class: Option, + /// Whether a stopover is allowed on this flight. + pub stopover_allowed: Option, +} diff --git a/stripe_types/src/generated/issuing_transaction_fuel_data/mod.rs b/stripe_types/src/generated/issuing_transaction_fuel_data/mod.rs new file mode 100644 index 000000000..3d2c3d123 --- /dev/null +++ b/stripe_types/src/generated/issuing_transaction_fuel_data/mod.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionFuelData { + /// The type of fuel that was purchased. + /// + /// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. + #[serde(rename = "type")] + pub type_: String, + /// The units for `volume_decimal`. + /// + /// One of `us_gallon` or `liter`. + pub unit: String, + /// The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + pub unit_cost_decimal: String, + /// The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. + pub volume_decimal: Option, +} diff --git a/stripe_types/src/generated/issuing_transaction_lodging_data/mod.rs b/stripe_types/src/generated/issuing_transaction_lodging_data/mod.rs new file mode 100644 index 000000000..cc69c37f7 --- /dev/null +++ b/stripe_types/src/generated/issuing_transaction_lodging_data/mod.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionLodgingData { + /// The time of checking into the lodging. + pub check_in_at: Option, + /// The number of nights stayed at the lodging. + pub nights: Option, +} diff --git a/stripe_types/src/generated/issuing_transaction_network_data/mod.rs b/stripe_types/src/generated/issuing_transaction_network_data/mod.rs new file mode 100644 index 000000000..0471f43cb --- /dev/null +++ b/stripe_types/src/generated/issuing_transaction_network_data/mod.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionNetworkData { + /// A code created by Stripe which is shared with the merchant to validate the authorization. + /// + /// This field will be populated if the authorization message was approved. + /// The code typically starts with the letter "S", followed by a six-digit number. + /// For example, "S498162". + /// Please note that the code is not guaranteed to be unique across authorizations. + pub authorization_code: Option, + /// The date the transaction was processed by the card network. + /// + /// This can be different from the date the seller recorded the transaction depending on when the acquirer submits the transaction to the network. + pub processing_date: Option, + /// Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions. + pub transaction_id: Option, +} diff --git a/stripe_types/src/generated/issuing_transaction_purchase_details/mod.rs b/stripe_types/src/generated/issuing_transaction_purchase_details/mod.rs new file mode 100644 index 000000000..0d9a12468 --- /dev/null +++ b/stripe_types/src/generated/issuing_transaction_purchase_details/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionPurchaseDetails { + /// Information about the flight that was purchased with this transaction. + pub flight: Option, + /// Information about fuel that was purchased with this transaction. + pub fuel: Option, + /// Information about lodging that was purchased with this transaction. + pub lodging: Option, + /// The line items in the purchase. + pub receipt: Option>, + /// A merchant-specific order number. + pub reference: Option, +} diff --git a/stripe_types/src/generated/issuing_transaction_receipt_data/mod.rs b/stripe_types/src/generated/issuing_transaction_receipt_data/mod.rs new file mode 100644 index 000000000..6ad35e8d5 --- /dev/null +++ b/stripe_types/src/generated/issuing_transaction_receipt_data/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionReceiptData { + /// The description of the item. + /// + /// The maximum length of this field is 26 characters. + pub description: Option, + /// The quantity of the item. + pub quantity: Option, + /// The total for this line item in cents. + pub total: Option, + /// The unit cost of the item in cents. + pub unit_cost: Option, +} diff --git a/stripe_types/src/generated/issuing_transaction_treasury/mod.rs b/stripe_types/src/generated/issuing_transaction_treasury/mod.rs new file mode 100644 index 000000000..e48dad849 --- /dev/null +++ b/stripe_types/src/generated/issuing_transaction_treasury/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionTreasury { + /// The Treasury [ReceivedCredit](https://stripe.com/docs/api/treasury/received_credits) representing this Issuing transaction if it is a refund. + pub received_credit: Option, + /// The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_debits) representing this Issuing transaction if it is a capture. + pub received_debit: Option, +} diff --git a/stripe_types/src/generated/legal_entity_company/mod.rs b/stripe_types/src/generated/legal_entity_company/mod.rs new file mode 100644 index 000000000..79df97f12 --- /dev/null +++ b/stripe_types/src/generated/legal_entity_company/mod.rs @@ -0,0 +1,189 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct LegalEntityCompany { + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option, + /// The Kana variation of the company's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option, + /// The Kanji variation of the company's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option, + /// Whether the company's directors have been provided. + /// + /// This Boolean will be `true` if you've manually indicated that all directors are provided via [the `directors_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-directors_provided). + #[serde(skip_serializing_if = "Option::is_none")] + pub directors_provided: Option, + /// Whether the company's executives have been provided. + /// + /// This Boolean will be `true` if you've manually indicated that all executives are provided via [the `executives_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-executives_provided), or if Stripe determined that sufficient executives were provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub executives_provided: Option, + /// The export license ID number of the company, also referred as Import Export Code (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_license_id: Option, + /// The purpose code to use for export transactions (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_purpose_code: Option, + /// The company's legal name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + /// The Kana variation of the company's legal name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub name_kana: Option, + /// The Kanji variation of the company's legal name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub name_kanji: Option, + /// Whether the company's owners have been provided. + /// + /// This Boolean will be `true` if you've manually indicated that all owners are provided via [the `owners_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-owners_provided), or if Stripe determined that sufficient owners were provided. + /// Stripe determines ownership requirements using both the number of owners provided and their total percent ownership (calculated by adding the `percent_ownership` of each owner together). + #[serde(skip_serializing_if = "Option::is_none")] + pub owners_provided: Option, + /// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. + #[serde(skip_serializing_if = "Option::is_none")] + pub ownership_declaration: Option, + /// The company's phone number (used for verification). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option, + /// The category identifying the legal structure of the company or legal entity. + /// + /// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub structure: Option, + /// Whether the company's business ID number was provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_provided: Option, + /// The jurisdiction in which the `tax_id` is registered (Germany-based companies only). + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_registrar: Option, + /// Whether the company's business VAT number was provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub vat_id_provided: Option, + /// Information on the verification state of the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option, +} +/// The category identifying the legal structure of the company or legal entity. +/// +/// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum LegalEntityCompanyStructure { + FreeZoneEstablishment, + FreeZoneLlc, + GovernmentInstrumentality, + GovernmentalUnit, + IncorporatedNonProfit, + IncorporatedPartnership, + LimitedLiabilityPartnership, + Llc, + MultiMemberLlc, + PrivateCompany, + PrivateCorporation, + PrivatePartnership, + PublicCompany, + PublicCorporation, + PublicPartnership, + SingleMemberLlc, + SoleEstablishment, + SoleProprietorship, + TaxExemptGovernmentInstrumentality, + UnincorporatedAssociation, + UnincorporatedNonProfit, + UnincorporatedPartnership, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl LegalEntityCompanyStructure { + pub fn as_str(self) -> &'static str { + use LegalEntityCompanyStructure::*; + match self { + FreeZoneEstablishment => "free_zone_establishment", + FreeZoneLlc => "free_zone_llc", + GovernmentInstrumentality => "government_instrumentality", + GovernmentalUnit => "governmental_unit", + IncorporatedNonProfit => "incorporated_non_profit", + IncorporatedPartnership => "incorporated_partnership", + LimitedLiabilityPartnership => "limited_liability_partnership", + Llc => "llc", + MultiMemberLlc => "multi_member_llc", + PrivateCompany => "private_company", + PrivateCorporation => "private_corporation", + PrivatePartnership => "private_partnership", + PublicCompany => "public_company", + PublicCorporation => "public_corporation", + PublicPartnership => "public_partnership", + SingleMemberLlc => "single_member_llc", + SoleEstablishment => "sole_establishment", + SoleProprietorship => "sole_proprietorship", + TaxExemptGovernmentInstrumentality => "tax_exempt_government_instrumentality", + UnincorporatedAssociation => "unincorporated_association", + UnincorporatedNonProfit => "unincorporated_non_profit", + UnincorporatedPartnership => "unincorporated_partnership", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for LegalEntityCompanyStructure { + type Err = (); + fn from_str(s: &str) -> Result { + use LegalEntityCompanyStructure::*; + match s { + "free_zone_establishment" => Ok(FreeZoneEstablishment), + "free_zone_llc" => Ok(FreeZoneLlc), + "government_instrumentality" => Ok(GovernmentInstrumentality), + "governmental_unit" => Ok(GovernmentalUnit), + "incorporated_non_profit" => Ok(IncorporatedNonProfit), + "incorporated_partnership" => Ok(IncorporatedPartnership), + "limited_liability_partnership" => Ok(LimitedLiabilityPartnership), + "llc" => Ok(Llc), + "multi_member_llc" => Ok(MultiMemberLlc), + "private_company" => Ok(PrivateCompany), + "private_corporation" => Ok(PrivateCorporation), + "private_partnership" => Ok(PrivatePartnership), + "public_company" => Ok(PublicCompany), + "public_corporation" => Ok(PublicCorporation), + "public_partnership" => Ok(PublicPartnership), + "single_member_llc" => Ok(SingleMemberLlc), + "sole_establishment" => Ok(SoleEstablishment), + "sole_proprietorship" => Ok(SoleProprietorship), + "tax_exempt_government_instrumentality" => Ok(TaxExemptGovernmentInstrumentality), + "unincorporated_association" => Ok(UnincorporatedAssociation), + "unincorporated_non_profit" => Ok(UnincorporatedNonProfit), + "unincorporated_partnership" => Ok(UnincorporatedPartnership), + _ => Err(()), + } + } +} +impl AsRef for LegalEntityCompanyStructure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for LegalEntityCompanyStructure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for LegalEntityCompanyStructure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for LegalEntityCompanyStructure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for LegalEntityCompanyStructure { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(LegalEntityCompanyStructure::Unknown)) + } +} diff --git a/stripe_types/src/generated/legal_entity_company_verification/mod.rs b/stripe_types/src/generated/legal_entity_company_verification/mod.rs new file mode 100644 index 000000000..b8f2a1b33 --- /dev/null +++ b/stripe_types/src/generated/legal_entity_company_verification/mod.rs @@ -0,0 +1,4 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct LegalEntityCompanyVerification { + pub document: stripe_types::LegalEntityCompanyVerificationDocument, +} diff --git a/stripe_types/src/generated/legal_entity_company_verification_document/mod.rs b/stripe_types/src/generated/legal_entity_company_verification_document/mod.rs new file mode 100644 index 000000000..2797860e7 --- /dev/null +++ b/stripe_types/src/generated/legal_entity_company_verification_document/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct LegalEntityCompanyVerificationDocument { + /// The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + pub back: Option>, + /// A user-displayable string describing the verification state of this document. + pub details: Option, + /// One of `document_corrupt`, `document_expired`, `document_failed_copy`, `document_failed_greyscale`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_not_readable`, `document_not_uploaded`, `document_type_not_supported`, or `document_too_large`. + /// + /// A machine-readable code specifying the verification state for this document. + pub details_code: Option, + /// The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + pub front: Option>, +} diff --git a/stripe_types/src/generated/legal_entity_dob/mod.rs b/stripe_types/src/generated/legal_entity_dob/mod.rs new file mode 100644 index 000000000..44dc0a314 --- /dev/null +++ b/stripe_types/src/generated/legal_entity_dob/mod.rs @@ -0,0 +1,9 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct LegalEntityDob { + /// The day of birth, between 1 and 31. + pub day: Option, + /// The month of birth, between 1 and 12. + pub month: Option, + /// The four-digit year of birth. + pub year: Option, +} diff --git a/stripe_types/src/generated/legal_entity_japan_address/mod.rs b/stripe_types/src/generated/legal_entity_japan_address/mod.rs new file mode 100644 index 000000000..38fd816e7 --- /dev/null +++ b/stripe_types/src/generated/legal_entity_japan_address/mod.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct LegalEntityJapanAddress { + /// City/Ward. + pub city: Option, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: Option, + /// Block/Building number. + pub line1: Option, + /// Building details. + pub line2: Option, + /// ZIP or postal code. + pub postal_code: Option, + /// Prefecture. + pub state: Option, + /// Town/cho-me. + pub town: Option, +} diff --git a/stripe_types/src/generated/legal_entity_person_verification/mod.rs b/stripe_types/src/generated/legal_entity_person_verification/mod.rs new file mode 100644 index 000000000..efbf06d91 --- /dev/null +++ b/stripe_types/src/generated/legal_entity_person_verification/mod.rs @@ -0,0 +1,22 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct LegalEntityPersonVerification { + /// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_document: Option, + /// A user-displayable string describing the verification state for the person. + /// + /// For example, this may say "Provided identity information could not be verified". + #[serde(skip_serializing_if = "Option::is_none")] + pub details: Option, + /// One of `document_address_mismatch`, `document_dob_mismatch`, `document_duplicate_type`, `document_id_number_mismatch`, `document_name_mismatch`, `document_nationality_mismatch`, `failed_keyed_identity`, or `failed_other`. + /// + /// A machine-readable code specifying the verification state for the person. + #[serde(skip_serializing_if = "Option::is_none")] + pub details_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option, + /// The state of verification for the person. + /// + /// Possible values are `unverified`, `pending`, or `verified`. + pub status: String, +} diff --git a/stripe_types/src/generated/legal_entity_person_verification_document/mod.rs b/stripe_types/src/generated/legal_entity_person_verification_document/mod.rs new file mode 100644 index 000000000..5cb191072 --- /dev/null +++ b/stripe_types/src/generated/legal_entity_person_verification_document/mod.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct LegalEntityPersonVerificationDocument { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + pub back: Option>, + /// A user-displayable string describing the verification state of this document. + /// + /// For example, if a document is uploaded and the picture is too fuzzy, this may say "Identity document is too unclear to read". + pub details: Option, + /// One of `document_corrupt`, `document_country_not_supported`, `document_expired`, `document_failed_copy`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_failed_greyscale`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_missing_back`, `document_missing_front`, `document_not_readable`, `document_not_uploaded`, `document_photo_mismatch`, `document_too_large`, or `document_type_not_supported`. + /// + /// A machine-readable code specifying the verification state for this document. + pub details_code: Option, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + pub front: Option>, +} diff --git a/stripe_types/src/generated/legal_entity_ubo_declaration/mod.rs b/stripe_types/src/generated/legal_entity_ubo_declaration/mod.rs new file mode 100644 index 000000000..1db87525d --- /dev/null +++ b/stripe_types/src/generated/legal_entity_ubo_declaration/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct LegalEntityUboDeclaration { + /// The Unix timestamp marking when the beneficial owner attestation was made. + pub date: Option, + /// The IP address from which the beneficial owner attestation was made. + pub ip: Option, + /// The user-agent string from the browser where the beneficial owner attestation was made. + pub user_agent: Option, +} diff --git a/stripe_types/src/generated/level3/mod.rs b/stripe_types/src/generated/level3/mod.rs new file mode 100644 index 000000000..508b5833e --- /dev/null +++ b/stripe_types/src/generated/level3/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Level3 { + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_reference: Option, + pub line_items: Vec, + pub merchant_reference: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_address_zip: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_amount: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_from_zip: Option, +} diff --git a/stripe_types/src/generated/level3_line_items/mod.rs b/stripe_types/src/generated/level3_line_items/mod.rs new file mode 100644 index 000000000..60d0a1321 --- /dev/null +++ b/stripe_types/src/generated/level3_line_items/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Level3LineItems { + pub discount_amount: Option, + pub product_code: String, + pub product_description: String, + pub quantity: Option, + pub tax_amount: Option, + pub unit_cost: Option, +} diff --git a/stripe_types/src/generated/line_item/mod.rs b/stripe_types/src/generated/line_item/mod.rs new file mode 100644 index 000000000..d4b5cfc64 --- /dev/null +++ b/stripe_types/src/generated/line_item/mod.rs @@ -0,0 +1,44 @@ +/// A line item. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct LineItem { + /// Total discount amount applied. + /// + /// If no discounts were applied, defaults to 0. + pub amount_discount: i64, + /// Total before any discounts or taxes are applied. + pub amount_subtotal: i64, + /// Total tax amount applied. + /// + /// If no tax was applied, defaults to 0. + pub amount_tax: i64, + /// Total after discounts and taxes. + pub amount_total: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + /// Defaults to product name. + pub description: String, + /// The discounts applied to the line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option>, + /// Unique identifier for the object. + pub id: stripe_types::line_item::ItemId, + /// The price used to generate the line item. + pub price: Option, + /// The quantity of products being purchased. + pub quantity: Option, + /// The taxes applied to the line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub taxes: Option>, +} +impl stripe_types::Object for LineItem { + type Id = stripe_types::line_item::ItemId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(ItemId); diff --git a/stripe_types/src/generated/line_items_discount_amount/mod.rs b/stripe_types/src/generated/line_items_discount_amount/mod.rs new file mode 100644 index 000000000..27c4f9817 --- /dev/null +++ b/stripe_types/src/generated/line_items_discount_amount/mod.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct LineItemsDiscountAmount { + /// The amount discounted. + pub amount: i64, + pub discount: stripe_types::Discount, +} diff --git a/stripe_types/src/generated/line_items_tax_amount/mod.rs b/stripe_types/src/generated/line_items_tax_amount/mod.rs new file mode 100644 index 000000000..390141cf3 --- /dev/null +++ b/stripe_types/src/generated/line_items_tax_amount/mod.rs @@ -0,0 +1,115 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct LineItemsTaxAmount { + /// Amount of tax applied for this rate. + pub amount: i64, + pub rate: stripe_types::TaxRate, + /// The reasoning behind this tax, for example, if the product is tax exempt. + /// + /// The possible values for this field may be extended as new tax rules are supported. + pub taxability_reason: Option, + /// The amount on which tax is calculated, in cents (or local equivalent). + pub taxable_amount: Option, +} +/// The reasoning behind this tax, for example, if the product is tax exempt. +/// +/// The possible values for this field may be extended as new tax rules are supported. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum LineItemsTaxAmountTaxabilityReason { + CustomerExempt, + NotCollecting, + NotSubjectToTax, + NotSupported, + PortionProductExempt, + PortionReducedRated, + PortionStandardRated, + ProductExempt, + ProductExemptHoliday, + ProportionallyRated, + ReducedRated, + ReverseCharge, + StandardRated, + TaxableBasisReduced, + ZeroRated, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl LineItemsTaxAmountTaxabilityReason { + pub fn as_str(self) -> &'static str { + use LineItemsTaxAmountTaxabilityReason::*; + match self { + CustomerExempt => "customer_exempt", + NotCollecting => "not_collecting", + NotSubjectToTax => "not_subject_to_tax", + NotSupported => "not_supported", + PortionProductExempt => "portion_product_exempt", + PortionReducedRated => "portion_reduced_rated", + PortionStandardRated => "portion_standard_rated", + ProductExempt => "product_exempt", + ProductExemptHoliday => "product_exempt_holiday", + ProportionallyRated => "proportionally_rated", + ReducedRated => "reduced_rated", + ReverseCharge => "reverse_charge", + StandardRated => "standard_rated", + TaxableBasisReduced => "taxable_basis_reduced", + ZeroRated => "zero_rated", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for LineItemsTaxAmountTaxabilityReason { + type Err = (); + fn from_str(s: &str) -> Result { + use LineItemsTaxAmountTaxabilityReason::*; + match s { + "customer_exempt" => Ok(CustomerExempt), + "not_collecting" => Ok(NotCollecting), + "not_subject_to_tax" => Ok(NotSubjectToTax), + "not_supported" => Ok(NotSupported), + "portion_product_exempt" => Ok(PortionProductExempt), + "portion_reduced_rated" => Ok(PortionReducedRated), + "portion_standard_rated" => Ok(PortionStandardRated), + "product_exempt" => Ok(ProductExempt), + "product_exempt_holiday" => Ok(ProductExemptHoliday), + "proportionally_rated" => Ok(ProportionallyRated), + "reduced_rated" => Ok(ReducedRated), + "reverse_charge" => Ok(ReverseCharge), + "standard_rated" => Ok(StandardRated), + "taxable_basis_reduced" => Ok(TaxableBasisReduced), + "zero_rated" => Ok(ZeroRated), + _ => Err(()), + } + } +} +impl AsRef for LineItemsTaxAmountTaxabilityReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for LineItemsTaxAmountTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for LineItemsTaxAmountTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for LineItemsTaxAmountTaxabilityReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for LineItemsTaxAmountTaxabilityReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(LineItemsTaxAmountTaxabilityReason::Unknown)) + } +} diff --git a/stripe_types/src/generated/linked_account_options_us_bank_account/mod.rs b/stripe_types/src/generated/linked_account_options_us_bank_account/mod.rs new file mode 100644 index 000000000..b0fb260af --- /dev/null +++ b/stripe_types/src/generated/linked_account_options_us_bank_account/mod.rs @@ -0,0 +1,142 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct LinkedAccountOptionsUsBankAccount { + /// The list of permissions to request. + /// + /// The `payment_method` permission must be included. + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: Option>, + /// Data features requested to be retrieved upon account creation. + pub prefetch: Option>, + /// For webview integrations only. + /// + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option, +} +/// The list of permissions to request. +/// +/// The `payment_method` permission must be included. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum LinkedAccountOptionsUsBankAccountPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl LinkedAccountOptionsUsBankAccountPermissions { + pub fn as_str(self) -> &'static str { + use LinkedAccountOptionsUsBankAccountPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for LinkedAccountOptionsUsBankAccountPermissions { + type Err = (); + fn from_str(s: &str) -> Result { + use LinkedAccountOptionsUsBankAccountPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl AsRef for LinkedAccountOptionsUsBankAccountPermissions { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for LinkedAccountOptionsUsBankAccountPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for LinkedAccountOptionsUsBankAccountPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for LinkedAccountOptionsUsBankAccountPermissions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for LinkedAccountOptionsUsBankAccountPermissions { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for LinkedAccountOptionsUsBankAccountPermissions", + ) + }) + } +} +/// Data features requested to be retrieved upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum LinkedAccountOptionsUsBankAccountPrefetch { + Balances, +} +impl LinkedAccountOptionsUsBankAccountPrefetch { + pub fn as_str(self) -> &'static str { + use LinkedAccountOptionsUsBankAccountPrefetch::*; + match self { + Balances => "balances", + } + } +} + +impl std::str::FromStr for LinkedAccountOptionsUsBankAccountPrefetch { + type Err = (); + fn from_str(s: &str) -> Result { + use LinkedAccountOptionsUsBankAccountPrefetch::*; + match s { + "balances" => Ok(Balances), + _ => Err(()), + } + } +} +impl AsRef for LinkedAccountOptionsUsBankAccountPrefetch { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for LinkedAccountOptionsUsBankAccountPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for LinkedAccountOptionsUsBankAccountPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for LinkedAccountOptionsUsBankAccountPrefetch { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for LinkedAccountOptionsUsBankAccountPrefetch { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for LinkedAccountOptionsUsBankAccountPrefetch") + }) + } +} diff --git a/stripe_types/src/generated/mandate/mod.rs b/stripe_types/src/generated/mandate/mod.rs new file mode 100644 index 000000000..1d1f32c30 --- /dev/null +++ b/stripe_types/src/generated/mandate/mod.rs @@ -0,0 +1,152 @@ +/// A Mandate is a record of the permission that your customer gives you to debit their payment method. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Mandate { + pub customer_acceptance: stripe_types::CustomerAcceptance, + /// Unique identifier for the object. + pub id: stripe_types::mandate::MandateId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub multi_use: Option, + /// The account (if any) that the mandate is intended for. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option, + /// ID of the payment method associated with this mandate. + pub payment_method: stripe_types::Expandable, + pub payment_method_details: stripe_types::MandatePaymentMethodDetails, + #[serde(skip_serializing_if = "Option::is_none")] + pub single_use: Option, + /// The mandate status indicates whether or not you can use it to initiate a payment. + pub status: MandateStatus, + /// The type of the mandate. + #[serde(rename = "type")] + pub type_: MandateType, +} +/// The mandate status indicates whether or not you can use it to initiate a payment. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum MandateStatus { + Active, + Inactive, + Pending, +} +impl MandateStatus { + pub fn as_str(self) -> &'static str { + use MandateStatus::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for MandateStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use MandateStatus::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl AsRef for MandateStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for MandateStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for MandateStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for MandateStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for MandateStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for MandateStatus")) + } +} +/// The type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum MandateType { + MultiUse, + SingleUse, +} +impl MandateType { + pub fn as_str(self) -> &'static str { + use MandateType::*; + match self { + MultiUse => "multi_use", + SingleUse => "single_use", + } + } +} + +impl std::str::FromStr for MandateType { + type Err = (); + fn from_str(s: &str) -> Result { + use MandateType::*; + match s { + "multi_use" => Ok(MultiUse), + "single_use" => Ok(SingleUse), + _ => Err(()), + } + } +} +impl AsRef for MandateType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for MandateType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for MandateType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for MandateType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for MandateType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for MandateType")) + } +} +impl stripe_types::Object for Mandate { + type Id = stripe_types::mandate::MandateId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(MandateId, "mandate_"); diff --git a/stripe_types/src/generated/mandate_acss_debit/mod.rs b/stripe_types/src/generated/mandate_acss_debit/mod.rs new file mode 100644 index 000000000..df3d4e5b0 --- /dev/null +++ b/stripe_types/src/generated/mandate_acss_debit/mod.rs @@ -0,0 +1,196 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct MandateAcssDebit { + /// List of Stripe products where this mandate can be selected automatically. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for: Option>, + /// Description of the interval. + /// + /// Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + pub interval_description: Option, + /// Payment schedule for the mandate. + pub payment_schedule: MandateAcssDebitPaymentSchedule, + /// Transaction type of the mandate. + pub transaction_type: MandateAcssDebitTransactionType, +} +/// List of Stripe products where this mandate can be selected automatically. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum MandateAcssDebitDefaultFor { + Invoice, + Subscription, +} +impl MandateAcssDebitDefaultFor { + pub fn as_str(self) -> &'static str { + use MandateAcssDebitDefaultFor::*; + match self { + Invoice => "invoice", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for MandateAcssDebitDefaultFor { + type Err = (); + fn from_str(s: &str) -> Result { + use MandateAcssDebitDefaultFor::*; + match s { + "invoice" => Ok(Invoice), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl AsRef for MandateAcssDebitDefaultFor { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for MandateAcssDebitDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for MandateAcssDebitDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for MandateAcssDebitDefaultFor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for MandateAcssDebitDefaultFor { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for MandateAcssDebitDefaultFor")) + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum MandateAcssDebitPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl MandateAcssDebitPaymentSchedule { + pub fn as_str(self) -> &'static str { + use MandateAcssDebitPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr for MandateAcssDebitPaymentSchedule { + type Err = (); + fn from_str(s: &str) -> Result { + use MandateAcssDebitPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl AsRef for MandateAcssDebitPaymentSchedule { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for MandateAcssDebitPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for MandateAcssDebitPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for MandateAcssDebitPaymentSchedule { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for MandateAcssDebitPaymentSchedule { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for MandateAcssDebitPaymentSchedule") + }) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum MandateAcssDebitTransactionType { + Business, + Personal, +} +impl MandateAcssDebitTransactionType { + pub fn as_str(self) -> &'static str { + use MandateAcssDebitTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr for MandateAcssDebitTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use MandateAcssDebitTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl AsRef for MandateAcssDebitTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for MandateAcssDebitTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for MandateAcssDebitTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for MandateAcssDebitTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for MandateAcssDebitTransactionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for MandateAcssDebitTransactionType") + }) + } +} diff --git a/stripe_types/src/generated/mandate_au_becs_debit/mod.rs b/stripe_types/src/generated/mandate_au_becs_debit/mod.rs new file mode 100644 index 000000000..4fa60389c --- /dev/null +++ b/stripe_types/src/generated/mandate_au_becs_debit/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct MandateAuBecsDebit { + /// The URL of the mandate. + /// + /// This URL generally contains sensitive information about the customer and should be shared with them exclusively. + pub url: String, +} diff --git a/stripe_types/src/generated/mandate_bacs_debit/mod.rs b/stripe_types/src/generated/mandate_bacs_debit/mod.rs new file mode 100644 index 000000000..c230a9861 --- /dev/null +++ b/stripe_types/src/generated/mandate_bacs_debit/mod.rs @@ -0,0 +1,79 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct MandateBacsDebit { + /// The status of the mandate on the Bacs network. + /// + /// Can be one of `pending`, `revoked`, `refused`, or `accepted`. + pub network_status: MandateBacsDebitNetworkStatus, + /// The unique reference identifying the mandate on the Bacs network. + pub reference: String, + /// The URL that will contain the mandate that the customer has signed. + pub url: String, +} +/// The status of the mandate on the Bacs network. +/// +/// Can be one of `pending`, `revoked`, `refused`, or `accepted`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum MandateBacsDebitNetworkStatus { + Accepted, + Pending, + Refused, + Revoked, +} +impl MandateBacsDebitNetworkStatus { + pub fn as_str(self) -> &'static str { + use MandateBacsDebitNetworkStatus::*; + match self { + Accepted => "accepted", + Pending => "pending", + Refused => "refused", + Revoked => "revoked", + } + } +} + +impl std::str::FromStr for MandateBacsDebitNetworkStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use MandateBacsDebitNetworkStatus::*; + match s { + "accepted" => Ok(Accepted), + "pending" => Ok(Pending), + "refused" => Ok(Refused), + "revoked" => Ok(Revoked), + _ => Err(()), + } + } +} +impl AsRef for MandateBacsDebitNetworkStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for MandateBacsDebitNetworkStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for MandateBacsDebitNetworkStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for MandateBacsDebitNetworkStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for MandateBacsDebitNetworkStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for MandateBacsDebitNetworkStatus") + }) + } +} diff --git a/stripe_types/src/generated/mandate_cashapp/mod.rs b/stripe_types/src/generated/mandate_cashapp/mod.rs new file mode 100644 index 000000000..e28fa9bba --- /dev/null +++ b/stripe_types/src/generated/mandate_cashapp/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct MandateCashapp {} diff --git a/stripe_types/src/generated/mandate_link/mod.rs b/stripe_types/src/generated/mandate_link/mod.rs new file mode 100644 index 000000000..9b0fc2773 --- /dev/null +++ b/stripe_types/src/generated/mandate_link/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct MandateLink {} diff --git a/stripe_types/src/generated/mandate_multi_use/mod.rs b/stripe_types/src/generated/mandate_multi_use/mod.rs new file mode 100644 index 000000000..f214a7fec --- /dev/null +++ b/stripe_types/src/generated/mandate_multi_use/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct MandateMultiUse {} diff --git a/stripe_types/src/generated/mandate_payment_method_details/mod.rs b/stripe_types/src/generated/mandate_payment_method_details/mod.rs new file mode 100644 index 000000000..4bd6861fd --- /dev/null +++ b/stripe_types/src/generated/mandate_payment_method_details/mod.rs @@ -0,0 +1,26 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct MandatePaymentMethodDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + /// This mandate corresponds with a specific payment method type. + /// + /// The `payment_method_details` includes an additional hash with the same name and contains mandate information that's specific to that payment method. + #[serde(rename = "type")] + pub type_: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} diff --git a/stripe_types/src/generated/mandate_paypal/mod.rs b/stripe_types/src/generated/mandate_paypal/mod.rs new file mode 100644 index 000000000..a61c1fc07 --- /dev/null +++ b/stripe_types/src/generated/mandate_paypal/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct MandatePaypal { + /// The PayPal Billing Agreement ID (BAID). + /// + /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer. + pub billing_agreement_id: Option, + /// PayPal account PayerID. + /// + /// This identifier uniquely identifies the PayPal customer. + pub payer_id: Option, +} diff --git a/stripe_types/src/generated/mandate_sepa_debit/mod.rs b/stripe_types/src/generated/mandate_sepa_debit/mod.rs new file mode 100644 index 000000000..64fc56a6a --- /dev/null +++ b/stripe_types/src/generated/mandate_sepa_debit/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct MandateSepaDebit { + /// The unique reference of the mandate. + pub reference: String, + /// The URL of the mandate. + /// + /// This URL generally contains sensitive information about the customer and should be shared with them exclusively. + pub url: String, +} diff --git a/stripe_types/src/generated/mandate_single_use/mod.rs b/stripe_types/src/generated/mandate_single_use/mod.rs new file mode 100644 index 000000000..8cabcb79e --- /dev/null +++ b/stripe_types/src/generated/mandate_single_use/mod.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct MandateSingleUse { + /// The amount of the payment on a single use mandate. + pub amount: i64, + /// The currency of the payment on a single use mandate. + pub currency: stripe_types::Currency, +} diff --git a/stripe_types/src/generated/mandate_us_bank_account/mod.rs b/stripe_types/src/generated/mandate_us_bank_account/mod.rs new file mode 100644 index 000000000..97864d49b --- /dev/null +++ b/stripe_types/src/generated/mandate_us_bank_account/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct MandateUsBankAccount {} diff --git a/stripe_types/src/generated/mod.rs b/stripe_types/src/generated/mod.rs new file mode 100644 index 000000000..f2d7d31c5 --- /dev/null +++ b/stripe_types/src/generated/mod.rs @@ -0,0 +1,1189 @@ +pub mod account; +pub mod version; +pub use account::Account; +pub mod account_bacs_debit_payments_settings; +pub use account_bacs_debit_payments_settings::AccountBacsDebitPaymentsSettings; +pub mod account_branding_settings; +pub use account_branding_settings::AccountBrandingSettings; +pub mod account_business_profile; +pub use account_business_profile::AccountBusinessProfile; +pub mod account_capabilities; +pub use account_capabilities::AccountCapabilities; +pub mod account_capability_future_requirements; +pub use account_capability_future_requirements::AccountCapabilityFutureRequirements; +pub mod account_capability_requirements; +pub use account_capability_requirements::AccountCapabilityRequirements; +pub mod account_card_issuing_settings; +pub use account_card_issuing_settings::AccountCardIssuingSettings; +pub mod account_card_payments_settings; +pub use account_card_payments_settings::AccountCardPaymentsSettings; +pub mod account_dashboard_settings; +pub use account_dashboard_settings::AccountDashboardSettings; +pub mod account_decline_charge_on; +pub use account_decline_charge_on::AccountDeclineChargeOn; +pub mod account_future_requirements; +pub use account_future_requirements::AccountFutureRequirements; +pub mod account_monthly_estimated_revenue; +pub use account_monthly_estimated_revenue::AccountMonthlyEstimatedRevenue; +pub mod account_payments_settings; +pub use account_payments_settings::AccountPaymentsSettings; +pub mod account_payout_settings; +pub use account_payout_settings::AccountPayoutSettings; +pub mod account_requirements; +pub use account_requirements::AccountRequirements; +pub mod account_requirements_alternative; +pub use account_requirements_alternative::AccountRequirementsAlternative; +pub mod account_requirements_error; +pub use account_requirements_error::AccountRequirementsError; +pub mod account_sepa_debit_payments_settings; +pub use account_sepa_debit_payments_settings::AccountSepaDebitPaymentsSettings; +pub mod account_settings; +pub use account_settings::AccountSettings; +pub mod account_terms_of_service; +pub use account_terms_of_service::AccountTermsOfService; +pub mod account_tos_acceptance; +pub use account_tos_acceptance::AccountTosAcceptance; +pub mod account_treasury_settings; +pub use account_treasury_settings::AccountTreasurySettings; +pub mod account_unification_account_controller; +pub use account_unification_account_controller::AccountUnificationAccountController; +pub mod address; +pub use address::Address; +pub mod api_errors; +pub use api_errors::ApiErrors; +pub mod application; +pub use application::Application; +pub mod platform_fee; +pub use platform_fee::PlatformFee; +pub mod automatic_tax; +pub use automatic_tax::AutomaticTax; +pub mod balance_transaction; +pub use balance_transaction::BalanceTransaction; +pub mod balance_transaction_source; +pub use balance_transaction_source::BalanceTransactionSource; +pub mod bank_account; +pub use bank_account::BankAccount; +pub mod billing_details; +pub use billing_details::BillingDetails; +pub mod cancellation_details; +pub use cancellation_details::CancellationDetails; +pub mod account_capability; +pub use account_capability::AccountCapability; +pub mod card; +pub use card::Card; +pub mod card_issuing_account_terms_of_service; +pub use card_issuing_account_terms_of_service::CardIssuingAccountTermsOfService; +pub mod card_mandate_payment_method_details; +pub use card_mandate_payment_method_details::CardMandatePaymentMethodDetails; +pub mod cash_balance; +pub use cash_balance::CashBalance; +pub mod charge; +pub use charge::Charge; +pub mod charge_fraud_details; +pub use charge_fraud_details::ChargeFraudDetails; +pub mod charge_outcome; +pub use charge_outcome::ChargeOutcome; +pub mod charge_transfer_data; +pub use charge_transfer_data::ChargeTransferData; +pub mod connect_collection_transfer; +pub use connect_collection_transfer::ConnectCollectionTransfer; +pub mod coupon; +pub use coupon::Coupon; +pub mod coupon_applies_to; +pub use coupon_applies_to::CouponAppliesTo; +pub mod coupon_currency_option; +pub use coupon_currency_option::CouponCurrencyOption; +pub mod credit_note; +pub use credit_note::CreditNote; +pub mod credit_note_line_item; +pub use credit_note_line_item::CreditNoteLineItem; +pub mod credit_note_tax_amount; +pub use credit_note_tax_amount::CreditNoteTaxAmount; +pub mod currency_option; +pub use currency_option::CurrencyOption; +pub mod custom_unit_amount; +pub use custom_unit_amount::CustomUnitAmount; +pub mod customer; +pub use customer::Customer; +pub mod customer_acceptance; +pub use customer_acceptance::CustomerAcceptance; +pub mod customer_balance_customer_balance_settings; +pub use customer_balance_customer_balance_settings::CustomerBalanceCustomerBalanceSettings; +pub mod customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft; +pub use customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft::CustomerBalanceResourceCashBalanceTransactionResourceAdjustedForOverdraft; +pub mod customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction; +pub use customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction::CustomerBalanceResourceCashBalanceTransactionResourceAppliedToPaymentTransaction; +pub mod customer_balance_resource_cash_balance_transaction_resource_funded_transaction; +pub use customer_balance_resource_cash_balance_transaction_resource_funded_transaction::CustomerBalanceResourceCashBalanceTransactionResourceFundedTransaction; +pub mod customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer; +pub use customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer::CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransfer; +pub mod customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer; +pub use customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer::CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceEuBankTransfer; +pub mod customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer; +pub use customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer::CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceGbBankTransfer; +pub mod customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer; +pub use customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer::CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceJpBankTransfer; +pub mod customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer; +pub use customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer::CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransfer; +pub mod customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction; +pub use customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction::CustomerBalanceResourceCashBalanceTransactionResourceRefundedFromPaymentTransaction; +pub mod customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction; +pub use customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction::CustomerBalanceResourceCashBalanceTransactionResourceUnappliedFromPaymentTransaction; +pub mod customer_balance_transaction; +pub use customer_balance_transaction::CustomerBalanceTransaction; +pub mod customer_cash_balance_transaction; +pub use customer_cash_balance_transaction::CustomerCashBalanceTransaction; +pub mod customer_tax; +pub use customer_tax::CustomerTax; +pub mod customer_tax_location; +pub use customer_tax_location::CustomerTaxLocation; +pub mod deleted_account; +pub use deleted_account::DeletedAccount; +pub mod deleted_bank_account; +pub use deleted_bank_account::DeletedBankAccount; +pub mod deleted_card; +pub use deleted_card::DeletedCard; +pub mod deleted_coupon; +pub use deleted_coupon::DeletedCoupon; +pub mod deleted_customer; +pub use deleted_customer::DeletedCustomer; +pub mod deleted_discount; +pub use deleted_discount::DeletedDiscount; +pub mod deleted_external_account; +pub use deleted_external_account::DeletedExternalAccount; +pub mod deleted_invoice; +pub use deleted_invoice::DeletedInvoice; +pub mod deleted_invoice_item; +pub use deleted_invoice_item::DeletedInvoiceItem; +pub mod deleted_payment_source; +pub use deleted_payment_source::DeletedPaymentSource; +pub mod deleted_person; +pub use deleted_person::DeletedPerson; +pub mod deleted_plan; +pub use deleted_plan::DeletedPlan; +pub mod deleted_product; +pub use deleted_product::DeletedProduct; +pub mod deleted_subscription_item; +pub use deleted_subscription_item::DeletedSubscriptionItem; +pub mod deleted_tax_id; +pub use deleted_tax_id::DeletedTaxId; +pub mod deleted_test_clock; +pub use deleted_test_clock::DeletedTestClock; +pub mod discount; +pub use discount::Discount; +pub mod discounts_resource_discount_amount; +pub use discounts_resource_discount_amount::DiscountsResourceDiscountAmount; +pub mod dispute; +pub use dispute::Dispute; +pub mod dispute_evidence; +pub use dispute_evidence::DisputeEvidence; +pub mod dispute_evidence_details; +pub use dispute_evidence_details::DisputeEvidenceDetails; +pub mod dispute_payment_method_details; +pub use dispute_payment_method_details::DisputePaymentMethodDetails; +pub mod dispute_payment_method_details_card; +pub use dispute_payment_method_details_card::DisputePaymentMethodDetailsCard; +pub mod email_sent; +pub use email_sent::EmailSent; +pub mod error; +pub use error::Error; +pub mod notification_event; +pub use notification_event::NotificationEvent; +pub mod external_account; +pub use external_account::ExternalAccount; +pub mod external_account_requirements; +pub use external_account_requirements::ExternalAccountRequirements; +pub mod fee; +pub use fee::Fee; +pub mod fee_refund; +pub use fee_refund::FeeRefund; +pub mod file; +pub use file::File; +pub mod file_link; +pub use file_link::FileLink; +pub mod customer_balance_funding_instructions_customer_balance_funding_instructions; +pub use customer_balance_funding_instructions_customer_balance_funding_instructions::CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructions; +pub mod funding_instructions_bank_transfer; +pub use funding_instructions_bank_transfer::FundingInstructionsBankTransfer; +pub mod funding_instructions_bank_transfer_aba_record; +pub use funding_instructions_bank_transfer_aba_record::FundingInstructionsBankTransferAbaRecord; +pub mod funding_instructions_bank_transfer_financial_address; +pub use funding_instructions_bank_transfer_financial_address::FundingInstructionsBankTransferFinancialAddress; +pub mod funding_instructions_bank_transfer_iban_record; +pub use funding_instructions_bank_transfer_iban_record::FundingInstructionsBankTransferIbanRecord; +pub mod funding_instructions_bank_transfer_sort_code_record; +pub use funding_instructions_bank_transfer_sort_code_record::FundingInstructionsBankTransferSortCodeRecord; +pub mod funding_instructions_bank_transfer_spei_record; +pub use funding_instructions_bank_transfer_spei_record::FundingInstructionsBankTransferSpeiRecord; +pub mod funding_instructions_bank_transfer_swift_record; +pub use funding_instructions_bank_transfer_swift_record::FundingInstructionsBankTransferSwiftRecord; +pub mod funding_instructions_bank_transfer_zengin_record; +pub use funding_instructions_bank_transfer_zengin_record::FundingInstructionsBankTransferZenginRecord; +pub mod invoice; +pub use invoice::Invoice; +pub mod invoice_installments_card; +pub use invoice_installments_card::InvoiceInstallmentsCard; +pub mod invoice_item_threshold_reason; +pub use invoice_item_threshold_reason::InvoiceItemThresholdReason; +pub mod invoice_line_item_period; +pub use invoice_line_item_period::InvoiceLineItemPeriod; +pub mod invoice_mandate_options_card; +pub use invoice_mandate_options_card::InvoiceMandateOptionsCard; +pub mod invoice_payment_method_options_acss_debit; +pub use invoice_payment_method_options_acss_debit::InvoicePaymentMethodOptionsAcssDebit; +pub mod invoice_payment_method_options_acss_debit_mandate_options; +pub use invoice_payment_method_options_acss_debit_mandate_options::InvoicePaymentMethodOptionsAcssDebitMandateOptions; +pub mod invoice_payment_method_options_bancontact; +pub use invoice_payment_method_options_bancontact::InvoicePaymentMethodOptionsBancontact; +pub mod invoice_payment_method_options_card; +pub use invoice_payment_method_options_card::InvoicePaymentMethodOptionsCard; +pub mod invoice_payment_method_options_customer_balance; +pub use invoice_payment_method_options_customer_balance::InvoicePaymentMethodOptionsCustomerBalance; +pub mod invoice_payment_method_options_customer_balance_bank_transfer; +pub use invoice_payment_method_options_customer_balance_bank_transfer::InvoicePaymentMethodOptionsCustomerBalanceBankTransfer; +pub mod invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer; +pub use invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer::InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer; +pub mod invoice_payment_method_options_konbini; +pub use invoice_payment_method_options_konbini::InvoicePaymentMethodOptionsKonbini; +pub mod invoice_payment_method_options_us_bank_account; +pub use invoice_payment_method_options_us_bank_account::InvoicePaymentMethodOptionsUsBankAccount; +pub mod invoice_payment_method_options_us_bank_account_linked_account_options; +pub use invoice_payment_method_options_us_bank_account_linked_account_options::InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptions; +pub mod invoice_rendering_pdf; +pub use invoice_rendering_pdf::InvoiceRenderingPdf; +pub mod invoice_setting_custom_field; +pub use invoice_setting_custom_field::InvoiceSettingCustomField; +pub mod invoice_setting_customer_setting; +pub use invoice_setting_customer_setting::InvoiceSettingCustomerSetting; +pub mod invoice_setting_quote_setting; +pub use invoice_setting_quote_setting::InvoiceSettingQuoteSetting; +pub mod invoice_setting_rendering_options; +pub use invoice_setting_rendering_options::InvoiceSettingRenderingOptions; +pub mod invoice_setting_subscription_schedule_phase_setting; +pub use invoice_setting_subscription_schedule_phase_setting::InvoiceSettingSubscriptionSchedulePhaseSetting; +pub mod invoice_setting_subscription_schedule_setting; +pub use invoice_setting_subscription_schedule_setting::InvoiceSettingSubscriptionScheduleSetting; +pub mod invoice_tax_amount; +pub use invoice_tax_amount::InvoiceTaxAmount; +pub mod invoice_threshold_reason; +pub use invoice_threshold_reason::InvoiceThresholdReason; +pub mod invoice_transfer_data; +pub use invoice_transfer_data::InvoiceTransferData; +pub mod invoice_item; +pub use invoice_item::InvoiceItem; +pub mod invoices_from_invoice; +pub use invoices_from_invoice::InvoicesFromInvoice; +pub mod invoices_invoice_rendering; +pub use invoices_invoice_rendering::InvoicesInvoiceRendering; +pub mod invoices_payment_method_options; +pub use invoices_payment_method_options::InvoicesPaymentMethodOptions; +pub mod invoices_payment_settings; +pub use invoices_payment_settings::InvoicesPaymentSettings; +pub mod invoices_resource_invoice_tax_id; +pub use invoices_resource_invoice_tax_id::InvoicesResourceInvoiceTaxId; +pub mod invoices_resource_line_items_credited_items; +pub use invoices_resource_line_items_credited_items::InvoicesResourceLineItemsCreditedItems; +pub mod invoices_resource_line_items_proration_details; +pub use invoices_resource_line_items_proration_details::InvoicesResourceLineItemsProrationDetails; +pub mod invoices_shipping_cost; +pub use invoices_shipping_cost::InvoicesShippingCost; +pub mod invoices_status_transitions; +pub use invoices_status_transitions::InvoicesStatusTransitions; +pub mod issuing_authorization; +pub use issuing_authorization::IssuingAuthorization; +pub mod issuing_card; +pub use issuing_card::IssuingCard; +pub mod issuing_cardholder; +pub use issuing_cardholder::IssuingCardholder; +pub mod issuing_dispute; +pub use issuing_dispute::IssuingDispute; +pub mod issuing_network_token; +pub use issuing_network_token::IssuingNetworkToken; +pub mod issuing_transaction; +pub use issuing_transaction::IssuingTransaction; +pub mod issuing_authorization_amount_details; +pub use issuing_authorization_amount_details::IssuingAuthorizationAmountDetails; +pub mod issuing_authorization_authentication_exemption; +pub use issuing_authorization_authentication_exemption::IssuingAuthorizationAuthenticationExemption; +pub mod issuing_authorization_merchant_data; +pub use issuing_authorization_merchant_data::IssuingAuthorizationMerchantData; +pub mod issuing_authorization_network_data; +pub use issuing_authorization_network_data::IssuingAuthorizationNetworkData; +pub mod issuing_authorization_pending_request; +pub use issuing_authorization_pending_request::IssuingAuthorizationPendingRequest; +pub mod issuing_authorization_request; +pub use issuing_authorization_request::IssuingAuthorizationRequest; +pub mod issuing_authorization_three_d_secure; +pub use issuing_authorization_three_d_secure::IssuingAuthorizationThreeDSecure; +pub mod issuing_authorization_treasury; +pub use issuing_authorization_treasury::IssuingAuthorizationTreasury; +pub mod issuing_authorization_verification_data; +pub use issuing_authorization_verification_data::IssuingAuthorizationVerificationData; +pub mod issuing_card_apple_pay; +pub use issuing_card_apple_pay::IssuingCardApplePay; +pub mod issuing_card_authorization_controls; +pub use issuing_card_authorization_controls::IssuingCardAuthorizationControls; +pub mod issuing_card_google_pay; +pub use issuing_card_google_pay::IssuingCardGooglePay; +pub mod issuing_card_shipping; +pub use issuing_card_shipping::IssuingCardShipping; +pub mod issuing_card_shipping_customs; +pub use issuing_card_shipping_customs::IssuingCardShippingCustoms; +pub mod issuing_card_spending_limit; +pub use issuing_card_spending_limit::IssuingCardSpendingLimit; +pub mod issuing_card_wallets; +pub use issuing_card_wallets::IssuingCardWallets; +pub mod issuing_cardholder_address; +pub use issuing_cardholder_address::IssuingCardholderAddress; +pub mod issuing_cardholder_authorization_controls; +pub use issuing_cardholder_authorization_controls::IssuingCardholderAuthorizationControls; +pub mod issuing_cardholder_card_issuing; +pub use issuing_cardholder_card_issuing::IssuingCardholderCardIssuing; +pub mod issuing_cardholder_company; +pub use issuing_cardholder_company::IssuingCardholderCompany; +pub mod issuing_cardholder_id_document; +pub use issuing_cardholder_id_document::IssuingCardholderIdDocument; +pub mod issuing_cardholder_individual; +pub use issuing_cardholder_individual::IssuingCardholderIndividual; +pub mod issuing_cardholder_individual_dob; +pub use issuing_cardholder_individual_dob::IssuingCardholderIndividualDob; +pub mod issuing_cardholder_requirements; +pub use issuing_cardholder_requirements::IssuingCardholderRequirements; +pub mod issuing_cardholder_spending_limit; +pub use issuing_cardholder_spending_limit::IssuingCardholderSpendingLimit; +pub mod issuing_cardholder_user_terms_acceptance; +pub use issuing_cardholder_user_terms_acceptance::IssuingCardholderUserTermsAcceptance; +pub mod issuing_cardholder_verification; +pub use issuing_cardholder_verification::IssuingCardholderVerification; +pub mod issuing_dispute_canceled_evidence; +pub use issuing_dispute_canceled_evidence::IssuingDisputeCanceledEvidence; +pub mod issuing_dispute_duplicate_evidence; +pub use issuing_dispute_duplicate_evidence::IssuingDisputeDuplicateEvidence; +pub mod issuing_dispute_evidence; +pub use issuing_dispute_evidence::IssuingDisputeEvidence; +pub mod issuing_dispute_fraudulent_evidence; +pub use issuing_dispute_fraudulent_evidence::IssuingDisputeFraudulentEvidence; +pub mod issuing_dispute_merchandise_not_as_described_evidence; +pub use issuing_dispute_merchandise_not_as_described_evidence::IssuingDisputeMerchandiseNotAsDescribedEvidence; +pub mod issuing_dispute_not_received_evidence; +pub use issuing_dispute_not_received_evidence::IssuingDisputeNotReceivedEvidence; +pub mod issuing_dispute_other_evidence; +pub use issuing_dispute_other_evidence::IssuingDisputeOtherEvidence; +pub mod issuing_dispute_service_not_as_described_evidence; +pub use issuing_dispute_service_not_as_described_evidence::IssuingDisputeServiceNotAsDescribedEvidence; +pub mod issuing_dispute_treasury; +pub use issuing_dispute_treasury::IssuingDisputeTreasury; +pub mod issuing_network_token_address; +pub use issuing_network_token_address::IssuingNetworkTokenAddress; +pub mod issuing_network_token_device; +pub use issuing_network_token_device::IssuingNetworkTokenDevice; +pub mod issuing_network_token_mastercard; +pub use issuing_network_token_mastercard::IssuingNetworkTokenMastercard; +pub mod issuing_network_token_network_data; +pub use issuing_network_token_network_data::IssuingNetworkTokenNetworkData; +pub mod issuing_network_token_visa; +pub use issuing_network_token_visa::IssuingNetworkTokenVisa; +pub mod issuing_network_token_wallet_provider; +pub use issuing_network_token_wallet_provider::IssuingNetworkTokenWalletProvider; +pub mod issuing_transaction_amount_details; +pub use issuing_transaction_amount_details::IssuingTransactionAmountDetails; +pub mod issuing_transaction_flight_data; +pub use issuing_transaction_flight_data::IssuingTransactionFlightData; +pub mod issuing_transaction_flight_data_leg; +pub use issuing_transaction_flight_data_leg::IssuingTransactionFlightDataLeg; +pub mod issuing_transaction_fuel_data; +pub use issuing_transaction_fuel_data::IssuingTransactionFuelData; +pub mod issuing_transaction_lodging_data; +pub use issuing_transaction_lodging_data::IssuingTransactionLodgingData; +pub mod issuing_transaction_network_data; +pub use issuing_transaction_network_data::IssuingTransactionNetworkData; +pub mod issuing_transaction_purchase_details; +pub use issuing_transaction_purchase_details::IssuingTransactionPurchaseDetails; +pub mod issuing_transaction_receipt_data; +pub use issuing_transaction_receipt_data::IssuingTransactionReceiptData; +pub mod issuing_transaction_treasury; +pub use issuing_transaction_treasury::IssuingTransactionTreasury; +pub mod line_item; +pub use line_item::LineItem; +pub mod legal_entity_company; +pub use legal_entity_company::LegalEntityCompany; +pub mod legal_entity_company_verification; +pub use legal_entity_company_verification::LegalEntityCompanyVerification; +pub mod legal_entity_company_verification_document; +pub use legal_entity_company_verification_document::LegalEntityCompanyVerificationDocument; +pub mod legal_entity_dob; +pub use legal_entity_dob::LegalEntityDob; +pub mod legal_entity_japan_address; +pub use legal_entity_japan_address::LegalEntityJapanAddress; +pub mod legal_entity_person_verification; +pub use legal_entity_person_verification::LegalEntityPersonVerification; +pub mod legal_entity_person_verification_document; +pub use legal_entity_person_verification_document::LegalEntityPersonVerificationDocument; +pub mod legal_entity_ubo_declaration; +pub use legal_entity_ubo_declaration::LegalEntityUboDeclaration; +pub mod level3; +pub use level3::Level3; +pub mod level3_line_items; +pub use level3_line_items::Level3LineItems; +pub mod invoice_line_item; +pub use invoice_line_item::InvoiceLineItem; +pub mod line_items_discount_amount; +pub use line_items_discount_amount::LineItemsDiscountAmount; +pub mod line_items_tax_amount; +pub use line_items_tax_amount::LineItemsTaxAmount; +pub mod linked_account_options_us_bank_account; +pub use linked_account_options_us_bank_account::LinkedAccountOptionsUsBankAccount; +pub mod mandate; +pub use mandate::Mandate; +pub mod mandate_acss_debit; +pub use mandate_acss_debit::MandateAcssDebit; +pub mod mandate_au_becs_debit; +pub use mandate_au_becs_debit::MandateAuBecsDebit; +pub mod mandate_bacs_debit; +pub use mandate_bacs_debit::MandateBacsDebit; +pub mod mandate_cashapp; +pub use mandate_cashapp::MandateCashapp; +pub mod mandate_link; +pub use mandate_link::MandateLink; +pub mod mandate_multi_use; +pub use mandate_multi_use::MandateMultiUse; +pub mod mandate_payment_method_details; +pub use mandate_payment_method_details::MandatePaymentMethodDetails; +pub mod mandate_paypal; +pub use mandate_paypal::MandatePaypal; +pub mod mandate_sepa_debit; +pub use mandate_sepa_debit::MandateSepaDebit; +pub mod mandate_single_use; +pub use mandate_single_use::MandateSingleUse; +pub mod mandate_us_bank_account; +pub use mandate_us_bank_account::MandateUsBankAccount; +pub mod networks; +pub use networks::Networks; +pub mod notification_event_data; +pub use notification_event_data::NotificationEventData; +pub mod notification_event_request; +pub use notification_event_request::NotificationEventRequest; +pub mod offline_acceptance; +pub use offline_acceptance::OfflineAcceptance; +pub mod online_acceptance; +pub use online_acceptance::OnlineAcceptance; +pub mod package_dimensions; +pub use package_dimensions::PackageDimensions; +pub mod payment_flows_amount_details; +pub use payment_flows_amount_details::PaymentFlowsAmountDetails; +pub mod payment_flows_amount_details_resource_tip; +pub use payment_flows_amount_details_resource_tip::PaymentFlowsAmountDetailsResourceTip; +pub mod payment_flows_automatic_payment_methods_payment_intent; +pub use payment_flows_automatic_payment_methods_payment_intent::PaymentFlowsAutomaticPaymentMethodsPaymentIntent; +pub mod payment_flows_automatic_payment_methods_setup_intent; +pub use payment_flows_automatic_payment_methods_setup_intent::PaymentFlowsAutomaticPaymentMethodsSetupIntent; +pub mod payment_flows_private_payment_methods_alipay; +pub use payment_flows_private_payment_methods_alipay::PaymentFlowsPrivatePaymentMethodsAlipay; +pub mod payment_flows_private_payment_methods_alipay_details; +pub use payment_flows_private_payment_methods_alipay_details::PaymentFlowsPrivatePaymentMethodsAlipayDetails; +pub mod payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization; +pub use payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization::PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorization; +pub mod payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization; +pub use payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization::PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorization; +pub mod payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture; +pub use payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture::PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercapture; +pub mod payment_flows_private_payment_methods_card_details_api_resource_multicapture; +pub use payment_flows_private_payment_methods_card_details_api_resource_multicapture::PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticapture; +pub mod payment_flows_private_payment_methods_klarna_dob; +pub use payment_flows_private_payment_methods_klarna_dob::PaymentFlowsPrivatePaymentMethodsKlarnaDob; +pub mod payment_intent; +pub use payment_intent::PaymentIntent; +pub mod payment_intent_card_processing; +pub use payment_intent_card_processing::PaymentIntentCardProcessing; +pub mod payment_intent_next_action; +pub use payment_intent_next_action::PaymentIntentNextAction; +pub mod payment_intent_next_action_alipay_handle_redirect; +pub use payment_intent_next_action_alipay_handle_redirect::PaymentIntentNextActionAlipayHandleRedirect; +pub mod payment_intent_next_action_boleto; +pub use payment_intent_next_action_boleto::PaymentIntentNextActionBoleto; +pub mod payment_intent_next_action_card_await_notification; +pub use payment_intent_next_action_card_await_notification::PaymentIntentNextActionCardAwaitNotification; +pub mod payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code; +pub use payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code::PaymentIntentNextActionCashappHandleRedirectOrDisplayQrCode; +pub mod payment_intent_next_action_cashapp_qr_code; +pub use payment_intent_next_action_cashapp_qr_code::PaymentIntentNextActionCashappQrCode; +pub mod payment_intent_next_action_display_bank_transfer_instructions; +pub use payment_intent_next_action_display_bank_transfer_instructions::PaymentIntentNextActionDisplayBankTransferInstructions; +pub mod payment_intent_next_action_display_oxxo_details; +pub use payment_intent_next_action_display_oxxo_details::PaymentIntentNextActionDisplayOxxoDetails; +pub mod payment_intent_next_action_konbini; +pub use payment_intent_next_action_konbini::PaymentIntentNextActionKonbini; +pub mod payment_intent_next_action_konbini_familymart; +pub use payment_intent_next_action_konbini_familymart::PaymentIntentNextActionKonbiniFamilymart; +pub mod payment_intent_next_action_konbini_lawson; +pub use payment_intent_next_action_konbini_lawson::PaymentIntentNextActionKonbiniLawson; +pub mod payment_intent_next_action_konbini_ministop; +pub use payment_intent_next_action_konbini_ministop::PaymentIntentNextActionKonbiniMinistop; +pub mod payment_intent_next_action_konbini_seicomart; +pub use payment_intent_next_action_konbini_seicomart::PaymentIntentNextActionKonbiniSeicomart; +pub mod payment_intent_next_action_konbini_stores; +pub use payment_intent_next_action_konbini_stores::PaymentIntentNextActionKonbiniStores; +pub mod payment_intent_next_action_paynow_display_qr_code; +pub use payment_intent_next_action_paynow_display_qr_code::PaymentIntentNextActionPaynowDisplayQrCode; +pub mod payment_intent_next_action_pix_display_qr_code; +pub use payment_intent_next_action_pix_display_qr_code::PaymentIntentNextActionPixDisplayQrCode; +pub mod payment_intent_next_action_promptpay_display_qr_code; +pub use payment_intent_next_action_promptpay_display_qr_code::PaymentIntentNextActionPromptpayDisplayQrCode; +pub mod payment_intent_next_action_redirect_to_url; +pub use payment_intent_next_action_redirect_to_url::PaymentIntentNextActionRedirectToUrl; +pub mod payment_intent_next_action_verify_with_microdeposits; +pub use payment_intent_next_action_verify_with_microdeposits::PaymentIntentNextActionVerifyWithMicrodeposits; +pub mod payment_intent_next_action_wechat_pay_display_qr_code; +pub use payment_intent_next_action_wechat_pay_display_qr_code::PaymentIntentNextActionWechatPayDisplayQrCode; +pub mod payment_intent_next_action_wechat_pay_redirect_to_android_app; +pub use payment_intent_next_action_wechat_pay_redirect_to_android_app::PaymentIntentNextActionWechatPayRedirectToAndroidApp; +pub mod payment_intent_next_action_wechat_pay_redirect_to_ios_app; +pub use payment_intent_next_action_wechat_pay_redirect_to_ios_app::PaymentIntentNextActionWechatPayRedirectToIosApp; +pub mod payment_intent_payment_method_options; +pub use payment_intent_payment_method_options::PaymentIntentPaymentMethodOptions; +pub mod payment_intent_payment_method_options_acss_debit; +pub use payment_intent_payment_method_options_acss_debit::PaymentIntentPaymentMethodOptionsAcssDebit; +pub mod payment_intent_payment_method_options_au_becs_debit; +pub use payment_intent_payment_method_options_au_becs_debit::PaymentIntentPaymentMethodOptionsAuBecsDebit; +pub mod payment_intent_payment_method_options_blik; +pub use payment_intent_payment_method_options_blik::PaymentIntentPaymentMethodOptionsBlik; +pub mod payment_intent_payment_method_options_card; +pub use payment_intent_payment_method_options_card::PaymentIntentPaymentMethodOptionsCard; +pub mod payment_intent_payment_method_options_eps; +pub use payment_intent_payment_method_options_eps::PaymentIntentPaymentMethodOptionsEps; +pub mod payment_intent_payment_method_options_link; +pub use payment_intent_payment_method_options_link::PaymentIntentPaymentMethodOptionsLink; +pub mod payment_intent_payment_method_options_mandate_options_acss_debit; +pub use payment_intent_payment_method_options_mandate_options_acss_debit::PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit; +pub mod payment_intent_payment_method_options_mandate_options_sepa_debit; +pub use payment_intent_payment_method_options_mandate_options_sepa_debit::PaymentIntentPaymentMethodOptionsMandateOptionsSepaDebit; +pub mod payment_intent_payment_method_options_sepa_debit; +pub use payment_intent_payment_method_options_sepa_debit::PaymentIntentPaymentMethodOptionsSepaDebit; +pub mod payment_intent_payment_method_options_us_bank_account; +pub use payment_intent_payment_method_options_us_bank_account::PaymentIntentPaymentMethodOptionsUsBankAccount; +pub mod payment_intent_processing; +pub use payment_intent_processing::PaymentIntentProcessing; +pub mod payment_intent_processing_customer_notification; +pub use payment_intent_processing_customer_notification::PaymentIntentProcessingCustomerNotification; +pub mod usage_record_summary; +pub use usage_record_summary::UsageRecordSummary; +pub mod payment_link; +pub use payment_link::PaymentLink; +pub mod payment_links_resource_after_completion; +pub use payment_links_resource_after_completion::PaymentLinksResourceAfterCompletion; +pub mod payment_links_resource_automatic_tax; +pub use payment_links_resource_automatic_tax::PaymentLinksResourceAutomaticTax; +pub mod payment_links_resource_completion_behavior_confirmation_page; +pub use payment_links_resource_completion_behavior_confirmation_page::PaymentLinksResourceCompletionBehaviorConfirmationPage; +pub mod payment_links_resource_completion_behavior_redirect; +pub use payment_links_resource_completion_behavior_redirect::PaymentLinksResourceCompletionBehaviorRedirect; +pub mod payment_links_resource_consent_collection; +pub use payment_links_resource_consent_collection::PaymentLinksResourceConsentCollection; +pub mod payment_links_resource_custom_fields; +pub use payment_links_resource_custom_fields::PaymentLinksResourceCustomFields; +pub mod payment_links_resource_custom_fields_dropdown; +pub use payment_links_resource_custom_fields_dropdown::PaymentLinksResourceCustomFieldsDropdown; +pub mod payment_links_resource_custom_fields_dropdown_option; +pub use payment_links_resource_custom_fields_dropdown_option::PaymentLinksResourceCustomFieldsDropdownOption; +pub mod payment_links_resource_custom_fields_label; +pub use payment_links_resource_custom_fields_label::PaymentLinksResourceCustomFieldsLabel; +pub mod payment_links_resource_custom_fields_numeric; +pub use payment_links_resource_custom_fields_numeric::PaymentLinksResourceCustomFieldsNumeric; +pub mod payment_links_resource_custom_fields_text; +pub use payment_links_resource_custom_fields_text::PaymentLinksResourceCustomFieldsText; +pub mod payment_links_resource_custom_text; +pub use payment_links_resource_custom_text::PaymentLinksResourceCustomText; +pub mod payment_links_resource_custom_text_position; +pub use payment_links_resource_custom_text_position::PaymentLinksResourceCustomTextPosition; +pub mod payment_links_resource_invoice_creation; +pub use payment_links_resource_invoice_creation::PaymentLinksResourceInvoiceCreation; +pub mod payment_links_resource_invoice_settings; +pub use payment_links_resource_invoice_settings::PaymentLinksResourceInvoiceSettings; +pub mod payment_links_resource_payment_intent_data; +pub use payment_links_resource_payment_intent_data::PaymentLinksResourcePaymentIntentData; +pub mod payment_links_resource_phone_number_collection; +pub use payment_links_resource_phone_number_collection::PaymentLinksResourcePhoneNumberCollection; +pub mod payment_links_resource_shipping_address_collection; +pub use payment_links_resource_shipping_address_collection::PaymentLinksResourceShippingAddressCollection; +pub mod payment_links_resource_shipping_option; +pub use payment_links_resource_shipping_option::PaymentLinksResourceShippingOption; +pub mod payment_links_resource_subscription_data; +pub use payment_links_resource_subscription_data::PaymentLinksResourceSubscriptionData; +pub mod payment_links_resource_tax_id_collection; +pub use payment_links_resource_tax_id_collection::PaymentLinksResourceTaxIdCollection; +pub mod payment_links_resource_transfer_data; +pub use payment_links_resource_transfer_data::PaymentLinksResourceTransferData; +pub mod payment_method; +pub use payment_method::PaymentMethod; +pub mod payment_method_acss_debit; +pub use payment_method_acss_debit::PaymentMethodAcssDebit; +pub mod payment_method_affirm; +pub use payment_method_affirm::PaymentMethodAffirm; +pub mod payment_method_afterpay_clearpay; +pub use payment_method_afterpay_clearpay::PaymentMethodAfterpayClearpay; +pub mod payment_method_au_becs_debit; +pub use payment_method_au_becs_debit::PaymentMethodAuBecsDebit; +pub mod payment_method_bacs_debit; +pub use payment_method_bacs_debit::PaymentMethodBacsDebit; +pub mod payment_method_bancontact; +pub use payment_method_bancontact::PaymentMethodBancontact; +pub mod payment_method_blik; +pub use payment_method_blik::PaymentMethodBlik; +pub mod payment_method_boleto; +pub use payment_method_boleto::PaymentMethodBoleto; +pub mod payment_method_card; +pub use payment_method_card::PaymentMethodCard; +pub mod payment_method_card_checks; +pub use payment_method_card_checks::PaymentMethodCardChecks; +pub mod payment_method_card_present; +pub use payment_method_card_present::PaymentMethodCardPresent; +pub mod payment_method_card_present_networks; +pub use payment_method_card_present_networks::PaymentMethodCardPresentNetworks; +pub mod payment_method_card_wallet; +pub use payment_method_card_wallet::PaymentMethodCardWallet; +pub mod payment_method_card_wallet_amex_express_checkout; +pub use payment_method_card_wallet_amex_express_checkout::PaymentMethodCardWalletAmexExpressCheckout; +pub mod payment_method_card_wallet_apple_pay; +pub use payment_method_card_wallet_apple_pay::PaymentMethodCardWalletApplePay; +pub mod payment_method_card_wallet_google_pay; +pub use payment_method_card_wallet_google_pay::PaymentMethodCardWalletGooglePay; +pub mod payment_method_card_wallet_link; +pub use payment_method_card_wallet_link::PaymentMethodCardWalletLink; +pub mod payment_method_card_wallet_masterpass; +pub use payment_method_card_wallet_masterpass::PaymentMethodCardWalletMasterpass; +pub mod payment_method_card_wallet_samsung_pay; +pub use payment_method_card_wallet_samsung_pay::PaymentMethodCardWalletSamsungPay; +pub mod payment_method_card_wallet_visa_checkout; +pub use payment_method_card_wallet_visa_checkout::PaymentMethodCardWalletVisaCheckout; +pub mod payment_method_cashapp; +pub use payment_method_cashapp::PaymentMethodCashapp; +pub mod payment_method_config_biz_payment_method_configuration_details; +pub use payment_method_config_biz_payment_method_configuration_details::PaymentMethodConfigBizPaymentMethodConfigurationDetails; +pub mod payment_method_customer_balance; +pub use payment_method_customer_balance::PaymentMethodCustomerBalance; +pub mod payment_method_details; +pub use payment_method_details::PaymentMethodDetails; +pub mod payment_method_details_ach_credit_transfer; +pub use payment_method_details_ach_credit_transfer::PaymentMethodDetailsAchCreditTransfer; +pub mod payment_method_details_ach_debit; +pub use payment_method_details_ach_debit::PaymentMethodDetailsAchDebit; +pub mod payment_method_details_acss_debit; +pub use payment_method_details_acss_debit::PaymentMethodDetailsAcssDebit; +pub mod payment_method_details_affirm; +pub use payment_method_details_affirm::PaymentMethodDetailsAffirm; +pub mod payment_method_details_afterpay_clearpay; +pub use payment_method_details_afterpay_clearpay::PaymentMethodDetailsAfterpayClearpay; +pub mod payment_method_details_au_becs_debit; +pub use payment_method_details_au_becs_debit::PaymentMethodDetailsAuBecsDebit; +pub mod payment_method_details_bacs_debit; +pub use payment_method_details_bacs_debit::PaymentMethodDetailsBacsDebit; +pub mod payment_method_details_bancontact; +pub use payment_method_details_bancontact::PaymentMethodDetailsBancontact; +pub mod payment_method_details_blik; +pub use payment_method_details_blik::PaymentMethodDetailsBlik; +pub mod payment_method_details_boleto; +pub use payment_method_details_boleto::PaymentMethodDetailsBoleto; +pub mod payment_method_details_card; +pub use payment_method_details_card::PaymentMethodDetailsCard; +pub mod payment_method_details_card_checks; +pub use payment_method_details_card_checks::PaymentMethodDetailsCardChecks; +pub mod payment_method_details_card_installments; +pub use payment_method_details_card_installments::PaymentMethodDetailsCardInstallments; +pub mod payment_method_details_card_installments_plan; +pub use payment_method_details_card_installments_plan::PaymentMethodDetailsCardInstallmentsPlan; +pub mod payment_method_details_card_network_token; +pub use payment_method_details_card_network_token::PaymentMethodDetailsCardNetworkToken; +pub mod payment_method_details_card_present; +pub use payment_method_details_card_present::PaymentMethodDetailsCardPresent; +pub mod payment_method_details_card_present_offline; +pub use payment_method_details_card_present_offline::PaymentMethodDetailsCardPresentOffline; +pub mod payment_method_details_card_present_receipt; +pub use payment_method_details_card_present_receipt::PaymentMethodDetailsCardPresentReceipt; +pub mod payment_method_details_card_wallet; +pub use payment_method_details_card_wallet::PaymentMethodDetailsCardWallet; +pub mod payment_method_details_card_wallet_amex_express_checkout; +pub use payment_method_details_card_wallet_amex_express_checkout::PaymentMethodDetailsCardWalletAmexExpressCheckout; +pub mod payment_method_details_card_wallet_apple_pay; +pub use payment_method_details_card_wallet_apple_pay::PaymentMethodDetailsCardWalletApplePay; +pub mod payment_method_details_card_wallet_google_pay; +pub use payment_method_details_card_wallet_google_pay::PaymentMethodDetailsCardWalletGooglePay; +pub mod payment_method_details_card_wallet_link; +pub use payment_method_details_card_wallet_link::PaymentMethodDetailsCardWalletLink; +pub mod payment_method_details_card_wallet_masterpass; +pub use payment_method_details_card_wallet_masterpass::PaymentMethodDetailsCardWalletMasterpass; +pub mod payment_method_details_card_wallet_samsung_pay; +pub use payment_method_details_card_wallet_samsung_pay::PaymentMethodDetailsCardWalletSamsungPay; +pub mod payment_method_details_card_wallet_visa_checkout; +pub use payment_method_details_card_wallet_visa_checkout::PaymentMethodDetailsCardWalletVisaCheckout; +pub mod payment_method_details_cashapp; +pub use payment_method_details_cashapp::PaymentMethodDetailsCashapp; +pub mod payment_method_details_customer_balance; +pub use payment_method_details_customer_balance::PaymentMethodDetailsCustomerBalance; +pub mod payment_method_details_eps; +pub use payment_method_details_eps::PaymentMethodDetailsEps; +pub mod payment_method_details_fpx; +pub use payment_method_details_fpx::PaymentMethodDetailsFpx; +pub mod payment_method_details_giropay; +pub use payment_method_details_giropay::PaymentMethodDetailsGiropay; +pub mod payment_method_details_grabpay; +pub use payment_method_details_grabpay::PaymentMethodDetailsGrabpay; +pub mod payment_method_details_ideal; +pub use payment_method_details_ideal::PaymentMethodDetailsIdeal; +pub mod payment_method_details_interac_present; +pub use payment_method_details_interac_present::PaymentMethodDetailsInteracPresent; +pub mod payment_method_details_interac_present_receipt; +pub use payment_method_details_interac_present_receipt::PaymentMethodDetailsInteracPresentReceipt; +pub mod payment_method_details_klarna; +pub use payment_method_details_klarna::PaymentMethodDetailsKlarna; +pub mod payment_method_details_konbini; +pub use payment_method_details_konbini::PaymentMethodDetailsKonbini; +pub mod payment_method_details_konbini_store; +pub use payment_method_details_konbini_store::PaymentMethodDetailsKonbiniStore; +pub mod payment_method_details_link; +pub use payment_method_details_link::PaymentMethodDetailsLink; +pub mod payment_method_details_multibanco; +pub use payment_method_details_multibanco::PaymentMethodDetailsMultibanco; +pub mod payment_method_details_oxxo; +pub use payment_method_details_oxxo::PaymentMethodDetailsOxxo; +pub mod payment_method_details_p24; +pub use payment_method_details_p24::PaymentMethodDetailsP24; +pub mod payment_method_details_paynow; +pub use payment_method_details_paynow::PaymentMethodDetailsPaynow; +pub mod payment_method_details_paypal; +pub use payment_method_details_paypal::PaymentMethodDetailsPaypal; +pub mod payment_method_details_pix; +pub use payment_method_details_pix::PaymentMethodDetailsPix; +pub mod payment_method_details_promptpay; +pub use payment_method_details_promptpay::PaymentMethodDetailsPromptpay; +pub mod payment_method_details_revolut_pay; +pub use payment_method_details_revolut_pay::PaymentMethodDetailsRevolutPay; +pub mod payment_method_details_sepa_credit_transfer; +pub use payment_method_details_sepa_credit_transfer::PaymentMethodDetailsSepaCreditTransfer; +pub mod payment_method_details_sepa_debit; +pub use payment_method_details_sepa_debit::PaymentMethodDetailsSepaDebit; +pub mod payment_method_details_sofort; +pub use payment_method_details_sofort::PaymentMethodDetailsSofort; +pub mod payment_method_details_stripe_account; +pub use payment_method_details_stripe_account::PaymentMethodDetailsStripeAccount; +pub mod payment_method_details_us_bank_account; +pub use payment_method_details_us_bank_account::PaymentMethodDetailsUsBankAccount; +pub mod payment_method_details_wechat; +pub use payment_method_details_wechat::PaymentMethodDetailsWechat; +pub mod payment_method_details_wechat_pay; +pub use payment_method_details_wechat_pay::PaymentMethodDetailsWechatPay; +pub mod payment_method_details_zip; +pub use payment_method_details_zip::PaymentMethodDetailsZip; +pub mod payment_method_eps; +pub use payment_method_eps::PaymentMethodEps; +pub mod payment_method_fpx; +pub use payment_method_fpx::PaymentMethodFpx; +pub mod payment_method_giropay; +pub use payment_method_giropay::PaymentMethodGiropay; +pub mod payment_method_grabpay; +pub use payment_method_grabpay::PaymentMethodGrabpay; +pub mod payment_method_ideal; +pub use payment_method_ideal::PaymentMethodIdeal; +pub mod payment_method_interac_present; +pub use payment_method_interac_present::PaymentMethodInteracPresent; +pub mod payment_method_klarna; +pub use payment_method_klarna::PaymentMethodKlarna; +pub mod payment_method_konbini; +pub use payment_method_konbini::PaymentMethodKonbini; +pub mod payment_method_link; +pub use payment_method_link::PaymentMethodLink; +pub mod payment_method_options_affirm; +pub use payment_method_options_affirm::PaymentMethodOptionsAffirm; +pub mod payment_method_options_afterpay_clearpay; +pub use payment_method_options_afterpay_clearpay::PaymentMethodOptionsAfterpayClearpay; +pub mod payment_method_options_alipay; +pub use payment_method_options_alipay::PaymentMethodOptionsAlipay; +pub mod payment_method_options_bacs_debit; +pub use payment_method_options_bacs_debit::PaymentMethodOptionsBacsDebit; +pub mod payment_method_options_bancontact; +pub use payment_method_options_bancontact::PaymentMethodOptionsBancontact; +pub mod payment_method_options_boleto; +pub use payment_method_options_boleto::PaymentMethodOptionsBoleto; +pub mod payment_method_options_card_installments; +pub use payment_method_options_card_installments::PaymentMethodOptionsCardInstallments; +pub mod payment_method_options_card_mandate_options; +pub use payment_method_options_card_mandate_options::PaymentMethodOptionsCardMandateOptions; +pub mod payment_method_options_card_present; +pub use payment_method_options_card_present::PaymentMethodOptionsCardPresent; +pub mod payment_method_options_cashapp; +pub use payment_method_options_cashapp::PaymentMethodOptionsCashapp; +pub mod payment_method_options_customer_balance; +pub use payment_method_options_customer_balance::PaymentMethodOptionsCustomerBalance; +pub mod payment_method_options_customer_balance_bank_transfer; +pub use payment_method_options_customer_balance_bank_transfer::PaymentMethodOptionsCustomerBalanceBankTransfer; +pub mod payment_method_options_customer_balance_eu_bank_account; +pub use payment_method_options_customer_balance_eu_bank_account::PaymentMethodOptionsCustomerBalanceEuBankAccount; +pub mod payment_method_options_fpx; +pub use payment_method_options_fpx::PaymentMethodOptionsFpx; +pub mod payment_method_options_giropay; +pub use payment_method_options_giropay::PaymentMethodOptionsGiropay; +pub mod payment_method_options_grabpay; +pub use payment_method_options_grabpay::PaymentMethodOptionsGrabpay; +pub mod payment_method_options_ideal; +pub use payment_method_options_ideal::PaymentMethodOptionsIdeal; +pub mod payment_method_options_interac_present; +pub use payment_method_options_interac_present::PaymentMethodOptionsInteracPresent; +pub mod payment_method_options_klarna; +pub use payment_method_options_klarna::PaymentMethodOptionsKlarna; +pub mod payment_method_options_konbini; +pub use payment_method_options_konbini::PaymentMethodOptionsKonbini; +pub mod payment_method_options_oxxo; +pub use payment_method_options_oxxo::PaymentMethodOptionsOxxo; +pub mod payment_method_options_p24; +pub use payment_method_options_p24::PaymentMethodOptionsP24; +pub mod payment_method_options_paynow; +pub use payment_method_options_paynow::PaymentMethodOptionsPaynow; +pub mod payment_method_options_paypal; +pub use payment_method_options_paypal::PaymentMethodOptionsPaypal; +pub mod payment_method_options_pix; +pub use payment_method_options_pix::PaymentMethodOptionsPix; +pub mod payment_method_options_promptpay; +pub use payment_method_options_promptpay::PaymentMethodOptionsPromptpay; +pub mod payment_method_options_revolut_pay; +pub use payment_method_options_revolut_pay::PaymentMethodOptionsRevolutPay; +pub mod payment_method_options_sofort; +pub use payment_method_options_sofort::PaymentMethodOptionsSofort; +pub mod payment_method_options_wechat_pay; +pub use payment_method_options_wechat_pay::PaymentMethodOptionsWechatPay; +pub mod payment_method_options_zip; +pub use payment_method_options_zip::PaymentMethodOptionsZip; +pub mod payment_method_oxxo; +pub use payment_method_oxxo::PaymentMethodOxxo; +pub mod payment_method_p24; +pub use payment_method_p24::PaymentMethodP24; +pub mod payment_method_paynow; +pub use payment_method_paynow::PaymentMethodPaynow; +pub mod payment_method_paypal; +pub use payment_method_paypal::PaymentMethodPaypal; +pub mod payment_method_pix; +pub use payment_method_pix::PaymentMethodPix; +pub mod payment_method_promptpay; +pub use payment_method_promptpay::PaymentMethodPromptpay; +pub mod payment_method_revolut_pay; +pub use payment_method_revolut_pay::PaymentMethodRevolutPay; +pub mod payment_method_sepa_debit; +pub use payment_method_sepa_debit::PaymentMethodSepaDebit; +pub mod payment_method_sofort; +pub use payment_method_sofort::PaymentMethodSofort; +pub mod payment_method_us_bank_account; +pub use payment_method_us_bank_account::PaymentMethodUsBankAccount; +pub mod payment_method_us_bank_account_blocked; +pub use payment_method_us_bank_account_blocked::PaymentMethodUsBankAccountBlocked; +pub mod payment_method_us_bank_account_status_details; +pub use payment_method_us_bank_account_status_details::PaymentMethodUsBankAccountStatusDetails; +pub mod payment_method_wechat_pay; +pub use payment_method_wechat_pay::PaymentMethodWechatPay; +pub mod payment_method_zip; +pub use payment_method_zip::PaymentMethodZip; +pub mod payment_source; +pub use payment_source::PaymentSource; +pub mod payout; +pub use payout::Payout; +pub mod paypal_seller_protection; +pub use paypal_seller_protection::PaypalSellerProtection; +pub mod period; +pub use period::Period; +pub mod person; +pub use person::Person; +pub mod person_additional_tos_acceptance; +pub use person_additional_tos_acceptance::PersonAdditionalTosAcceptance; +pub mod person_additional_tos_acceptances; +pub use person_additional_tos_acceptances::PersonAdditionalTosAcceptances; +pub mod person_future_requirements; +pub use person_future_requirements::PersonFutureRequirements; +pub mod person_relationship; +pub use person_relationship::PersonRelationship; +pub mod person_requirements; +pub use person_requirements::PersonRequirements; +pub mod plan; +pub use plan::Plan; +pub mod plan_tier; +pub use plan_tier::PlanTier; +pub mod platform_tax; +pub use platform_tax::PlatformTax; +pub mod price; +pub use price::Price; +pub mod price_tier; +pub use price_tier::PriceTier; +pub mod product; +pub use product::Product; +pub mod product_feature; +pub use product_feature::ProductFeature; +pub mod promotion_code; +pub use promotion_code::PromotionCode; +pub mod promotion_code_currency_option; +pub use promotion_code_currency_option::PromotionCodeCurrencyOption; +pub mod promotion_codes_resource_restrictions; +pub use promotion_codes_resource_restrictions::PromotionCodesResourceRestrictions; +pub mod quote; +pub use quote::Quote; +pub mod quotes_resource_automatic_tax; +pub use quotes_resource_automatic_tax::QuotesResourceAutomaticTax; +pub mod quotes_resource_computed; +pub use quotes_resource_computed::QuotesResourceComputed; +pub mod quotes_resource_from_quote; +pub use quotes_resource_from_quote::QuotesResourceFromQuote; +pub mod quotes_resource_recurring; +pub use quotes_resource_recurring::QuotesResourceRecurring; +pub mod quotes_resource_status_transitions; +pub use quotes_resource_status_transitions::QuotesResourceStatusTransitions; +pub mod quotes_resource_subscription_data_subscription_data; +pub use quotes_resource_subscription_data_subscription_data::QuotesResourceSubscriptionDataSubscriptionData; +pub mod quotes_resource_total_details; +pub use quotes_resource_total_details::QuotesResourceTotalDetails; +pub mod quotes_resource_total_details_resource_breakdown; +pub use quotes_resource_total_details_resource_breakdown::QuotesResourceTotalDetailsResourceBreakdown; +pub mod quotes_resource_transfer_data; +pub use quotes_resource_transfer_data::QuotesResourceTransferData; +pub mod quotes_resource_upfront; +pub use quotes_resource_upfront::QuotesResourceUpfront; +pub mod radar_radar_options; +pub use radar_radar_options::RadarRadarOptions; +pub mod radar_review_resource_location; +pub use radar_review_resource_location::RadarReviewResourceLocation; +pub mod radar_review_resource_session; +pub use radar_review_resource_session::RadarReviewResourceSession; +pub mod recurring; +pub use recurring::Recurring; +pub mod refund; +pub use refund::Refund; +pub mod refund_next_action; +pub use refund_next_action::RefundNextAction; +pub mod refund_next_action_display_details; +pub use refund_next_action_display_details::RefundNextActionDisplayDetails; +pub mod reserve_transaction; +pub use reserve_transaction::ReserveTransaction; +pub mod radar_review; +pub use radar_review::RadarReview; +pub mod radar_rule; +pub use radar_rule::RadarRule; +pub mod schedules_phase_automatic_tax; +pub use schedules_phase_automatic_tax::SchedulesPhaseAutomaticTax; +pub mod sepa_debit_generated_from; +pub use sepa_debit_generated_from::SepaDebitGeneratedFrom; +pub mod payment_flows_setup_intent_setup_attempt; +pub use payment_flows_setup_intent_setup_attempt::PaymentFlowsSetupIntentSetupAttempt; +pub mod setup_attempt_payment_method_details; +pub use setup_attempt_payment_method_details::SetupAttemptPaymentMethodDetails; +pub mod setup_attempt_payment_method_details_acss_debit; +pub use setup_attempt_payment_method_details_acss_debit::SetupAttemptPaymentMethodDetailsAcssDebit; +pub mod setup_attempt_payment_method_details_au_becs_debit; +pub use setup_attempt_payment_method_details_au_becs_debit::SetupAttemptPaymentMethodDetailsAuBecsDebit; +pub mod setup_attempt_payment_method_details_bacs_debit; +pub use setup_attempt_payment_method_details_bacs_debit::SetupAttemptPaymentMethodDetailsBacsDebit; +pub mod setup_attempt_payment_method_details_bancontact; +pub use setup_attempt_payment_method_details_bancontact::SetupAttemptPaymentMethodDetailsBancontact; +pub mod setup_attempt_payment_method_details_boleto; +pub use setup_attempt_payment_method_details_boleto::SetupAttemptPaymentMethodDetailsBoleto; +pub mod setup_attempt_payment_method_details_card; +pub use setup_attempt_payment_method_details_card::SetupAttemptPaymentMethodDetailsCard; +pub mod setup_attempt_payment_method_details_card_checks; +pub use setup_attempt_payment_method_details_card_checks::SetupAttemptPaymentMethodDetailsCardChecks; +pub mod setup_attempt_payment_method_details_card_present; +pub use setup_attempt_payment_method_details_card_present::SetupAttemptPaymentMethodDetailsCardPresent; +pub mod setup_attempt_payment_method_details_card_wallet; +pub use setup_attempt_payment_method_details_card_wallet::SetupAttemptPaymentMethodDetailsCardWallet; +pub mod setup_attempt_payment_method_details_cashapp; +pub use setup_attempt_payment_method_details_cashapp::SetupAttemptPaymentMethodDetailsCashapp; +pub mod setup_attempt_payment_method_details_ideal; +pub use setup_attempt_payment_method_details_ideal::SetupAttemptPaymentMethodDetailsIdeal; +pub mod setup_attempt_payment_method_details_klarna; +pub use setup_attempt_payment_method_details_klarna::SetupAttemptPaymentMethodDetailsKlarna; +pub mod setup_attempt_payment_method_details_link; +pub use setup_attempt_payment_method_details_link::SetupAttemptPaymentMethodDetailsLink; +pub mod setup_attempt_payment_method_details_paypal; +pub use setup_attempt_payment_method_details_paypal::SetupAttemptPaymentMethodDetailsPaypal; +pub mod setup_attempt_payment_method_details_sepa_debit; +pub use setup_attempt_payment_method_details_sepa_debit::SetupAttemptPaymentMethodDetailsSepaDebit; +pub mod setup_attempt_payment_method_details_sofort; +pub use setup_attempt_payment_method_details_sofort::SetupAttemptPaymentMethodDetailsSofort; +pub mod setup_attempt_payment_method_details_us_bank_account; +pub use setup_attempt_payment_method_details_us_bank_account::SetupAttemptPaymentMethodDetailsUsBankAccount; +pub mod setup_intent; +pub use setup_intent::SetupIntent; +pub mod setup_intent_next_action; +pub use setup_intent_next_action::SetupIntentNextAction; +pub mod setup_intent_next_action_redirect_to_url; +pub use setup_intent_next_action_redirect_to_url::SetupIntentNextActionRedirectToUrl; +pub mod setup_intent_next_action_verify_with_microdeposits; +pub use setup_intent_next_action_verify_with_microdeposits::SetupIntentNextActionVerifyWithMicrodeposits; +pub mod setup_intent_payment_method_options; +pub use setup_intent_payment_method_options::SetupIntentPaymentMethodOptions; +pub mod setup_intent_payment_method_options_acss_debit; +pub use setup_intent_payment_method_options_acss_debit::SetupIntentPaymentMethodOptionsAcssDebit; +pub mod setup_intent_payment_method_options_card; +pub use setup_intent_payment_method_options_card::SetupIntentPaymentMethodOptionsCard; +pub mod setup_intent_payment_method_options_card_mandate_options; +pub use setup_intent_payment_method_options_card_mandate_options::SetupIntentPaymentMethodOptionsCardMandateOptions; +pub mod setup_intent_payment_method_options_link; +pub use setup_intent_payment_method_options_link::SetupIntentPaymentMethodOptionsLink; +pub mod setup_intent_payment_method_options_mandate_options_acss_debit; +pub use setup_intent_payment_method_options_mandate_options_acss_debit::SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit; +pub mod setup_intent_payment_method_options_mandate_options_sepa_debit; +pub use setup_intent_payment_method_options_mandate_options_sepa_debit::SetupIntentPaymentMethodOptionsMandateOptionsSepaDebit; +pub mod setup_intent_payment_method_options_paypal; +pub use setup_intent_payment_method_options_paypal::SetupIntentPaymentMethodOptionsPaypal; +pub mod setup_intent_payment_method_options_sepa_debit; +pub use setup_intent_payment_method_options_sepa_debit::SetupIntentPaymentMethodOptionsSepaDebit; +pub mod setup_intent_payment_method_options_us_bank_account; +pub use setup_intent_payment_method_options_us_bank_account::SetupIntentPaymentMethodOptionsUsBankAccount; +pub mod shipping; +pub use shipping::Shipping; +pub mod shipping_rate; +pub use shipping_rate::ShippingRate; +pub mod shipping_rate_currency_option; +pub use shipping_rate_currency_option::ShippingRateCurrencyOption; +pub mod shipping_rate_delivery_estimate; +pub use shipping_rate_delivery_estimate::ShippingRateDeliveryEstimate; +pub mod shipping_rate_delivery_estimate_bound; +pub use shipping_rate_delivery_estimate_bound::ShippingRateDeliveryEstimateBound; +pub mod shipping_rate_fixed_amount; +pub use shipping_rate_fixed_amount::ShippingRateFixedAmount; +pub mod source; +pub use source::Source; +pub mod source_code_verification_flow; +pub use source_code_verification_flow::SourceCodeVerificationFlow; +pub mod us_bank_account_networks; +pub use us_bank_account_networks::UsBankAccountNetworks; +pub mod source_order; +pub use source_order::SourceOrder; +pub mod source_order_item; +pub use source_order_item::SourceOrderItem; +pub mod source_owner; +pub use source_owner::SourceOwner; +pub mod source_receiver_flow; +pub use source_receiver_flow::SourceReceiverFlow; +pub mod source_redirect_flow; +pub use source_redirect_flow::SourceRedirectFlow; +pub mod source_transaction; +pub use source_transaction::SourceTransaction; +pub mod source_transaction_ach_credit_transfer_data; +pub use source_transaction_ach_credit_transfer_data::SourceTransactionAchCreditTransferData; +pub mod source_transaction_chf_credit_transfer_data; +pub use source_transaction_chf_credit_transfer_data::SourceTransactionChfCreditTransferData; +pub mod source_transaction_gbp_credit_transfer_data; +pub use source_transaction_gbp_credit_transfer_data::SourceTransactionGbpCreditTransferData; +pub mod source_transaction_paper_check_data; +pub use source_transaction_paper_check_data::SourceTransactionPaperCheckData; +pub mod source_transaction_sepa_credit_transfer_data; +pub use source_transaction_sepa_credit_transfer_data::SourceTransactionSepaCreditTransferData; +pub mod source_type_ach_credit_transfer; +pub use source_type_ach_credit_transfer::SourceTypeAchCreditTransfer; +pub mod source_type_ach_debit; +pub use source_type_ach_debit::SourceTypeAchDebit; +pub mod source_type_acss_debit; +pub use source_type_acss_debit::SourceTypeAcssDebit; +pub mod source_type_alipay; +pub use source_type_alipay::SourceTypeAlipay; +pub mod source_type_au_becs_debit; +pub use source_type_au_becs_debit::SourceTypeAuBecsDebit; +pub mod source_type_bancontact; +pub use source_type_bancontact::SourceTypeBancontact; +pub mod source_type_card; +pub use source_type_card::SourceTypeCard; +pub mod source_type_card_present; +pub use source_type_card_present::SourceTypeCardPresent; +pub mod source_type_eps; +pub use source_type_eps::SourceTypeEps; +pub mod source_type_giropay; +pub use source_type_giropay::SourceTypeGiropay; +pub mod source_type_ideal; +pub use source_type_ideal::SourceTypeIdeal; +pub mod source_type_klarna; +pub use source_type_klarna::SourceTypeKlarna; +pub mod source_type_multibanco; +pub use source_type_multibanco::SourceTypeMultibanco; +pub mod source_type_p24; +pub use source_type_p24::SourceTypeP24; +pub mod source_type_sepa_credit_transfer; +pub use source_type_sepa_credit_transfer::SourceTypeSepaCreditTransfer; +pub mod source_type_sepa_debit; +pub use source_type_sepa_debit::SourceTypeSepaDebit; +pub mod source_type_sofort; +pub use source_type_sofort::SourceTypeSofort; +pub mod source_type_three_d_secure; +pub use source_type_three_d_secure::SourceTypeThreeDSecure; +pub mod source_type_wechat; +pub use source_type_wechat::SourceTypeWechat; +pub mod subscription; +pub use subscription::Subscription; +pub mod subscription_automatic_tax; +pub use subscription_automatic_tax::SubscriptionAutomaticTax; +pub mod subscription_billing_thresholds; +pub use subscription_billing_thresholds::SubscriptionBillingThresholds; +pub mod subscription_details_data; +pub use subscription_details_data::SubscriptionDetailsData; +pub mod subscription_item; +pub use subscription_item::SubscriptionItem; +pub mod subscription_item_billing_thresholds; +pub use subscription_item_billing_thresholds::SubscriptionItemBillingThresholds; +pub mod subscription_payment_method_options_card; +pub use subscription_payment_method_options_card::SubscriptionPaymentMethodOptionsCard; +pub mod subscription_pending_invoice_item_interval; +pub use subscription_pending_invoice_item_interval::SubscriptionPendingInvoiceItemInterval; +pub mod subscription_schedule; +pub use subscription_schedule::SubscriptionSchedule; +pub mod subscription_schedule_add_invoice_item; +pub use subscription_schedule_add_invoice_item::SubscriptionScheduleAddInvoiceItem; +pub mod subscription_schedule_configuration_item; +pub use subscription_schedule_configuration_item::SubscriptionScheduleConfigurationItem; +pub mod subscription_schedule_current_phase; +pub use subscription_schedule_current_phase::SubscriptionScheduleCurrentPhase; +pub mod subscription_schedule_phase_configuration; +pub use subscription_schedule_phase_configuration::SubscriptionSchedulePhaseConfiguration; +pub mod subscription_schedules_resource_default_settings; +pub use subscription_schedules_resource_default_settings::SubscriptionSchedulesResourceDefaultSettings; +pub mod subscription_schedules_resource_default_settings_automatic_tax; +pub use subscription_schedules_resource_default_settings_automatic_tax::SubscriptionSchedulesResourceDefaultSettingsAutomaticTax; +pub mod subscription_transfer_data; +pub use subscription_transfer_data::SubscriptionTransferData; +pub mod subscriptions_resource_pause_collection; +pub use subscriptions_resource_pause_collection::SubscriptionsResourcePauseCollection; +pub mod subscriptions_resource_payment_method_options; +pub use subscriptions_resource_payment_method_options::SubscriptionsResourcePaymentMethodOptions; +pub mod subscriptions_resource_payment_settings; +pub use subscriptions_resource_payment_settings::SubscriptionsResourcePaymentSettings; +pub mod subscriptions_resource_pending_update; +pub use subscriptions_resource_pending_update::SubscriptionsResourcePendingUpdate; +pub mod subscriptions_trials_resource_end_behavior; +pub use subscriptions_trials_resource_end_behavior::SubscriptionsTrialsResourceEndBehavior; +pub mod subscriptions_trials_resource_trial_settings; +pub use subscriptions_trials_resource_trial_settings::SubscriptionsTrialsResourceTrialSettings; +pub mod tax_product_resource_tax_code; +pub use tax_product_resource_tax_code::TaxProductResourceTaxCode; +pub mod tax_deducted_at_source; +pub use tax_deducted_at_source::TaxDeductedAtSource; +pub mod tax_id; +pub use tax_id::TaxId; +pub mod tax_id_verification; +pub use tax_id_verification::TaxIdVerification; +pub mod tax_rate; +pub use tax_rate::TaxRate; +pub mod test_clock; +pub use test_clock::TestClock; +pub mod three_d_secure_details; +pub use three_d_secure_details::ThreeDSecureDetails; +pub mod three_d_secure_details_charge; +pub use three_d_secure_details_charge::ThreeDSecureDetailsCharge; +pub mod three_d_secure_usage; +pub use three_d_secure_usage::ThreeDSecureUsage; +pub mod topup; +pub use topup::Topup; +pub mod transfer; +pub use transfer::Transfer; +pub mod transfer_data; +pub use transfer_data::TransferData; +pub mod transfer_reversal; +pub use transfer_reversal::TransferReversal; +pub mod transfer_schedule; +pub use transfer_schedule::TransferSchedule; +pub mod transform_quantity; +pub use transform_quantity::TransformQuantity; +pub mod transform_usage; +pub use transform_usage::TransformUsage; +pub mod api_version; +pub use api_version::ApiVersion; diff --git a/stripe_types/src/generated/networks/mod.rs b/stripe_types/src/generated/networks/mod.rs new file mode 100644 index 000000000..abd668913 --- /dev/null +++ b/stripe_types/src/generated/networks/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Networks { + /// All available networks for the card. + pub available: Vec, + /// The preferred network for the card. + pub preferred: Option, +} diff --git a/stripe_types/src/generated/notification_event/mod.rs b/stripe_types/src/generated/notification_event/mod.rs new file mode 100644 index 000000000..efa6a07eb --- /dev/null +++ b/stripe_types/src/generated/notification_event/mod.rs @@ -0,0 +1,793 @@ +/// Events are our way of letting you know when something interesting happens in +/// your account. +/// +/// When an interesting event occurs, we create a new `Event` object. +/// For example, when a charge succeeds, we create a `charge.succeeded` event, and when an invoice payment attempt fails, we create an `invoice.payment_failed` event. +/// Certain API requests might create multiple events. +/// For example, if you create a new subscription for a customer, you receive both a `customer.subscription.created` event and a `charge.succeeded` event. Events occur when the state of another API resource changes. +/// The event's data field embeds the resource's state at the time of the change. +/// For example, a `charge.succeeded` event contains a charge, and an `invoice.payment_failed` event contains an invoice. As with other API resources, you can use endpoints to retrieve an [individual event](https://stripe.com/docs/api#retrieve_event) or a [list of events](https://stripe.com/docs/api#list_events) from the API. +/// We also have a separate [webhooks](http://en.wikipedia.org/wiki/Webhook) system for sending the `Event` objects directly to an endpoint on your server. +/// You can manage webhooks in your [account settings](https://dashboard.stripe.com/account/webhooks). +/// Learn how to [listen for events](https://stripe.com/docs/webhooks) so that your integration can automatically trigger reactions. When using [Connect](https://stripe.com/docs/connect), you can also receive event notifications that occur in connected accounts. +/// For these events, there's an additional `account` attribute in the received `Event` object. We only guarantee access to events through the [Retrieve Event API](https://stripe.com/docs/api#retrieve_event) for 30 days. For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct NotificationEvent { + /// The connected account that originates the event. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + /// The Stripe API version used to render `data`. + /// + /// This property is populated only for events on or after October 31, 2014. + pub api_version: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + pub data: stripe_types::NotificationEventData, + /// Unique identifier for the object. + pub id: stripe_types::notification_event::EventId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify. + pub pending_webhooks: i64, + /// Information on the API request that triggers the event. + pub request: Option, + /// Description of the event (for example, `invoice.created` or `charge.refunded`). + #[serde(rename = "type")] + pub type_: NotificationEventType, +} +/// Description of the event (for example, `invoice.created` or `charge.refunded`). +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum NotificationEventType { + AccountApplicationAuthorized, + AccountApplicationDeauthorized, + AccountExternalAccountCreated, + AccountExternalAccountDeleted, + AccountExternalAccountUpdated, + AccountUpdated, + ApplicationFeeCreated, + ApplicationFeeRefundUpdated, + ApplicationFeeRefunded, + BalanceAvailable, + BillingPortalConfigurationCreated, + BillingPortalConfigurationUpdated, + BillingPortalSessionCreated, + CapabilityUpdated, + CashBalanceFundsAvailable, + ChargeCaptured, + ChargeDisputeClosed, + ChargeDisputeCreated, + ChargeDisputeFundsReinstated, + ChargeDisputeFundsWithdrawn, + ChargeDisputeUpdated, + ChargeExpired, + ChargeFailed, + ChargePending, + ChargeRefundUpdated, + ChargeRefunded, + ChargeSucceeded, + ChargeUpdated, + CheckoutSessionAsyncPaymentFailed, + CheckoutSessionAsyncPaymentSucceeded, + CheckoutSessionCompleted, + CheckoutSessionExpired, + CouponCreated, + CouponDeleted, + CouponUpdated, + CreditNoteCreated, + CreditNoteUpdated, + CreditNoteVoided, + CustomerCreated, + CustomerDeleted, + CustomerDiscountCreated, + CustomerDiscountDeleted, + CustomerDiscountUpdated, + CustomerSourceCreated, + CustomerSourceDeleted, + CustomerSourceExpiring, + CustomerSourceUpdated, + CustomerSubscriptionCreated, + CustomerSubscriptionDeleted, + CustomerSubscriptionPaused, + CustomerSubscriptionPendingUpdateApplied, + CustomerSubscriptionPendingUpdateExpired, + CustomerSubscriptionResumed, + CustomerSubscriptionTrialWillEnd, + CustomerSubscriptionUpdated, + CustomerTaxIdCreated, + CustomerTaxIdDeleted, + CustomerTaxIdUpdated, + CustomerUpdated, + CustomerCashBalanceTransactionCreated, + FileCreated, + FinancialConnectionsAccountCreated, + FinancialConnectionsAccountDeactivated, + FinancialConnectionsAccountDisconnected, + FinancialConnectionsAccountReactivated, + FinancialConnectionsAccountRefreshedBalance, + IdentityVerificationSessionCanceled, + IdentityVerificationSessionCreated, + IdentityVerificationSessionProcessing, + IdentityVerificationSessionRedacted, + IdentityVerificationSessionRequiresInput, + IdentityVerificationSessionVerified, + InvoiceCreated, + InvoiceDeleted, + InvoiceFinalizationFailed, + InvoiceFinalized, + InvoiceMarkedUncollectible, + InvoicePaid, + InvoicePaymentActionRequired, + InvoicePaymentFailed, + InvoicePaymentSucceeded, + InvoiceSent, + InvoiceUpcoming, + InvoiceUpdated, + InvoiceVoided, + InvoiceitemCreated, + InvoiceitemDeleted, + IssuingAuthorizationCreated, + IssuingAuthorizationRequest, + IssuingAuthorizationUpdated, + IssuingCardCreated, + IssuingCardUpdated, + IssuingCardholderCreated, + IssuingCardholderUpdated, + IssuingDisputeClosed, + IssuingDisputeCreated, + IssuingDisputeFundsReinstated, + IssuingDisputeSubmitted, + IssuingDisputeUpdated, + IssuingTokenCreated, + IssuingTokenUpdated, + IssuingTransactionCreated, + IssuingTransactionUpdated, + MandateUpdated, + PaymentIntentAmountCapturableUpdated, + PaymentIntentCanceled, + PaymentIntentCreated, + PaymentIntentPartiallyFunded, + PaymentIntentPaymentFailed, + PaymentIntentProcessing, + PaymentIntentRequiresAction, + PaymentIntentSucceeded, + PaymentLinkCreated, + PaymentLinkUpdated, + PaymentMethodAttached, + PaymentMethodAutomaticallyUpdated, + PaymentMethodDetached, + PaymentMethodUpdated, + PayoutCanceled, + PayoutCreated, + PayoutFailed, + PayoutPaid, + PayoutReconciliationCompleted, + PayoutUpdated, + PersonCreated, + PersonDeleted, + PersonUpdated, + PlanCreated, + PlanDeleted, + PlanUpdated, + PriceCreated, + PriceDeleted, + PriceUpdated, + ProductCreated, + ProductDeleted, + ProductUpdated, + PromotionCodeCreated, + PromotionCodeUpdated, + QuoteAccepted, + QuoteCanceled, + QuoteCreated, + QuoteFinalized, + RadarEarlyFraudWarningCreated, + RadarEarlyFraudWarningUpdated, + RefundCreated, + RefundUpdated, + ReportingReportRunFailed, + ReportingReportRunSucceeded, + ReportingReportTypeUpdated, + ReviewClosed, + ReviewOpened, + SetupIntentCanceled, + SetupIntentCreated, + SetupIntentRequiresAction, + SetupIntentSetupFailed, + SetupIntentSucceeded, + SigmaScheduledQueryRunCreated, + SourceCanceled, + SourceChargeable, + SourceFailed, + SourceMandateNotification, + SourceRefundAttributesRequired, + SourceTransactionCreated, + SourceTransactionUpdated, + SubscriptionScheduleAborted, + SubscriptionScheduleCanceled, + SubscriptionScheduleCompleted, + SubscriptionScheduleCreated, + SubscriptionScheduleExpiring, + SubscriptionScheduleReleased, + SubscriptionScheduleUpdated, + TaxSettingsUpdated, + TaxRateCreated, + TaxRateUpdated, + TerminalReaderActionFailed, + TerminalReaderActionSucceeded, + TestHelpersTestClockAdvancing, + TestHelpersTestClockCreated, + TestHelpersTestClockDeleted, + TestHelpersTestClockInternalFailure, + TestHelpersTestClockReady, + TopupCanceled, + TopupCreated, + TopupFailed, + TopupReversed, + TopupSucceeded, + TransferCreated, + TransferReversed, + TransferUpdated, + TreasuryCreditReversalCreated, + TreasuryCreditReversalPosted, + TreasuryDebitReversalCompleted, + TreasuryDebitReversalCreated, + TreasuryDebitReversalInitialCreditGranted, + TreasuryFinancialAccountClosed, + TreasuryFinancialAccountCreated, + TreasuryFinancialAccountFeaturesStatusUpdated, + TreasuryInboundTransferCanceled, + TreasuryInboundTransferCreated, + TreasuryInboundTransferFailed, + TreasuryInboundTransferSucceeded, + TreasuryOutboundPaymentCanceled, + TreasuryOutboundPaymentCreated, + TreasuryOutboundPaymentExpectedArrivalDateUpdated, + TreasuryOutboundPaymentFailed, + TreasuryOutboundPaymentPosted, + TreasuryOutboundPaymentReturned, + TreasuryOutboundTransferCanceled, + TreasuryOutboundTransferCreated, + TreasuryOutboundTransferExpectedArrivalDateUpdated, + TreasuryOutboundTransferFailed, + TreasuryOutboundTransferPosted, + TreasuryOutboundTransferReturned, + TreasuryReceivedCreditCreated, + TreasuryReceivedCreditFailed, + TreasuryReceivedCreditSucceeded, + TreasuryReceivedDebitCreated, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl NotificationEventType { + pub fn as_str(self) -> &'static str { + use NotificationEventType::*; + match self { + AccountApplicationAuthorized => "account.application.authorized", + AccountApplicationDeauthorized => "account.application.deauthorized", + AccountExternalAccountCreated => "account.external_account.created", + AccountExternalAccountDeleted => "account.external_account.deleted", + AccountExternalAccountUpdated => "account.external_account.updated", + AccountUpdated => "account.updated", + ApplicationFeeCreated => "application_fee.created", + ApplicationFeeRefundUpdated => "application_fee.refund.updated", + ApplicationFeeRefunded => "application_fee.refunded", + BalanceAvailable => "balance.available", + BillingPortalConfigurationCreated => "billing_portal.configuration.created", + BillingPortalConfigurationUpdated => "billing_portal.configuration.updated", + BillingPortalSessionCreated => "billing_portal.session.created", + CapabilityUpdated => "capability.updated", + CashBalanceFundsAvailable => "cash_balance.funds_available", + ChargeCaptured => "charge.captured", + ChargeDisputeClosed => "charge.dispute.closed", + ChargeDisputeCreated => "charge.dispute.created", + ChargeDisputeFundsReinstated => "charge.dispute.funds_reinstated", + ChargeDisputeFundsWithdrawn => "charge.dispute.funds_withdrawn", + ChargeDisputeUpdated => "charge.dispute.updated", + ChargeExpired => "charge.expired", + ChargeFailed => "charge.failed", + ChargePending => "charge.pending", + ChargeRefundUpdated => "charge.refund.updated", + ChargeRefunded => "charge.refunded", + ChargeSucceeded => "charge.succeeded", + ChargeUpdated => "charge.updated", + CheckoutSessionAsyncPaymentFailed => "checkout.session.async_payment_failed", + CheckoutSessionAsyncPaymentSucceeded => "checkout.session.async_payment_succeeded", + CheckoutSessionCompleted => "checkout.session.completed", + CheckoutSessionExpired => "checkout.session.expired", + CouponCreated => "coupon.created", + CouponDeleted => "coupon.deleted", + CouponUpdated => "coupon.updated", + CreditNoteCreated => "credit_note.created", + CreditNoteUpdated => "credit_note.updated", + CreditNoteVoided => "credit_note.voided", + CustomerCreated => "customer.created", + CustomerDeleted => "customer.deleted", + CustomerDiscountCreated => "customer.discount.created", + CustomerDiscountDeleted => "customer.discount.deleted", + CustomerDiscountUpdated => "customer.discount.updated", + CustomerSourceCreated => "customer.source.created", + CustomerSourceDeleted => "customer.source.deleted", + CustomerSourceExpiring => "customer.source.expiring", + CustomerSourceUpdated => "customer.source.updated", + CustomerSubscriptionCreated => "customer.subscription.created", + CustomerSubscriptionDeleted => "customer.subscription.deleted", + CustomerSubscriptionPaused => "customer.subscription.paused", + CustomerSubscriptionPendingUpdateApplied => { + "customer.subscription.pending_update_applied" + } + CustomerSubscriptionPendingUpdateExpired => { + "customer.subscription.pending_update_expired" + } + CustomerSubscriptionResumed => "customer.subscription.resumed", + CustomerSubscriptionTrialWillEnd => "customer.subscription.trial_will_end", + CustomerSubscriptionUpdated => "customer.subscription.updated", + CustomerTaxIdCreated => "customer.tax_id.created", + CustomerTaxIdDeleted => "customer.tax_id.deleted", + CustomerTaxIdUpdated => "customer.tax_id.updated", + CustomerUpdated => "customer.updated", + CustomerCashBalanceTransactionCreated => "customer_cash_balance_transaction.created", + FileCreated => "file.created", + FinancialConnectionsAccountCreated => "financial_connections.account.created", + FinancialConnectionsAccountDeactivated => "financial_connections.account.deactivated", + FinancialConnectionsAccountDisconnected => "financial_connections.account.disconnected", + FinancialConnectionsAccountReactivated => "financial_connections.account.reactivated", + FinancialConnectionsAccountRefreshedBalance => { + "financial_connections.account.refreshed_balance" + } + IdentityVerificationSessionCanceled => "identity.verification_session.canceled", + IdentityVerificationSessionCreated => "identity.verification_session.created", + IdentityVerificationSessionProcessing => "identity.verification_session.processing", + IdentityVerificationSessionRedacted => "identity.verification_session.redacted", + IdentityVerificationSessionRequiresInput => { + "identity.verification_session.requires_input" + } + IdentityVerificationSessionVerified => "identity.verification_session.verified", + InvoiceCreated => "invoice.created", + InvoiceDeleted => "invoice.deleted", + InvoiceFinalizationFailed => "invoice.finalization_failed", + InvoiceFinalized => "invoice.finalized", + InvoiceMarkedUncollectible => "invoice.marked_uncollectible", + InvoicePaid => "invoice.paid", + InvoicePaymentActionRequired => "invoice.payment_action_required", + InvoicePaymentFailed => "invoice.payment_failed", + InvoicePaymentSucceeded => "invoice.payment_succeeded", + InvoiceSent => "invoice.sent", + InvoiceUpcoming => "invoice.upcoming", + InvoiceUpdated => "invoice.updated", + InvoiceVoided => "invoice.voided", + InvoiceitemCreated => "invoiceitem.created", + InvoiceitemDeleted => "invoiceitem.deleted", + IssuingAuthorizationCreated => "issuing_authorization.created", + IssuingAuthorizationRequest => "issuing_authorization.request", + IssuingAuthorizationUpdated => "issuing_authorization.updated", + IssuingCardCreated => "issuing_card.created", + IssuingCardUpdated => "issuing_card.updated", + IssuingCardholderCreated => "issuing_cardholder.created", + IssuingCardholderUpdated => "issuing_cardholder.updated", + IssuingDisputeClosed => "issuing_dispute.closed", + IssuingDisputeCreated => "issuing_dispute.created", + IssuingDisputeFundsReinstated => "issuing_dispute.funds_reinstated", + IssuingDisputeSubmitted => "issuing_dispute.submitted", + IssuingDisputeUpdated => "issuing_dispute.updated", + IssuingTokenCreated => "issuing_token.created", + IssuingTokenUpdated => "issuing_token.updated", + IssuingTransactionCreated => "issuing_transaction.created", + IssuingTransactionUpdated => "issuing_transaction.updated", + MandateUpdated => "mandate.updated", + PaymentIntentAmountCapturableUpdated => "payment_intent.amount_capturable_updated", + PaymentIntentCanceled => "payment_intent.canceled", + PaymentIntentCreated => "payment_intent.created", + PaymentIntentPartiallyFunded => "payment_intent.partially_funded", + PaymentIntentPaymentFailed => "payment_intent.payment_failed", + PaymentIntentProcessing => "payment_intent.processing", + PaymentIntentRequiresAction => "payment_intent.requires_action", + PaymentIntentSucceeded => "payment_intent.succeeded", + PaymentLinkCreated => "payment_link.created", + PaymentLinkUpdated => "payment_link.updated", + PaymentMethodAttached => "payment_method.attached", + PaymentMethodAutomaticallyUpdated => "payment_method.automatically_updated", + PaymentMethodDetached => "payment_method.detached", + PaymentMethodUpdated => "payment_method.updated", + PayoutCanceled => "payout.canceled", + PayoutCreated => "payout.created", + PayoutFailed => "payout.failed", + PayoutPaid => "payout.paid", + PayoutReconciliationCompleted => "payout.reconciliation_completed", + PayoutUpdated => "payout.updated", + PersonCreated => "person.created", + PersonDeleted => "person.deleted", + PersonUpdated => "person.updated", + PlanCreated => "plan.created", + PlanDeleted => "plan.deleted", + PlanUpdated => "plan.updated", + PriceCreated => "price.created", + PriceDeleted => "price.deleted", + PriceUpdated => "price.updated", + ProductCreated => "product.created", + ProductDeleted => "product.deleted", + ProductUpdated => "product.updated", + PromotionCodeCreated => "promotion_code.created", + PromotionCodeUpdated => "promotion_code.updated", + QuoteAccepted => "quote.accepted", + QuoteCanceled => "quote.canceled", + QuoteCreated => "quote.created", + QuoteFinalized => "quote.finalized", + RadarEarlyFraudWarningCreated => "radar.early_fraud_warning.created", + RadarEarlyFraudWarningUpdated => "radar.early_fraud_warning.updated", + RefundCreated => "refund.created", + RefundUpdated => "refund.updated", + ReportingReportRunFailed => "reporting.report_run.failed", + ReportingReportRunSucceeded => "reporting.report_run.succeeded", + ReportingReportTypeUpdated => "reporting.report_type.updated", + ReviewClosed => "review.closed", + ReviewOpened => "review.opened", + SetupIntentCanceled => "setup_intent.canceled", + SetupIntentCreated => "setup_intent.created", + SetupIntentRequiresAction => "setup_intent.requires_action", + SetupIntentSetupFailed => "setup_intent.setup_failed", + SetupIntentSucceeded => "setup_intent.succeeded", + SigmaScheduledQueryRunCreated => "sigma.scheduled_query_run.created", + SourceCanceled => "source.canceled", + SourceChargeable => "source.chargeable", + SourceFailed => "source.failed", + SourceMandateNotification => "source.mandate_notification", + SourceRefundAttributesRequired => "source.refund_attributes_required", + SourceTransactionCreated => "source.transaction.created", + SourceTransactionUpdated => "source.transaction.updated", + SubscriptionScheduleAborted => "subscription_schedule.aborted", + SubscriptionScheduleCanceled => "subscription_schedule.canceled", + SubscriptionScheduleCompleted => "subscription_schedule.completed", + SubscriptionScheduleCreated => "subscription_schedule.created", + SubscriptionScheduleExpiring => "subscription_schedule.expiring", + SubscriptionScheduleReleased => "subscription_schedule.released", + SubscriptionScheduleUpdated => "subscription_schedule.updated", + TaxSettingsUpdated => "tax.settings.updated", + TaxRateCreated => "tax_rate.created", + TaxRateUpdated => "tax_rate.updated", + TerminalReaderActionFailed => "terminal.reader.action_failed", + TerminalReaderActionSucceeded => "terminal.reader.action_succeeded", + TestHelpersTestClockAdvancing => "test_helpers.test_clock.advancing", + TestHelpersTestClockCreated => "test_helpers.test_clock.created", + TestHelpersTestClockDeleted => "test_helpers.test_clock.deleted", + TestHelpersTestClockInternalFailure => "test_helpers.test_clock.internal_failure", + TestHelpersTestClockReady => "test_helpers.test_clock.ready", + TopupCanceled => "topup.canceled", + TopupCreated => "topup.created", + TopupFailed => "topup.failed", + TopupReversed => "topup.reversed", + TopupSucceeded => "topup.succeeded", + TransferCreated => "transfer.created", + TransferReversed => "transfer.reversed", + TransferUpdated => "transfer.updated", + TreasuryCreditReversalCreated => "treasury.credit_reversal.created", + TreasuryCreditReversalPosted => "treasury.credit_reversal.posted", + TreasuryDebitReversalCompleted => "treasury.debit_reversal.completed", + TreasuryDebitReversalCreated => "treasury.debit_reversal.created", + TreasuryDebitReversalInitialCreditGranted => { + "treasury.debit_reversal.initial_credit_granted" + } + TreasuryFinancialAccountClosed => "treasury.financial_account.closed", + TreasuryFinancialAccountCreated => "treasury.financial_account.created", + TreasuryFinancialAccountFeaturesStatusUpdated => { + "treasury.financial_account.features_status_updated" + } + TreasuryInboundTransferCanceled => "treasury.inbound_transfer.canceled", + TreasuryInboundTransferCreated => "treasury.inbound_transfer.created", + TreasuryInboundTransferFailed => "treasury.inbound_transfer.failed", + TreasuryInboundTransferSucceeded => "treasury.inbound_transfer.succeeded", + TreasuryOutboundPaymentCanceled => "treasury.outbound_payment.canceled", + TreasuryOutboundPaymentCreated => "treasury.outbound_payment.created", + TreasuryOutboundPaymentExpectedArrivalDateUpdated => { + "treasury.outbound_payment.expected_arrival_date_updated" + } + TreasuryOutboundPaymentFailed => "treasury.outbound_payment.failed", + TreasuryOutboundPaymentPosted => "treasury.outbound_payment.posted", + TreasuryOutboundPaymentReturned => "treasury.outbound_payment.returned", + TreasuryOutboundTransferCanceled => "treasury.outbound_transfer.canceled", + TreasuryOutboundTransferCreated => "treasury.outbound_transfer.created", + TreasuryOutboundTransferExpectedArrivalDateUpdated => { + "treasury.outbound_transfer.expected_arrival_date_updated" + } + TreasuryOutboundTransferFailed => "treasury.outbound_transfer.failed", + TreasuryOutboundTransferPosted => "treasury.outbound_transfer.posted", + TreasuryOutboundTransferReturned => "treasury.outbound_transfer.returned", + TreasuryReceivedCreditCreated => "treasury.received_credit.created", + TreasuryReceivedCreditFailed => "treasury.received_credit.failed", + TreasuryReceivedCreditSucceeded => "treasury.received_credit.succeeded", + TreasuryReceivedDebitCreated => "treasury.received_debit.created", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for NotificationEventType { + type Err = (); + fn from_str(s: &str) -> Result { + use NotificationEventType::*; + match s { + "account.application.authorized" => Ok(AccountApplicationAuthorized), + "account.application.deauthorized" => Ok(AccountApplicationDeauthorized), + "account.external_account.created" => Ok(AccountExternalAccountCreated), + "account.external_account.deleted" => Ok(AccountExternalAccountDeleted), + "account.external_account.updated" => Ok(AccountExternalAccountUpdated), + "account.updated" => Ok(AccountUpdated), + "application_fee.created" => Ok(ApplicationFeeCreated), + "application_fee.refund.updated" => Ok(ApplicationFeeRefundUpdated), + "application_fee.refunded" => Ok(ApplicationFeeRefunded), + "balance.available" => Ok(BalanceAvailable), + "billing_portal.configuration.created" => Ok(BillingPortalConfigurationCreated), + "billing_portal.configuration.updated" => Ok(BillingPortalConfigurationUpdated), + "billing_portal.session.created" => Ok(BillingPortalSessionCreated), + "capability.updated" => Ok(CapabilityUpdated), + "cash_balance.funds_available" => Ok(CashBalanceFundsAvailable), + "charge.captured" => Ok(ChargeCaptured), + "charge.dispute.closed" => Ok(ChargeDisputeClosed), + "charge.dispute.created" => Ok(ChargeDisputeCreated), + "charge.dispute.funds_reinstated" => Ok(ChargeDisputeFundsReinstated), + "charge.dispute.funds_withdrawn" => Ok(ChargeDisputeFundsWithdrawn), + "charge.dispute.updated" => Ok(ChargeDisputeUpdated), + "charge.expired" => Ok(ChargeExpired), + "charge.failed" => Ok(ChargeFailed), + "charge.pending" => Ok(ChargePending), + "charge.refund.updated" => Ok(ChargeRefundUpdated), + "charge.refunded" => Ok(ChargeRefunded), + "charge.succeeded" => Ok(ChargeSucceeded), + "charge.updated" => Ok(ChargeUpdated), + "checkout.session.async_payment_failed" => Ok(CheckoutSessionAsyncPaymentFailed), + "checkout.session.async_payment_succeeded" => Ok(CheckoutSessionAsyncPaymentSucceeded), + "checkout.session.completed" => Ok(CheckoutSessionCompleted), + "checkout.session.expired" => Ok(CheckoutSessionExpired), + "coupon.created" => Ok(CouponCreated), + "coupon.deleted" => Ok(CouponDeleted), + "coupon.updated" => Ok(CouponUpdated), + "credit_note.created" => Ok(CreditNoteCreated), + "credit_note.updated" => Ok(CreditNoteUpdated), + "credit_note.voided" => Ok(CreditNoteVoided), + "customer.created" => Ok(CustomerCreated), + "customer.deleted" => Ok(CustomerDeleted), + "customer.discount.created" => Ok(CustomerDiscountCreated), + "customer.discount.deleted" => Ok(CustomerDiscountDeleted), + "customer.discount.updated" => Ok(CustomerDiscountUpdated), + "customer.source.created" => Ok(CustomerSourceCreated), + "customer.source.deleted" => Ok(CustomerSourceDeleted), + "customer.source.expiring" => Ok(CustomerSourceExpiring), + "customer.source.updated" => Ok(CustomerSourceUpdated), + "customer.subscription.created" => Ok(CustomerSubscriptionCreated), + "customer.subscription.deleted" => Ok(CustomerSubscriptionDeleted), + "customer.subscription.paused" => Ok(CustomerSubscriptionPaused), + "customer.subscription.pending_update_applied" => { + Ok(CustomerSubscriptionPendingUpdateApplied) + } + "customer.subscription.pending_update_expired" => { + Ok(CustomerSubscriptionPendingUpdateExpired) + } + "customer.subscription.resumed" => Ok(CustomerSubscriptionResumed), + "customer.subscription.trial_will_end" => Ok(CustomerSubscriptionTrialWillEnd), + "customer.subscription.updated" => Ok(CustomerSubscriptionUpdated), + "customer.tax_id.created" => Ok(CustomerTaxIdCreated), + "customer.tax_id.deleted" => Ok(CustomerTaxIdDeleted), + "customer.tax_id.updated" => Ok(CustomerTaxIdUpdated), + "customer.updated" => Ok(CustomerUpdated), + "customer_cash_balance_transaction.created" => { + Ok(CustomerCashBalanceTransactionCreated) + } + "file.created" => Ok(FileCreated), + "financial_connections.account.created" => Ok(FinancialConnectionsAccountCreated), + "financial_connections.account.deactivated" => { + Ok(FinancialConnectionsAccountDeactivated) + } + "financial_connections.account.disconnected" => { + Ok(FinancialConnectionsAccountDisconnected) + } + "financial_connections.account.reactivated" => { + Ok(FinancialConnectionsAccountReactivated) + } + "financial_connections.account.refreshed_balance" => { + Ok(FinancialConnectionsAccountRefreshedBalance) + } + "identity.verification_session.canceled" => Ok(IdentityVerificationSessionCanceled), + "identity.verification_session.created" => Ok(IdentityVerificationSessionCreated), + "identity.verification_session.processing" => Ok(IdentityVerificationSessionProcessing), + "identity.verification_session.redacted" => Ok(IdentityVerificationSessionRedacted), + "identity.verification_session.requires_input" => { + Ok(IdentityVerificationSessionRequiresInput) + } + "identity.verification_session.verified" => Ok(IdentityVerificationSessionVerified), + "invoice.created" => Ok(InvoiceCreated), + "invoice.deleted" => Ok(InvoiceDeleted), + "invoice.finalization_failed" => Ok(InvoiceFinalizationFailed), + "invoice.finalized" => Ok(InvoiceFinalized), + "invoice.marked_uncollectible" => Ok(InvoiceMarkedUncollectible), + "invoice.paid" => Ok(InvoicePaid), + "invoice.payment_action_required" => Ok(InvoicePaymentActionRequired), + "invoice.payment_failed" => Ok(InvoicePaymentFailed), + "invoice.payment_succeeded" => Ok(InvoicePaymentSucceeded), + "invoice.sent" => Ok(InvoiceSent), + "invoice.upcoming" => Ok(InvoiceUpcoming), + "invoice.updated" => Ok(InvoiceUpdated), + "invoice.voided" => Ok(InvoiceVoided), + "invoiceitem.created" => Ok(InvoiceitemCreated), + "invoiceitem.deleted" => Ok(InvoiceitemDeleted), + "issuing_authorization.created" => Ok(IssuingAuthorizationCreated), + "issuing_authorization.request" => Ok(IssuingAuthorizationRequest), + "issuing_authorization.updated" => Ok(IssuingAuthorizationUpdated), + "issuing_card.created" => Ok(IssuingCardCreated), + "issuing_card.updated" => Ok(IssuingCardUpdated), + "issuing_cardholder.created" => Ok(IssuingCardholderCreated), + "issuing_cardholder.updated" => Ok(IssuingCardholderUpdated), + "issuing_dispute.closed" => Ok(IssuingDisputeClosed), + "issuing_dispute.created" => Ok(IssuingDisputeCreated), + "issuing_dispute.funds_reinstated" => Ok(IssuingDisputeFundsReinstated), + "issuing_dispute.submitted" => Ok(IssuingDisputeSubmitted), + "issuing_dispute.updated" => Ok(IssuingDisputeUpdated), + "issuing_token.created" => Ok(IssuingTokenCreated), + "issuing_token.updated" => Ok(IssuingTokenUpdated), + "issuing_transaction.created" => Ok(IssuingTransactionCreated), + "issuing_transaction.updated" => Ok(IssuingTransactionUpdated), + "mandate.updated" => Ok(MandateUpdated), + "payment_intent.amount_capturable_updated" => Ok(PaymentIntentAmountCapturableUpdated), + "payment_intent.canceled" => Ok(PaymentIntentCanceled), + "payment_intent.created" => Ok(PaymentIntentCreated), + "payment_intent.partially_funded" => Ok(PaymentIntentPartiallyFunded), + "payment_intent.payment_failed" => Ok(PaymentIntentPaymentFailed), + "payment_intent.processing" => Ok(PaymentIntentProcessing), + "payment_intent.requires_action" => Ok(PaymentIntentRequiresAction), + "payment_intent.succeeded" => Ok(PaymentIntentSucceeded), + "payment_link.created" => Ok(PaymentLinkCreated), + "payment_link.updated" => Ok(PaymentLinkUpdated), + "payment_method.attached" => Ok(PaymentMethodAttached), + "payment_method.automatically_updated" => Ok(PaymentMethodAutomaticallyUpdated), + "payment_method.detached" => Ok(PaymentMethodDetached), + "payment_method.updated" => Ok(PaymentMethodUpdated), + "payout.canceled" => Ok(PayoutCanceled), + "payout.created" => Ok(PayoutCreated), + "payout.failed" => Ok(PayoutFailed), + "payout.paid" => Ok(PayoutPaid), + "payout.reconciliation_completed" => Ok(PayoutReconciliationCompleted), + "payout.updated" => Ok(PayoutUpdated), + "person.created" => Ok(PersonCreated), + "person.deleted" => Ok(PersonDeleted), + "person.updated" => Ok(PersonUpdated), + "plan.created" => Ok(PlanCreated), + "plan.deleted" => Ok(PlanDeleted), + "plan.updated" => Ok(PlanUpdated), + "price.created" => Ok(PriceCreated), + "price.deleted" => Ok(PriceDeleted), + "price.updated" => Ok(PriceUpdated), + "product.created" => Ok(ProductCreated), + "product.deleted" => Ok(ProductDeleted), + "product.updated" => Ok(ProductUpdated), + "promotion_code.created" => Ok(PromotionCodeCreated), + "promotion_code.updated" => Ok(PromotionCodeUpdated), + "quote.accepted" => Ok(QuoteAccepted), + "quote.canceled" => Ok(QuoteCanceled), + "quote.created" => Ok(QuoteCreated), + "quote.finalized" => Ok(QuoteFinalized), + "radar.early_fraud_warning.created" => Ok(RadarEarlyFraudWarningCreated), + "radar.early_fraud_warning.updated" => Ok(RadarEarlyFraudWarningUpdated), + "refund.created" => Ok(RefundCreated), + "refund.updated" => Ok(RefundUpdated), + "reporting.report_run.failed" => Ok(ReportingReportRunFailed), + "reporting.report_run.succeeded" => Ok(ReportingReportRunSucceeded), + "reporting.report_type.updated" => Ok(ReportingReportTypeUpdated), + "review.closed" => Ok(ReviewClosed), + "review.opened" => Ok(ReviewOpened), + "setup_intent.canceled" => Ok(SetupIntentCanceled), + "setup_intent.created" => Ok(SetupIntentCreated), + "setup_intent.requires_action" => Ok(SetupIntentRequiresAction), + "setup_intent.setup_failed" => Ok(SetupIntentSetupFailed), + "setup_intent.succeeded" => Ok(SetupIntentSucceeded), + "sigma.scheduled_query_run.created" => Ok(SigmaScheduledQueryRunCreated), + "source.canceled" => Ok(SourceCanceled), + "source.chargeable" => Ok(SourceChargeable), + "source.failed" => Ok(SourceFailed), + "source.mandate_notification" => Ok(SourceMandateNotification), + "source.refund_attributes_required" => Ok(SourceRefundAttributesRequired), + "source.transaction.created" => Ok(SourceTransactionCreated), + "source.transaction.updated" => Ok(SourceTransactionUpdated), + "subscription_schedule.aborted" => Ok(SubscriptionScheduleAborted), + "subscription_schedule.canceled" => Ok(SubscriptionScheduleCanceled), + "subscription_schedule.completed" => Ok(SubscriptionScheduleCompleted), + "subscription_schedule.created" => Ok(SubscriptionScheduleCreated), + "subscription_schedule.expiring" => Ok(SubscriptionScheduleExpiring), + "subscription_schedule.released" => Ok(SubscriptionScheduleReleased), + "subscription_schedule.updated" => Ok(SubscriptionScheduleUpdated), + "tax.settings.updated" => Ok(TaxSettingsUpdated), + "tax_rate.created" => Ok(TaxRateCreated), + "tax_rate.updated" => Ok(TaxRateUpdated), + "terminal.reader.action_failed" => Ok(TerminalReaderActionFailed), + "terminal.reader.action_succeeded" => Ok(TerminalReaderActionSucceeded), + "test_helpers.test_clock.advancing" => Ok(TestHelpersTestClockAdvancing), + "test_helpers.test_clock.created" => Ok(TestHelpersTestClockCreated), + "test_helpers.test_clock.deleted" => Ok(TestHelpersTestClockDeleted), + "test_helpers.test_clock.internal_failure" => Ok(TestHelpersTestClockInternalFailure), + "test_helpers.test_clock.ready" => Ok(TestHelpersTestClockReady), + "topup.canceled" => Ok(TopupCanceled), + "topup.created" => Ok(TopupCreated), + "topup.failed" => Ok(TopupFailed), + "topup.reversed" => Ok(TopupReversed), + "topup.succeeded" => Ok(TopupSucceeded), + "transfer.created" => Ok(TransferCreated), + "transfer.reversed" => Ok(TransferReversed), + "transfer.updated" => Ok(TransferUpdated), + "treasury.credit_reversal.created" => Ok(TreasuryCreditReversalCreated), + "treasury.credit_reversal.posted" => Ok(TreasuryCreditReversalPosted), + "treasury.debit_reversal.completed" => Ok(TreasuryDebitReversalCompleted), + "treasury.debit_reversal.created" => Ok(TreasuryDebitReversalCreated), + "treasury.debit_reversal.initial_credit_granted" => { + Ok(TreasuryDebitReversalInitialCreditGranted) + } + "treasury.financial_account.closed" => Ok(TreasuryFinancialAccountClosed), + "treasury.financial_account.created" => Ok(TreasuryFinancialAccountCreated), + "treasury.financial_account.features_status_updated" => { + Ok(TreasuryFinancialAccountFeaturesStatusUpdated) + } + "treasury.inbound_transfer.canceled" => Ok(TreasuryInboundTransferCanceled), + "treasury.inbound_transfer.created" => Ok(TreasuryInboundTransferCreated), + "treasury.inbound_transfer.failed" => Ok(TreasuryInboundTransferFailed), + "treasury.inbound_transfer.succeeded" => Ok(TreasuryInboundTransferSucceeded), + "treasury.outbound_payment.canceled" => Ok(TreasuryOutboundPaymentCanceled), + "treasury.outbound_payment.created" => Ok(TreasuryOutboundPaymentCreated), + "treasury.outbound_payment.expected_arrival_date_updated" => { + Ok(TreasuryOutboundPaymentExpectedArrivalDateUpdated) + } + "treasury.outbound_payment.failed" => Ok(TreasuryOutboundPaymentFailed), + "treasury.outbound_payment.posted" => Ok(TreasuryOutboundPaymentPosted), + "treasury.outbound_payment.returned" => Ok(TreasuryOutboundPaymentReturned), + "treasury.outbound_transfer.canceled" => Ok(TreasuryOutboundTransferCanceled), + "treasury.outbound_transfer.created" => Ok(TreasuryOutboundTransferCreated), + "treasury.outbound_transfer.expected_arrival_date_updated" => { + Ok(TreasuryOutboundTransferExpectedArrivalDateUpdated) + } + "treasury.outbound_transfer.failed" => Ok(TreasuryOutboundTransferFailed), + "treasury.outbound_transfer.posted" => Ok(TreasuryOutboundTransferPosted), + "treasury.outbound_transfer.returned" => Ok(TreasuryOutboundTransferReturned), + "treasury.received_credit.created" => Ok(TreasuryReceivedCreditCreated), + "treasury.received_credit.failed" => Ok(TreasuryReceivedCreditFailed), + "treasury.received_credit.succeeded" => Ok(TreasuryReceivedCreditSucceeded), + "treasury.received_debit.created" => Ok(TreasuryReceivedDebitCreated), + _ => Err(()), + } + } +} +impl AsRef for NotificationEventType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for NotificationEventType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for NotificationEventType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for NotificationEventType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for NotificationEventType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(NotificationEventType::Unknown)) + } +} +impl stripe_types::Object for NotificationEvent { + type Id = stripe_types::notification_event::EventId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(EventId, "evt_"); diff --git a/stripe_types/src/generated/notification_event_data/mod.rs b/stripe_types/src/generated/notification_event_data/mod.rs new file mode 100644 index 000000000..e37f34f08 --- /dev/null +++ b/stripe_types/src/generated/notification_event_data/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct NotificationEventData { + /// Object containing the API resource relevant to the event. + /// + /// For example, an `invoice.created` event will have a full [invoice object](https://stripe.com/docs/api#invoice_object) as the value of the object key. + pub object: serde_json::Value, + /// Object containing the names of the updated attributes and their values prior to the event (only included in events of type `*.updated`). + /// + /// If an array attribute has any updated elements, this object contains the entire array. + /// In Stripe API versions 2017-04-06 or earlier, an updated array attribute in this object includes only the updated array elements. + #[serde(skip_serializing_if = "Option::is_none")] + pub previous_attributes: Option, +} diff --git a/stripe_types/src/generated/notification_event_request/mod.rs b/stripe_types/src/generated/notification_event_request/mod.rs new file mode 100644 index 000000000..8bc9e40ff --- /dev/null +++ b/stripe_types/src/generated/notification_event_request/mod.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct NotificationEventRequest { + /// ID of the API request that caused the event. + /// + /// If null, the event was automatic (e.g., Stripe's automatic subscription handling). + /// Request logs are available in the [dashboard](https://dashboard.stripe.com/logs), but currently not in the API. + pub id: Option, + /// The idempotency key transmitted during the request, if any. + /// + /// *Note: This property is populated only for events on or after May 23, 2017*. + pub idempotency_key: Option, +} diff --git a/stripe_types/src/generated/offline_acceptance/mod.rs b/stripe_types/src/generated/offline_acceptance/mod.rs new file mode 100644 index 000000000..b83820747 --- /dev/null +++ b/stripe_types/src/generated/offline_acceptance/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct OfflineAcceptance {} diff --git a/stripe_types/src/generated/online_acceptance/mod.rs b/stripe_types/src/generated/online_acceptance/mod.rs new file mode 100644 index 000000000..e8a780018 --- /dev/null +++ b/stripe_types/src/generated/online_acceptance/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct OnlineAcceptance { + /// The customer accepts the mandate from this IP address. + pub ip_address: Option, + /// The customer accepts the mandate using the user agent of the browser. + pub user_agent: Option, +} diff --git a/stripe_types/src/generated/package_dimensions/mod.rs b/stripe_types/src/generated/package_dimensions/mod.rs new file mode 100644 index 000000000..384074024 --- /dev/null +++ b/stripe_types/src/generated/package_dimensions/mod.rs @@ -0,0 +1,11 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PackageDimensions { + /// Height, in inches. + pub height: f64, + /// Length, in inches. + pub length: f64, + /// Weight, in ounces. + pub weight: f64, + /// Width, in inches. + pub width: f64, +} diff --git a/stripe_types/src/generated/payment_flows_amount_details/mod.rs b/stripe_types/src/generated/payment_flows_amount_details/mod.rs new file mode 100644 index 000000000..6cd1387d2 --- /dev/null +++ b/stripe_types/src/generated/payment_flows_amount_details/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsAmountDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub tip: Option, +} diff --git a/stripe_types/src/generated/payment_flows_amount_details_resource_tip/mod.rs b/stripe_types/src/generated/payment_flows_amount_details_resource_tip/mod.rs new file mode 100644 index 000000000..9bb050a35 --- /dev/null +++ b/stripe_types/src/generated/payment_flows_amount_details_resource_tip/mod.rs @@ -0,0 +1,6 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsAmountDetailsResourceTip { + /// Portion of the amount that corresponds to a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, +} diff --git a/stripe_types/src/generated/payment_flows_automatic_payment_methods_payment_intent/mod.rs b/stripe_types/src/generated/payment_flows_automatic_payment_methods_payment_intent/mod.rs new file mode 100644 index 000000000..fc70e1e57 --- /dev/null +++ b/stripe_types/src/generated/payment_flows_automatic_payment_methods_payment_intent/mod.rs @@ -0,0 +1,80 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsAutomaticPaymentMethodsPaymentIntent { + /// Controls whether this PaymentIntent will accept redirect-based payment methods. + /// + /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. + /// + /// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redirects: Option, + /// Automatically calculates compatible payment methods. + pub enabled: bool, +} +/// Controls whether this PaymentIntent will accept redirect-based payment methods. +/// +/// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. +/// +/// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + Always, + Never, +} +impl PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + pub fn as_str(self) -> &'static str { + use PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects::*; + match self { + Always => "always", + Never => "never", + } + } +} + +impl std::str::FromStr for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects::*; + match s { + "always" => Ok(Always), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_flows_automatic_payment_methods_setup_intent/mod.rs b/stripe_types/src/generated/payment_flows_automatic_payment_methods_setup_intent/mod.rs new file mode 100644 index 000000000..cb2a8f4db --- /dev/null +++ b/stripe_types/src/generated/payment_flows_automatic_payment_methods_setup_intent/mod.rs @@ -0,0 +1,78 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsAutomaticPaymentMethodsSetupIntent { + /// Controls whether this SetupIntent will accept redirect-based payment methods. + /// + /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. + /// + /// To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redirects: Option, + /// Automatically calculates compatible payment methods. + pub enabled: Option, +} +/// Controls whether this SetupIntent will accept redirect-based payment methods. +/// +/// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. +/// +/// To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + Always, + Never, +} +impl PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + pub fn as_str(self) -> &'static str { + use PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects::*; + match self { + Always => "always", + Never => "never", + } + } +} + +impl std::str::FromStr for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects::*; + match s { + "always" => Ok(Always), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_flows_private_payment_methods_alipay/mod.rs b/stripe_types/src/generated/payment_flows_private_payment_methods_alipay/mod.rs new file mode 100644 index 000000000..2262cd443 --- /dev/null +++ b/stripe_types/src/generated/payment_flows_private_payment_methods_alipay/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsPrivatePaymentMethodsAlipay {} diff --git a/stripe_types/src/generated/payment_flows_private_payment_methods_alipay_details/mod.rs b/stripe_types/src/generated/payment_flows_private_payment_methods_alipay_details/mod.rs new file mode 100644 index 000000000..3e2c81553 --- /dev/null +++ b/stripe_types/src/generated/payment_flows_private_payment_methods_alipay_details/mod.rs @@ -0,0 +1,14 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsPrivatePaymentMethodsAlipayDetails { + /// Uniquely identifies this particular Alipay account. + /// + /// You can use this attribute to check whether two Alipay accounts are the same. + #[serde(skip_serializing_if = "Option::is_none")] + pub buyer_id: Option, + /// Uniquely identifies this particular Alipay account. + /// + /// You can use this attribute to check whether two Alipay accounts are the same. + pub fingerprint: Option, + /// Transaction ID of this particular Alipay transaction. + pub transaction_id: Option, +} diff --git a/stripe_types/src/generated/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization/mod.rs b/stripe_types/src/generated/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization/mod.rs new file mode 100644 index 000000000..a8734dde0 --- /dev/null +++ b/stripe_types/src/generated/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization/mod.rs @@ -0,0 +1,64 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorization { + /// Indicates whether or not the capture window is extended beyond the standard authorization. +pub status: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus, + +} +/// Indicates whether or not the capture window is extended beyond the standard authorization. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus +{ + Disabled, + Enabled, +} +impl PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus { + pub fn as_str(self) -> &'static str { + use PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus::*; + match self { +Disabled => "disabled", +Enabled => "enabled", + + } + } +} + +impl std::str::FromStr for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus::*; + match s { + "disabled" => Ok(Disabled), +"enabled" => Ok(Enabled), +_ => Err(()) + + } + } +} +impl AsRef for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus")) + } +} diff --git a/stripe_types/src/generated/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization/mod.rs b/stripe_types/src/generated/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization/mod.rs new file mode 100644 index 000000000..5c3b8111b --- /dev/null +++ b/stripe_types/src/generated/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization/mod.rs @@ -0,0 +1,64 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorization { + /// Indicates whether or not the incremental authorization feature is supported. +pub status: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus, + +} +/// Indicates whether or not the incremental authorization feature is supported. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus +{ + Available, + Unavailable, +} +impl PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus { + pub fn as_str(self) -> &'static str { + use PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus::*; + match self { +Available => "available", +Unavailable => "unavailable", + + } + } +} + +impl std::str::FromStr for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus::*; + match s { + "available" => Ok(Available), +"unavailable" => Ok(Unavailable), +_ => Err(()) + + } + } +} +impl AsRef for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus")) + } +} diff --git a/stripe_types/src/generated/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture/mod.rs b/stripe_types/src/generated/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture/mod.rs new file mode 100644 index 000000000..64461bfee --- /dev/null +++ b/stripe_types/src/generated/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture/mod.rs @@ -0,0 +1,66 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercapture { + /// The maximum amount that can be captured. +pub maximum_amount_capturable: i64, + /// Indicates whether or not the authorized amount can be over-captured. +pub status: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus, + +} +/// Indicates whether or not the authorized amount can be over-captured. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus +{ + Available, + Unavailable, +} +impl PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus { + pub fn as_str(self) -> &'static str { + use PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus::*; + match self { +Available => "available", +Unavailable => "unavailable", + + } + } +} + +impl std::str::FromStr for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus::*; + match s { + "available" => Ok(Available), +"unavailable" => Ok(Unavailable), +_ => Err(()) + + } + } +} +impl AsRef for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus")) + } +} diff --git a/stripe_types/src/generated/payment_flows_private_payment_methods_card_details_api_resource_multicapture/mod.rs b/stripe_types/src/generated/payment_flows_private_payment_methods_card_details_api_resource_multicapture/mod.rs new file mode 100644 index 000000000..05617b3c8 --- /dev/null +++ b/stripe_types/src/generated/payment_flows_private_payment_methods_card_details_api_resource_multicapture/mod.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticapture { + /// Indicates whether or not multiple captures are supported. + pub status: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus, +} +/// Indicates whether or not multiple captures are supported. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus { + Available, + Unavailable, +} +impl PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus { + pub fn as_str(self) -> &'static str { + use PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus::*; + match self { + Available => "available", + Unavailable => "unavailable", + } + } +} + +impl std::str::FromStr + for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus +{ + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus::*; + match s { + "available" => Ok(Available), + "unavailable" => Ok(Unavailable), + _ => Err(()), + } + } +} +impl AsRef for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display + for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus")) + } +} diff --git a/stripe_types/src/generated/payment_flows_private_payment_methods_klarna_dob/mod.rs b/stripe_types/src/generated/payment_flows_private_payment_methods_klarna_dob/mod.rs new file mode 100644 index 000000000..fe0a52dbf --- /dev/null +++ b/stripe_types/src/generated/payment_flows_private_payment_methods_klarna_dob/mod.rs @@ -0,0 +1,9 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsPrivatePaymentMethodsKlarnaDob { + /// The day of birth, between 1 and 31. + pub day: Option, + /// The month of birth, between 1 and 12. + pub month: Option, + /// The four-digit year of birth. + pub year: Option, +} diff --git a/stripe_types/src/generated/payment_flows_setup_intent_setup_attempt/mod.rs b/stripe_types/src/generated/payment_flows_setup_intent_setup_attempt/mod.rs new file mode 100644 index 000000000..86af9b8d0 --- /dev/null +++ b/stripe_types/src/generated/payment_flows_setup_intent_setup_attempt/mod.rs @@ -0,0 +1,120 @@ +/// A SetupAttempt describes one attempted confirmation of a SetupIntent, +/// whether that confirmation is successful or unsuccessful. +/// +/// You can use SetupAttempts to inspect details of a specific attempt at setting up a payment method using a SetupIntent. For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsSetupIntentSetupAttempt { + /// The value of [application](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-application) on the SetupIntent at the time of this confirmation. + pub application: Option>, + /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + /// + /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. + /// + /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub attach_to_self: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The value of [customer](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-customer) on the SetupIntent at the time of this confirmation. + pub customer: Option>, + /// Indicates the directions of money movement for which this payment method is intended to be used. + /// + /// Include `inbound` if you intend to use the payment method as the origin to pull funds from. + /// + /// Include `outbound` if you intend to use the payment method as the destination to send funds to. + /// You can include both if you intend to use the payment method for both purposes. + pub flow_directions: Option>, + /// Unique identifier for the object. + pub id: stripe_types::payment_flows_setup_intent_setup_attempt::SetupAttemptId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The value of [on_behalf_of](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-on_behalf_of) on the SetupIntent at the time of this confirmation. + pub on_behalf_of: Option>, + /// ID of the payment method used with this SetupAttempt. + pub payment_method: stripe_types::Expandable, + pub payment_method_details: stripe_types::SetupAttemptPaymentMethodDetails, + /// The error encountered during this attempt to confirm the SetupIntent, if any. + pub setup_error: Option>, + /// ID of the SetupIntent that this attempt belongs to. + pub setup_intent: stripe_types::Expandable, + /// Status of this SetupAttempt, one of `requires_confirmation`, `requires_action`, `processing`, `succeeded`, `failed`, or `abandoned`. + pub status: String, + /// The value of [usage](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-usage) on the SetupIntent at the time of this confirmation, one of `off_session` or `on_session`. + pub usage: String, +} +/// Indicates the directions of money movement for which this payment method is intended to be used. +/// +/// Include `inbound` if you intend to use the payment method as the origin to pull funds from. +/// +/// Include `outbound` if you intend to use the payment method as the destination to send funds to. +/// You can include both if you intend to use the payment method for both purposes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentFlowsSetupIntentSetupAttemptFlowDirections { + Inbound, + Outbound, +} +impl PaymentFlowsSetupIntentSetupAttemptFlowDirections { + pub fn as_str(self) -> &'static str { + use PaymentFlowsSetupIntentSetupAttemptFlowDirections::*; + match self { + Inbound => "inbound", + Outbound => "outbound", + } + } +} + +impl std::str::FromStr for PaymentFlowsSetupIntentSetupAttemptFlowDirections { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentFlowsSetupIntentSetupAttemptFlowDirections::*; + match s { + "inbound" => Ok(Inbound), + "outbound" => Ok(Outbound), + _ => Err(()), + } + } +} +impl AsRef for PaymentFlowsSetupIntentSetupAttemptFlowDirections { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentFlowsSetupIntentSetupAttemptFlowDirections { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentFlowsSetupIntentSetupAttemptFlowDirections { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentFlowsSetupIntentSetupAttemptFlowDirections { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentFlowsSetupIntentSetupAttemptFlowDirections { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentFlowsSetupIntentSetupAttemptFlowDirections", + ) + }) + } +} +impl stripe_types::Object for PaymentFlowsSetupIntentSetupAttempt { + type Id = stripe_types::payment_flows_setup_intent_setup_attempt::SetupAttemptId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(SetupAttemptId, "setatt_"); diff --git a/stripe_types/src/generated/payment_intent/mod.rs b/stripe_types/src/generated/payment_intent/mod.rs new file mode 100644 index 000000000..496c70a49 --- /dev/null +++ b/stripe_types/src/generated/payment_intent/mod.rs @@ -0,0 +1,482 @@ +/// A PaymentIntent guides you through the process of collecting a payment from your customer. +/// We recommend that you create exactly one PaymentIntent for each order or +/// customer session in your system. +/// +/// You can reference the PaymentIntent later to see the history of payment attempts for a particular session. A PaymentIntent transitions through [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) throughout its lifetime as it interfaces with Stripe.js to perform authentication flows and ultimately creates at most one successful charge. Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntent { + /// Amount intended to be collected by this PaymentIntent. + /// + /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + pub amount: i64, + /// Amount that can be captured from this PaymentIntent. + pub amount_capturable: i64, + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_details: Option, + /// Amount that this PaymentIntent collects. + pub amount_received: i64, + /// ID of the Connect application that created the PaymentIntent. + pub application: Option>, + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// + /// The amount of the application fee collected will be capped at the total payment amount. + /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + pub application_fee_amount: Option, + /// Settings to configure compatible payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + pub automatic_payment_methods: + Option, + /// Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. + /// + /// Measured in seconds since the Unix epoch. + pub canceled_at: Option, + /// Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`). + pub cancellation_reason: Option, + /// Controls when the funds will be captured from the customer's account. + pub capture_method: PaymentIntentCaptureMethod, + /// The client secret of this PaymentIntent. + /// + /// Used for client-side retrieval using a publishable key. + /// The client secret can be used to complete a payment from your frontend. + /// It should not be stored, logged, or exposed to anyone other than the customer. + /// Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs to [accept a payment](https://stripe.com/docs/payments/accept-a-payment?ui=elements) and learn about how `client_secret` should be handled. + pub client_secret: Option, + pub confirmation_method: PaymentIntentConfirmationMethod, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the Customer this PaymentIntent belongs to, if one exists. + /// + /// Payment methods attached to other Customers cannot be used with this PaymentIntent. + /// + /// If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. + pub customer: Option>, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// Unique identifier for the object. + pub id: stripe_types::payment_intent::PaymentIntentId, + /// ID of the invoice that created this PaymentIntent, if it exists. + pub invoice: Option>, + /// The payment error encountered in the previous PaymentIntent confirmation. + /// + /// It will be cleared if the PaymentIntent is later updated for any reason. + pub last_payment_error: Option>, + /// The latest charge created by this PaymentIntent. + pub latest_charge: Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + /// Learn more about [storing information in metadata](https://stripe.com/docs/payments/payment-intents/creating-payment-intents#storing-information-in-metadata). + pub metadata: std::collections::HashMap, + /// If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. + pub next_action: Option, + /// The account (if any) for which the funds of the PaymentIntent are intended. + /// + /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. + pub on_behalf_of: Option>, + /// ID of the payment method used in this PaymentIntent. + pub payment_method: Option>, + /// Information about the payment method configuration used for this PaymentIntent. + pub payment_method_configuration_details: + Option, + /// Payment-method-specific configuration for this PaymentIntent. + pub payment_method_options: Option, + /// The list of payment method types (e.g. + /// + /// card) that this PaymentIntent is allowed to use. + pub payment_method_types: Vec, + /// If present, this property tells you about the processing state of the payment. + pub processing: Option, + /// Email address that the receipt for the resulting payment will be sent to. + /// + /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + pub receipt_email: Option, + /// ID of the review associated with this PaymentIntent, if any. + pub review: Option>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + pub setup_future_usage: Option, + /// Shipping information for this PaymentIntent. + pub shipping: Option, + /// This is a legacy field that will be removed in the future. + /// + /// It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. + pub source: Option>, + /// For non-card charges, you can use this value as the complete description that appears on your customers’ statements. + /// + /// Must contain at least one letter, maximum 22 characters. + pub statement_descriptor: Option, + /// Provides information about a card payment that customers see on their statements. + /// + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters for the concatenated descriptor. + pub statement_descriptor_suffix: Option, + /// Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. + /// + /// Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses). + pub status: PaymentIntentStatus, + /// The data that automatically creates a Transfer after the payment finalizes. + /// + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + pub transfer_data: Option, + /// A string that identifies the resulting payment as part of a group. + /// + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). + pub transfer_group: Option, +} +/// Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentCancellationReason { + Abandoned, + Automatic, + Duplicate, + FailedInvoice, + Fraudulent, + RequestedByCustomer, + VoidInvoice, +} +impl PaymentIntentCancellationReason { + pub fn as_str(self) -> &'static str { + use PaymentIntentCancellationReason::*; + match self { + Abandoned => "abandoned", + Automatic => "automatic", + Duplicate => "duplicate", + FailedInvoice => "failed_invoice", + Fraudulent => "fraudulent", + RequestedByCustomer => "requested_by_customer", + VoidInvoice => "void_invoice", + } + } +} + +impl std::str::FromStr for PaymentIntentCancellationReason { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentCancellationReason::*; + match s { + "abandoned" => Ok(Abandoned), + "automatic" => Ok(Automatic), + "duplicate" => Ok(Duplicate), + "failed_invoice" => Ok(FailedInvoice), + "fraudulent" => Ok(Fraudulent), + "requested_by_customer" => Ok(RequestedByCustomer), + "void_invoice" => Ok(VoidInvoice), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentCancellationReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentCancellationReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentCancellationReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentIntentCancellationReason") + }) + } +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentCaptureMethod { + Automatic, + AutomaticAsync, + Manual, +} +impl PaymentIntentCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentIntentCaptureMethod::*; + match self { + Automatic => "automatic", + AutomaticAsync => "automatic_async", + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentIntentCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentCaptureMethod::*; + match s { + "automatic" => Ok(Automatic), + "automatic_async" => Ok(AutomaticAsync), + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentCaptureMethod")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentConfirmationMethod { + Automatic, + Manual, +} +impl PaymentIntentConfirmationMethod { + pub fn as_str(self) -> &'static str { + use PaymentIntentConfirmationMethod::*; + match self { + Automatic => "automatic", + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentIntentConfirmationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentConfirmationMethod::*; + match s { + "automatic" => Ok(Automatic), + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentConfirmationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentConfirmationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentConfirmationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentConfirmationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentConfirmationMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentIntentConfirmationMethod") + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentSetupFutureUsage { + OffSession, + OnSession, +} +impl PaymentIntentSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentSetupFutureUsage::*; + match self { + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentIntentSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentSetupFutureUsage::*; + match s { + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentIntentSetupFutureUsage") + }) + } +} +/// Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. +/// +/// Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentStatus { + Canceled, + Processing, + RequiresAction, + RequiresCapture, + RequiresConfirmation, + RequiresPaymentMethod, + Succeeded, +} +impl PaymentIntentStatus { + pub fn as_str(self) -> &'static str { + use PaymentIntentStatus::*; + match self { + Canceled => "canceled", + Processing => "processing", + RequiresAction => "requires_action", + RequiresCapture => "requires_capture", + RequiresConfirmation => "requires_confirmation", + RequiresPaymentMethod => "requires_payment_method", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for PaymentIntentStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentStatus::*; + match s { + "canceled" => Ok(Canceled), + "processing" => Ok(Processing), + "requires_action" => Ok(RequiresAction), + "requires_capture" => Ok(RequiresCapture), + "requires_confirmation" => Ok(RequiresConfirmation), + "requires_payment_method" => Ok(RequiresPaymentMethod), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentStatus")) + } +} +impl stripe_types::Object for PaymentIntent { + type Id = stripe_types::payment_intent::PaymentIntentId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(PaymentIntentId, "pi_"); diff --git a/stripe_types/src/generated/payment_intent_card_processing/mod.rs b/stripe_types/src/generated/payment_intent_card_processing/mod.rs new file mode 100644 index 000000000..591c9774a --- /dev/null +++ b/stripe_types/src/generated/payment_intent_card_processing/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentCardProcessing { + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_notification: Option, +} diff --git a/stripe_types/src/generated/payment_intent_next_action/mod.rs b/stripe_types/src/generated/payment_intent_next_action/mod.rs new file mode 100644 index 000000000..864dd6303 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action/mod.rs @@ -0,0 +1,48 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextAction { + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay_handle_redirect: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto_display_details: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card_await_notification: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp_handle_redirect_or_display_qr_code: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub display_bank_transfer_instructions: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini_display_details: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo_display_details: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow_display_qr_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pix_display_qr_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay_display_qr_code: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect_to_url: Option, + /// Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. + #[serde(rename = "type")] + pub type_: String, + /// When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. + /// + /// The shape of the contents is subject to change and is only intended to be used by Stripe.js. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_stripe_sdk: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub verify_with_microdeposits: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay_display_qr_code: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay_redirect_to_android_app: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay_redirect_to_ios_app: + Option, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_alipay_handle_redirect/mod.rs b/stripe_types/src/generated/payment_intent_next_action_alipay_handle_redirect/mod.rs new file mode 100644 index 000000000..220cc2b67 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_alipay_handle_redirect/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionAlipayHandleRedirect { + /// The native data to be used with Alipay SDK you must redirect your customer to in order to authenticate the payment in an Android App. + pub native_data: Option, + /// The native URL you must redirect your customer to in order to authenticate the payment in an iOS App. + pub native_url: Option, + /// If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. + pub return_url: Option, + /// The URL you must redirect your customer to in order to authenticate the payment. + pub url: Option, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_boleto/mod.rs b/stripe_types/src/generated/payment_intent_next_action_boleto/mod.rs new file mode 100644 index 000000000..ef085d4d4 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_boleto/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionBoleto { + /// The timestamp after which the boleto expires. + pub expires_at: Option, + /// The URL to the hosted boleto voucher page, which allows customers to view the boleto voucher. + pub hosted_voucher_url: Option, + /// The boleto number. + pub number: Option, + /// The URL to the downloadable boleto voucher PDF. + pub pdf: Option, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_card_await_notification/mod.rs b/stripe_types/src/generated/payment_intent_next_action_card_await_notification/mod.rs new file mode 100644 index 000000000..13b89c1f9 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_card_await_notification/mod.rs @@ -0,0 +1,11 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionCardAwaitNotification { + /// The time that payment will be attempted. + /// + /// If customer approval is required, they need to provide approval before this time. + pub charge_attempt_at: Option, + /// For payments greater than INR 15000, the customer must provide explicit approval of the payment with their bank. + /// + /// For payments of lower amount, no customer action is required. + pub customer_approval_required: Option, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code/mod.rs b/stripe_types/src/generated/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code/mod.rs new file mode 100644 index 000000000..86963e0a1 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code/mod.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionCashappHandleRedirectOrDisplayQrCode { + /// The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR code, and supports QR code refreshing on expiration. + pub hosted_instructions_url: String, + /// The url for mobile redirect based auth. + pub mobile_auth_url: String, + pub qr_code: stripe_types::PaymentIntentNextActionCashappQrCode, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_cashapp_qr_code/mod.rs b/stripe_types/src/generated/payment_intent_next_action_cashapp_qr_code/mod.rs new file mode 100644 index 000000000..5d1fabe2c --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_cashapp_qr_code/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionCashappQrCode { + /// The date (unix timestamp) when the QR code expires. + pub expires_at: stripe_types::Timestamp, + /// The image_url_png string used to render QR code. + pub image_url_png: String, + /// The image_url_svg string used to render QR code. + pub image_url_svg: String, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_display_bank_transfer_instructions/mod.rs b/stripe_types/src/generated/payment_intent_next_action_display_bank_transfer_instructions/mod.rs new file mode 100644 index 000000000..5b0e0928d --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_display_bank_transfer_instructions/mod.rs @@ -0,0 +1,93 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionDisplayBankTransferInstructions { + /// The remaining amount that needs to be transferred to complete the payment. + pub amount_remaining: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: Option, + /// A list of financial addresses that can be used to fund the customer balance. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_addresses: + Option>, + /// A link to a hosted page that guides your customer through completing the transfer. + pub hosted_instructions_url: Option, + /// A string identifying this payment. + /// + /// Instruct your customer to include this code in the reference or memo field of their bank transfer. + pub reference: Option, + /// Type of bank transfer. + #[serde(rename = "type")] + pub type_: PaymentIntentNextActionDisplayBankTransferInstructionsType, +} +/// Type of bank transfer. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentNextActionDisplayBankTransferInstructionsType { + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl PaymentIntentNextActionDisplayBankTransferInstructionsType { + pub fn as_str(self) -> &'static str { + use PaymentIntentNextActionDisplayBankTransferInstructionsType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr for PaymentIntentNextActionDisplayBankTransferInstructionsType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentNextActionDisplayBankTransferInstructionsType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "gb_bank_transfer" => Ok(GbBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + "mx_bank_transfer" => Ok(MxBankTransfer), + "us_bank_transfer" => Ok(UsBankTransfer), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentNextActionDisplayBankTransferInstructionsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentNextActionDisplayBankTransferInstructionsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentNextActionDisplayBankTransferInstructionsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentNextActionDisplayBankTransferInstructionsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentNextActionDisplayBankTransferInstructionsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentNextActionDisplayBankTransferInstructionsType", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_intent_next_action_display_oxxo_details/mod.rs b/stripe_types/src/generated/payment_intent_next_action_display_oxxo_details/mod.rs new file mode 100644 index 000000000..f20f9d0a3 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_display_oxxo_details/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionDisplayOxxoDetails { + /// The timestamp after which the OXXO voucher expires. + pub expires_after: Option, + /// The URL for the hosted OXXO voucher page, which allows customers to view and print an OXXO voucher. + pub hosted_voucher_url: Option, + /// OXXO reference number. + pub number: Option, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_konbini/mod.rs b/stripe_types/src/generated/payment_intent_next_action_konbini/mod.rs new file mode 100644 index 000000000..fd5fda9c0 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_konbini/mod.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionKonbini { + /// The timestamp at which the pending Konbini payment expires. + pub expires_at: stripe_types::Timestamp, + /// The URL for the Konbini payment instructions page, which allows customers to view and print a Konbini voucher. + pub hosted_voucher_url: Option, + pub stores: stripe_types::PaymentIntentNextActionKonbiniStores, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_konbini_familymart/mod.rs b/stripe_types/src/generated/payment_intent_next_action_konbini_familymart/mod.rs new file mode 100644 index 000000000..f19a04ed3 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_konbini_familymart/mod.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionKonbiniFamilymart { + /// The confirmation number. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_number: Option, + /// The payment code. + pub payment_code: String, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_konbini_lawson/mod.rs b/stripe_types/src/generated/payment_intent_next_action_konbini_lawson/mod.rs new file mode 100644 index 000000000..17b27bc7d --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_konbini_lawson/mod.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionKonbiniLawson { + /// The confirmation number. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_number: Option, + /// The payment code. + pub payment_code: String, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_konbini_ministop/mod.rs b/stripe_types/src/generated/payment_intent_next_action_konbini_ministop/mod.rs new file mode 100644 index 000000000..449a464c8 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_konbini_ministop/mod.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionKonbiniMinistop { + /// The confirmation number. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_number: Option, + /// The payment code. + pub payment_code: String, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_konbini_seicomart/mod.rs b/stripe_types/src/generated/payment_intent_next_action_konbini_seicomart/mod.rs new file mode 100644 index 000000000..b9416a59f --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_konbini_seicomart/mod.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionKonbiniSeicomart { + /// The confirmation number. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_number: Option, + /// The payment code. + pub payment_code: String, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_konbini_stores/mod.rs b/stripe_types/src/generated/payment_intent_next_action_konbini_stores/mod.rs new file mode 100644 index 000000000..fb40f489a --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_konbini_stores/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionKonbiniStores { + /// FamilyMart instruction details. + pub familymart: Option, + /// Lawson instruction details. + pub lawson: Option, + /// Ministop instruction details. + pub ministop: Option, + /// Seicomart instruction details. + pub seicomart: Option, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_paynow_display_qr_code/mod.rs b/stripe_types/src/generated/payment_intent_next_action_paynow_display_qr_code/mod.rs new file mode 100644 index 000000000..fdf7fadfb --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_paynow_display_qr_code/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionPaynowDisplayQrCode { + /// The raw data string used to generate QR code, it should be used together with QR code library. + pub data: String, + /// The URL to the hosted PayNow instructions page, which allows customers to view the PayNow QR code. + pub hosted_instructions_url: Option, + /// The image_url_png string used to render QR code. + pub image_url_png: String, + /// The image_url_svg string used to render QR code. + pub image_url_svg: String, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_pix_display_qr_code/mod.rs b/stripe_types/src/generated/payment_intent_next_action_pix_display_qr_code/mod.rs new file mode 100644 index 000000000..9896f077f --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_pix_display_qr_code/mod.rs @@ -0,0 +1,18 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionPixDisplayQrCode { + /// The raw data string used to generate QR code, it should be used together with QR code library. + #[serde(skip_serializing_if = "Option::is_none")] + pub data: Option, + /// The date (unix timestamp) when the PIX expires. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// The URL to the hosted pix instructions page, which allows customers to view the pix QR code. + #[serde(skip_serializing_if = "Option::is_none")] + pub hosted_instructions_url: Option, + /// The image_url_png string used to render png QR code. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url_png: Option, + /// The image_url_svg string used to render svg QR code. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url_svg: Option, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_promptpay_display_qr_code/mod.rs b/stripe_types/src/generated/payment_intent_next_action_promptpay_display_qr_code/mod.rs new file mode 100644 index 000000000..55b1e1652 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_promptpay_display_qr_code/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionPromptpayDisplayQrCode { + /// The raw data string used to generate QR code, it should be used together with QR code library. + pub data: String, + /// The URL to the hosted PromptPay instructions page, which allows customers to view the PromptPay QR code. + pub hosted_instructions_url: String, + /// The PNG path used to render the QR code, can be used as the source in an HTML img tag. + pub image_url_png: String, + /// The SVG path used to render the QR code, can be used as the source in an HTML img tag. + pub image_url_svg: String, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_redirect_to_url/mod.rs b/stripe_types/src/generated/payment_intent_next_action_redirect_to_url/mod.rs new file mode 100644 index 000000000..4dcdf5e6c --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_redirect_to_url/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionRedirectToUrl { + /// If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. + pub return_url: Option, + /// The URL you must redirect your customer to in order to authenticate the payment. + pub url: Option, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_verify_with_microdeposits/mod.rs b/stripe_types/src/generated/payment_intent_next_action_verify_with_microdeposits/mod.rs new file mode 100644 index 000000000..7ebdfa7b0 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_verify_with_microdeposits/mod.rs @@ -0,0 +1,77 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionVerifyWithMicrodeposits { + /// The timestamp when the microdeposits are expected to land. + pub arrival_date: stripe_types::Timestamp, + /// The URL for the hosted verification page, which allows customers to verify their bank account. + pub hosted_verification_url: String, + /// The type of the microdeposit sent to the customer. + /// + /// Used to distinguish between different verification methods. + pub microdeposit_type: Option, +} +/// The type of the microdeposit sent to the customer. +/// +/// Used to distinguish between different verification methods. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { + Amounts, + DescriptorCode, +} +impl PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { + pub fn as_str(self) -> &'static str { + use PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType::*; + match self { + Amounts => "amounts", + DescriptorCode => "descriptor_code", + } + } +} + +impl std::str::FromStr for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType::*; + match s { + "amounts" => Ok(Amounts), + "descriptor_code" => Ok(DescriptorCode), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_intent_next_action_wechat_pay_display_qr_code/mod.rs b/stripe_types/src/generated/payment_intent_next_action_wechat_pay_display_qr_code/mod.rs new file mode 100644 index 000000000..9fb21b072 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_wechat_pay_display_qr_code/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionWechatPayDisplayQrCode { + /// The data being used to generate QR code. + pub data: String, + /// The URL to the hosted WeChat Pay instructions page, which allows customers to view the WeChat Pay QR code. + pub hosted_instructions_url: String, + /// The base64 image data for a pre-generated QR code. + pub image_data_url: String, + /// The image_url_png string used to render QR code. + pub image_url_png: String, + /// The image_url_svg string used to render QR code. + pub image_url_svg: String, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_wechat_pay_redirect_to_android_app/mod.rs b/stripe_types/src/generated/payment_intent_next_action_wechat_pay_redirect_to_android_app/mod.rs new file mode 100644 index 000000000..905d97991 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_wechat_pay_redirect_to_android_app/mod.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionWechatPayRedirectToAndroidApp { + /// app_id is the APP ID registered on WeChat open platform. + pub app_id: String, + /// nonce_str is a random string. + pub nonce_str: String, + /// package is static value. + pub package: String, + /// an unique merchant ID assigned by WeChat Pay. + pub partner_id: String, + /// an unique trading ID assigned by WeChat Pay. + pub prepay_id: String, + /// A signature. + pub sign: String, + /// Specifies the current time in epoch format. + pub timestamp: String, +} diff --git a/stripe_types/src/generated/payment_intent_next_action_wechat_pay_redirect_to_ios_app/mod.rs b/stripe_types/src/generated/payment_intent_next_action_wechat_pay_redirect_to_ios_app/mod.rs new file mode 100644 index 000000000..717a10b5d --- /dev/null +++ b/stripe_types/src/generated/payment_intent_next_action_wechat_pay_redirect_to_ios_app/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionWechatPayRedirectToIosApp { + /// An universal link that redirect to WeChat Pay app. + pub native_url: String, +} diff --git a/stripe_types/src/generated/payment_intent_payment_method_options/mod.rs b/stripe_types/src/generated/payment_intent_payment_method_options/mod.rs new file mode 100644 index 000000000..2e260a913 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_payment_method_options/mod.rs @@ -0,0 +1,71 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option, +} diff --git a/stripe_types/src/generated/payment_intent_payment_method_options_acss_debit/mod.rs b/stripe_types/src/generated/payment_intent_payment_method_options_acss_debit/mod.rs new file mode 100644 index 000000000..51b5b34cb --- /dev/null +++ b/stripe_types/src/generated/payment_intent_payment_method_options_acss_debit/mod.rs @@ -0,0 +1,150 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsAcssDebit { + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage", + ) + }) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_intent_payment_method_options_au_becs_debit/mod.rs b/stripe_types/src/generated/payment_intent_payment_method_options_au_becs_debit/mod.rs new file mode 100644 index 000000000..7b07c48f4 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_payment_method_options_au_becs_debit/mod.rs @@ -0,0 +1,79 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsAuBecsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_intent_payment_method_options_blik/mod.rs b/stripe_types/src/generated/payment_intent_payment_method_options_blik/mod.rs new file mode 100644 index 000000000..13284bb18 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_payment_method_options_blik/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsBlik {} diff --git a/stripe_types/src/generated/payment_intent_payment_method_options_card/mod.rs b/stripe_types/src/generated/payment_intent_payment_method_options_card/mod.rs new file mode 100644 index 000000000..b9d6d5c66 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_payment_method_options_card/mod.rs @@ -0,0 +1,593 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsCard { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Installment details for this payment (Mexico only). + /// + /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + pub installments: Option, + /// Configuration options for setting up an eMandate for cards issued in India. + pub mandate_options: Option, + /// Selected network to process this payment intent on. + /// + /// Depends on the available networks of the card attached to the payment intent. + /// Can be only set confirm-time. + pub network: Option, + /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_extended_authorization: + Option, + /// Request ability to [increment](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_incremental_authorization: + Option, + /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_multicapture: Option, + /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_overcapture: Option, + /// 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). + /// + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// Permitted values include: `automatic` or `any`. + /// If not provided, defaults to `automatic`. + /// 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. + pub request_three_d_secure: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Provides information about a card payment that customers see on their statements. + /// + /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kana: Option, + /// Provides information about a card payment that customers see on their statements. + /// + /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 17 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kanji: Option, +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsCardCaptureMethod { + Manual, +} +impl PaymentIntentPaymentMethodOptionsCardCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsCardCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsCardCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsCardCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsCardCaptureMethod", + ) + }) + } +} +/// Selected network to process this payment intent on. +/// +/// Depends on the available networks of the card attached to the payment intent. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl PaymentIntentPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsCardNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsCardNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsCardNetwork", + ) + }) + } +} +/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + IfAvailable, + Never, +} +impl PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization")) + } +} +/// Request ability to [increment](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + IfAvailable, + Never, +} +impl PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization")) + } +} +/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsCardRequestMulticapture { + IfAvailable, + Never, +} +impl PaymentIntentPaymentMethodOptionsCardRequestMulticapture { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsCardRequestMulticapture::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsCardRequestMulticapture { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsCardRequestMulticapture::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsCardRequestMulticapture", + ) + }) + } +} +/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsCardRequestOvercapture { + IfAvailable, + Never, +} +impl PaymentIntentPaymentMethodOptionsCardRequestOvercapture { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsCardRequestOvercapture::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsCardRequestOvercapture { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsCardRequestOvercapture::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsCardRequestOvercapture", + ) + }) + } +} +/// 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). +/// +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// Permitted values include: `automatic` or `any`. +/// If not provided, defaults to `automatic`. +/// 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. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, + ChallengeOnly, +} +impl PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + ChallengeOnly => "challenge_only", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + "challenge_only" => Ok(ChallengeOnly), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_intent_payment_method_options_eps/mod.rs b/stripe_types/src/generated/payment_intent_payment_method_options_eps/mod.rs new file mode 100644 index 000000000..353edc93f --- /dev/null +++ b/stripe_types/src/generated/payment_intent_payment_method_options_eps/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsEps { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + None, +} +impl PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_intent_payment_method_options_link/mod.rs b/stripe_types/src/generated/payment_intent_payment_method_options_link/mod.rs new file mode 100644 index 000000000..974eb42e4 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_payment_method_options_link/mod.rs @@ -0,0 +1,140 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsLink { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// \[Deprecated\] This is a legacy parameter that no longer has any function. + pub persistent_token: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsLinkCaptureMethod { + Manual, +} +impl PaymentIntentPaymentMethodOptionsLinkCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsLinkCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsLinkCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsLinkCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsLinkCaptureMethod", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + None, + OffSession, +} +impl PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_intent_payment_method_options_mandate_options_acss_debit/mod.rs b/stripe_types/src/generated/payment_intent_payment_method_options_mandate_options_acss_debit/mod.rs new file mode 100644 index 000000000..07b8fc42f --- /dev/null +++ b/stripe_types/src/generated/payment_intent_payment_method_options_mandate_options_acss_debit/mod.rs @@ -0,0 +1,139 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit { + /// A URL for custom mandate text. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option, + /// Description of the interval. + /// + /// Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + pub interval_description: Option, + /// Payment schedule for the mandate. + pub payment_schedule: + Option, + /// Transaction type of the mandate. + pub transaction_type: + Option, +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule")) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + Business, + Personal, +} +impl PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType")) + } +} diff --git a/stripe_types/src/generated/payment_intent_payment_method_options_mandate_options_sepa_debit/mod.rs b/stripe_types/src/generated/payment_intent_payment_method_options_mandate_options_sepa_debit/mod.rs new file mode 100644 index 000000000..7571f1f03 --- /dev/null +++ b/stripe_types/src/generated/payment_intent_payment_method_options_mandate_options_sepa_debit/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsMandateOptionsSepaDebit {} diff --git a/stripe_types/src/generated/payment_intent_payment_method_options_sepa_debit/mod.rs b/stripe_types/src/generated/payment_intent_payment_method_options_sepa_debit/mod.rs new file mode 100644 index 000000000..a2562ac5c --- /dev/null +++ b/stripe_types/src/generated/payment_intent_payment_method_options_sepa_debit/mod.rs @@ -0,0 +1,82 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsSepaDebit { + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_intent_payment_method_options_us_bank_account/mod.rs b/stripe_types/src/generated/payment_intent_payment_method_options_us_bank_account/mod.rs new file mode 100644 index 000000000..3930849fd --- /dev/null +++ b/stripe_types/src/generated/payment_intent_payment_method_options_us_bank_account/mod.rs @@ -0,0 +1,214 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsUsBankAccount { + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: Option, + /// Preferred transaction settlement speed. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_settlement_speed: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +/// Preferred transaction settlement speed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + Fastest, + Standard, +} +impl PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*; + match self { + Fastest => "fastest", + Standard => "standard", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*; + match s { + "fastest" => Ok(Fastest), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed")) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage", + ) + }) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod")) + } +} diff --git a/stripe_types/src/generated/payment_intent_processing/mod.rs b/stripe_types/src/generated/payment_intent_processing/mod.rs new file mode 100644 index 000000000..6de719d0a --- /dev/null +++ b/stripe_types/src/generated/payment_intent_processing/mod.rs @@ -0,0 +1,64 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentProcessing { + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + /// Type of the payment method for which payment is in `processing` state, one of `card`. + #[serde(rename = "type")] + pub type_: PaymentIntentProcessingType, +} +/// Type of the payment method for which payment is in `processing` state, one of `card`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentProcessingType { + Card, +} +impl PaymentIntentProcessingType { + pub fn as_str(self) -> &'static str { + use PaymentIntentProcessingType::*; + match self { + Card => "card", + } + } +} + +impl std::str::FromStr for PaymentIntentProcessingType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentProcessingType::*; + match s { + "card" => Ok(Card), + _ => Err(()), + } + } +} +impl AsRef for PaymentIntentProcessingType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentIntentProcessingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentProcessingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentProcessingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentProcessingType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentProcessingType")) + } +} diff --git a/stripe_types/src/generated/payment_intent_processing_customer_notification/mod.rs b/stripe_types/src/generated/payment_intent_processing_customer_notification/mod.rs new file mode 100644 index 000000000..2c3cbea8f --- /dev/null +++ b/stripe_types/src/generated/payment_intent_processing_customer_notification/mod.rs @@ -0,0 +1,9 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentProcessingCustomerNotification { + /// Whether customer approval has been requested for this payment. + /// + /// For payments greater than INR 15000 or mandate amount, the customer must provide explicit approval of the payment with their bank. + pub approval_requested: Option, + /// If customer approval is required, they need to provide approval before this time. + pub completes_at: Option, +} diff --git a/stripe_types/src/generated/payment_link/mod.rs b/stripe_types/src/generated/payment_link/mod.rs new file mode 100644 index 000000000..18f467d27 --- /dev/null +++ b/stripe_types/src/generated/payment_link/mod.rs @@ -0,0 +1,471 @@ +/// A payment link is a shareable URL that will take your customers to a hosted payment page. +/// +/// A payment link can be shared and used multiple times. When a customer opens a payment link it will open a new [checkout session](https://stripe.com/docs/api/checkout/sessions) to render the payment page. +/// You can use [checkout session events](https://stripe.com/docs/api/events/types#event_types-checkout.session.completed) to track payments through payment links. Related guide: [Payment Links API](https://stripe.com/docs/payment-links) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLink { + /// Whether the payment link's `url` is active. + /// + /// If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. + pub active: bool, + pub after_completion: stripe_types::PaymentLinksResourceAfterCompletion, + /// Whether user redeemable promotion codes are enabled. + pub allow_promotion_codes: bool, + /// The ID of the Connect application that created the Payment Link. + pub application: Option>, + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + pub application_fee_amount: Option, + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + pub application_fee_percent: Option, + pub automatic_tax: stripe_types::PaymentLinksResourceAutomaticTax, + /// Configuration for collecting the customer's billing address. + pub billing_address_collection: PaymentLinkBillingAddressCollection, + /// When set, provides configuration to gather active consent from customers. + pub consent_collection: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Collect additional information from your customer using custom fields. + /// + /// Up to 2 fields are supported. + pub custom_fields: Vec, + pub custom_text: stripe_types::PaymentLinksResourceCustomText, + /// Configuration for Customer creation during checkout. + pub customer_creation: PaymentLinkCustomerCreation, + /// Unique identifier for the object. + pub id: stripe_types::payment_link::PaymentLinkId, + /// Configuration for creating invoice for payment mode payment links. + pub invoice_creation: Option, + /// The line items representing what is being sold. + #[serde(default)] + pub line_items: stripe_types::List, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The account on behalf of which to charge. + /// + /// See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. + pub on_behalf_of: Option>, + /// Indicates the parameters to be passed to PaymentIntent creation during checkout. + pub payment_intent_data: Option, + /// Configuration for collecting a payment method during checkout. + pub payment_method_collection: PaymentLinkPaymentMethodCollection, + /// The list of payment method types that customers can use. + /// + /// When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + pub payment_method_types: Option>, + pub phone_number_collection: stripe_types::PaymentLinksResourcePhoneNumberCollection, + /// Configuration for collecting the customer's shipping address. + pub shipping_address_collection: + Option, + /// The shipping rate options applied to the session. + pub shipping_options: Vec, + /// Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. + pub submit_type: PaymentLinkSubmitType, + /// When creating a subscription, the specified configuration data will be used. + /// + /// There must be at least one line item with a recurring price to use `subscription_data`. + pub subscription_data: Option, + pub tax_id_collection: stripe_types::PaymentLinksResourceTaxIdCollection, + /// The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. + pub transfer_data: Option, + /// The public URL that can be shared with customers. + pub url: String, +} +/// Configuration for collecting the customer's billing address. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinkBillingAddressCollection { + Auto, + Required, +} +impl PaymentLinkBillingAddressCollection { + pub fn as_str(self) -> &'static str { + use PaymentLinkBillingAddressCollection::*; + match self { + Auto => "auto", + Required => "required", + } + } +} + +impl std::str::FromStr for PaymentLinkBillingAddressCollection { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinkBillingAddressCollection::*; + match s { + "auto" => Ok(Auto), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl AsRef for PaymentLinkBillingAddressCollection { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentLinkBillingAddressCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinkBillingAddressCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinkBillingAddressCollection { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinkBillingAddressCollection { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentLinkBillingAddressCollection") + }) + } +} +/// Configuration for Customer creation during checkout. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinkCustomerCreation { + Always, + IfRequired, +} +impl PaymentLinkCustomerCreation { + pub fn as_str(self) -> &'static str { + use PaymentLinkCustomerCreation::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for PaymentLinkCustomerCreation { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinkCustomerCreation::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl AsRef for PaymentLinkCustomerCreation { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentLinkCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinkCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinkCustomerCreation { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinkCustomerCreation { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PaymentLinkCustomerCreation")) + } +} +/// Configuration for collecting a payment method during checkout. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinkPaymentMethodCollection { + Always, + IfRequired, +} +impl PaymentLinkPaymentMethodCollection { + pub fn as_str(self) -> &'static str { + use PaymentLinkPaymentMethodCollection::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for PaymentLinkPaymentMethodCollection { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinkPaymentMethodCollection::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl AsRef for PaymentLinkPaymentMethodCollection { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentLinkPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinkPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinkPaymentMethodCollection { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinkPaymentMethodCollection { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentLinkPaymentMethodCollection") + }) + } +} +/// The list of payment method types that customers can use. +/// +/// When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentLinkPaymentMethodTypes { + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Card, + Cashapp, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentLinkPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use PaymentLinkPaymentMethodTypes::*; + match self { + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentLinkPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinkPaymentMethodTypes::*; + match s { + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + _ => Err(()), + } + } +} +impl AsRef for PaymentLinkPaymentMethodTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentLinkPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinkPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinkPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinkPaymentMethodTypes { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentLinkPaymentMethodTypes::Unknown)) + } +} +/// Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinkSubmitType { + Auto, + Book, + Donate, + Pay, +} +impl PaymentLinkSubmitType { + pub fn as_str(self) -> &'static str { + use PaymentLinkSubmitType::*; + match self { + Auto => "auto", + Book => "book", + Donate => "donate", + Pay => "pay", + } + } +} + +impl std::str::FromStr for PaymentLinkSubmitType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinkSubmitType::*; + match s { + "auto" => Ok(Auto), + "book" => Ok(Book), + "donate" => Ok(Donate), + "pay" => Ok(Pay), + _ => Err(()), + } + } +} +impl AsRef for PaymentLinkSubmitType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentLinkSubmitType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinkSubmitType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinkSubmitType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinkSubmitType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PaymentLinkSubmitType")) + } +} +impl stripe_types::Object for PaymentLink { + type Id = stripe_types::payment_link::PaymentLinkId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(PaymentLinkId, "plink_"); diff --git a/stripe_types/src/generated/payment_links_resource_after_completion/mod.rs b/stripe_types/src/generated/payment_links_resource_after_completion/mod.rs new file mode 100644 index 000000000..2416657d2 --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_after_completion/mod.rs @@ -0,0 +1,71 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceAfterCompletion { + #[serde(skip_serializing_if = "Option::is_none")] + pub hosted_confirmation: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect: Option, + /// The specified behavior after the purchase is complete. + #[serde(rename = "type")] + pub type_: PaymentLinksResourceAfterCompletionType, +} +/// The specified behavior after the purchase is complete. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinksResourceAfterCompletionType { + HostedConfirmation, + Redirect, +} +impl PaymentLinksResourceAfterCompletionType { + pub fn as_str(self) -> &'static str { + use PaymentLinksResourceAfterCompletionType::*; + match self { + HostedConfirmation => "hosted_confirmation", + Redirect => "redirect", + } + } +} + +impl std::str::FromStr for PaymentLinksResourceAfterCompletionType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinksResourceAfterCompletionType::*; + match s { + "hosted_confirmation" => Ok(HostedConfirmation), + "redirect" => Ok(Redirect), + _ => Err(()), + } + } +} +impl AsRef for PaymentLinksResourceAfterCompletionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentLinksResourceAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinksResourceAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinksResourceAfterCompletionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinksResourceAfterCompletionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentLinksResourceAfterCompletionType") + }) + } +} diff --git a/stripe_types/src/generated/payment_links_resource_automatic_tax/mod.rs b/stripe_types/src/generated/payment_links_resource_automatic_tax/mod.rs new file mode 100644 index 000000000..9d7545cea --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_automatic_tax/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceAutomaticTax { + /// If `true`, tax will be calculated automatically using the customer's location. + pub enabled: bool, +} diff --git a/stripe_types/src/generated/payment_links_resource_completion_behavior_confirmation_page/mod.rs b/stripe_types/src/generated/payment_links_resource_completion_behavior_confirmation_page/mod.rs new file mode 100644 index 000000000..e49274d09 --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_completion_behavior_confirmation_page/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCompletionBehaviorConfirmationPage { + /// The custom message that is displayed to the customer after the purchase is complete. + pub custom_message: Option, +} diff --git a/stripe_types/src/generated/payment_links_resource_completion_behavior_redirect/mod.rs b/stripe_types/src/generated/payment_links_resource_completion_behavior_redirect/mod.rs new file mode 100644 index 000000000..9a36cb2a2 --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_completion_behavior_redirect/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCompletionBehaviorRedirect { + /// The URL the customer will be redirected to after the purchase is complete. + pub url: String, +} diff --git a/stripe_types/src/generated/payment_links_resource_consent_collection/mod.rs b/stripe_types/src/generated/payment_links_resource_consent_collection/mod.rs new file mode 100644 index 000000000..14258f159 --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_consent_collection/mod.rs @@ -0,0 +1,135 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceConsentCollection { + /// If set to `auto`, enables the collection of customer consent for promotional communications. + pub promotions: Option, + /// If set to `required`, it requires cutomers to accept the terms of service before being able to pay. + /// + /// If set to `none`, customers won't be shown a checkbox to accept the terms of service. + pub terms_of_service: Option, +} +/// If set to `auto`, enables the collection of customer consent for promotional communications. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinksResourceConsentCollectionPromotions { + Auto, + None, +} +impl PaymentLinksResourceConsentCollectionPromotions { + pub fn as_str(self) -> &'static str { + use PaymentLinksResourceConsentCollectionPromotions::*; + match self { + Auto => "auto", + None => "none", + } + } +} + +impl std::str::FromStr for PaymentLinksResourceConsentCollectionPromotions { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinksResourceConsentCollectionPromotions::*; + match s { + "auto" => Ok(Auto), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentLinksResourceConsentCollectionPromotions { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentLinksResourceConsentCollectionPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinksResourceConsentCollectionPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinksResourceConsentCollectionPromotions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinksResourceConsentCollectionPromotions { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentLinksResourceConsentCollectionPromotions", + ) + }) + } +} +/// If set to `required`, it requires cutomers to accept the terms of service before being able to pay. +/// +/// If set to `none`, customers won't be shown a checkbox to accept the terms of service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinksResourceConsentCollectionTermsOfService { + None, + Required, +} +impl PaymentLinksResourceConsentCollectionTermsOfService { + pub fn as_str(self) -> &'static str { + use PaymentLinksResourceConsentCollectionTermsOfService::*; + match self { + None => "none", + Required => "required", + } + } +} + +impl std::str::FromStr for PaymentLinksResourceConsentCollectionTermsOfService { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinksResourceConsentCollectionTermsOfService::*; + match s { + "none" => Ok(None), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl AsRef for PaymentLinksResourceConsentCollectionTermsOfService { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentLinksResourceConsentCollectionTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinksResourceConsentCollectionTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinksResourceConsentCollectionTermsOfService { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinksResourceConsentCollectionTermsOfService { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentLinksResourceConsentCollectionTermsOfService", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_links_resource_custom_fields/mod.rs b/stripe_types/src/generated/payment_links_resource_custom_fields/mod.rs new file mode 100644 index 000000000..a70af16eb --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_custom_fields/mod.rs @@ -0,0 +1,84 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCustomFields { + #[serde(skip_serializing_if = "Option::is_none")] + pub dropdown: Option, + /// String of your choice that your integration can use to reconcile this field. + /// + /// Must be unique to this field, alphanumeric, and up to 200 characters. + pub key: String, + pub label: stripe_types::PaymentLinksResourceCustomFieldsLabel, + #[serde(skip_serializing_if = "Option::is_none")] + pub numeric: Option, + /// Whether the customer is required to complete the field before completing the Checkout Session. + /// + /// Defaults to `false`. + pub optional: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub text: Option, + /// The type of the field. + #[serde(rename = "type")] + pub type_: PaymentLinksResourceCustomFieldsType, +} +/// The type of the field. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinksResourceCustomFieldsType { + Dropdown, + Numeric, + Text, +} +impl PaymentLinksResourceCustomFieldsType { + pub fn as_str(self) -> &'static str { + use PaymentLinksResourceCustomFieldsType::*; + match self { + Dropdown => "dropdown", + Numeric => "numeric", + Text => "text", + } + } +} + +impl std::str::FromStr for PaymentLinksResourceCustomFieldsType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinksResourceCustomFieldsType::*; + match s { + "dropdown" => Ok(Dropdown), + "numeric" => Ok(Numeric), + "text" => Ok(Text), + _ => Err(()), + } + } +} +impl AsRef for PaymentLinksResourceCustomFieldsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentLinksResourceCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinksResourceCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinksResourceCustomFieldsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinksResourceCustomFieldsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentLinksResourceCustomFieldsType") + }) + } +} diff --git a/stripe_types/src/generated/payment_links_resource_custom_fields_dropdown/mod.rs b/stripe_types/src/generated/payment_links_resource_custom_fields_dropdown/mod.rs new file mode 100644 index 000000000..248107ff4 --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_custom_fields_dropdown/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCustomFieldsDropdown { + /// The options available for the customer to select. + /// + /// Up to 200 options allowed. + pub options: Vec, +} diff --git a/stripe_types/src/generated/payment_links_resource_custom_fields_dropdown_option/mod.rs b/stripe_types/src/generated/payment_links_resource_custom_fields_dropdown_option/mod.rs new file mode 100644 index 000000000..b8accd4cc --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_custom_fields_dropdown_option/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCustomFieldsDropdownOption { + /// The label for the option, displayed to the customer. + /// + /// Up to 100 characters. + pub label: String, + /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. + /// + /// Must be unique to this option, alphanumeric, and up to 100 characters. + pub value: String, +} diff --git a/stripe_types/src/generated/payment_links_resource_custom_fields_label/mod.rs b/stripe_types/src/generated/payment_links_resource_custom_fields_label/mod.rs new file mode 100644 index 000000000..eb2229bf3 --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_custom_fields_label/mod.rs @@ -0,0 +1,67 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCustomFieldsLabel { + /// Custom text for the label, displayed to the customer. + /// + /// Up to 50 characters. + pub custom: Option, + /// The type of the label. + #[serde(rename = "type")] + pub type_: PaymentLinksResourceCustomFieldsLabelType, +} +/// The type of the label. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinksResourceCustomFieldsLabelType { + Custom, +} +impl PaymentLinksResourceCustomFieldsLabelType { + pub fn as_str(self) -> &'static str { + use PaymentLinksResourceCustomFieldsLabelType::*; + match self { + Custom => "custom", + } + } +} + +impl std::str::FromStr for PaymentLinksResourceCustomFieldsLabelType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinksResourceCustomFieldsLabelType::*; + match s { + "custom" => Ok(Custom), + _ => Err(()), + } + } +} +impl AsRef for PaymentLinksResourceCustomFieldsLabelType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentLinksResourceCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinksResourceCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinksResourceCustomFieldsLabelType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinksResourceCustomFieldsLabelType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentLinksResourceCustomFieldsLabelType") + }) + } +} diff --git a/stripe_types/src/generated/payment_links_resource_custom_fields_numeric/mod.rs b/stripe_types/src/generated/payment_links_resource_custom_fields_numeric/mod.rs new file mode 100644 index 000000000..991942e28 --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_custom_fields_numeric/mod.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCustomFieldsNumeric { + /// The maximum character length constraint for the customer's input. + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + pub minimum_length: Option, +} diff --git a/stripe_types/src/generated/payment_links_resource_custom_fields_text/mod.rs b/stripe_types/src/generated/payment_links_resource_custom_fields_text/mod.rs new file mode 100644 index 000000000..2bc876ea7 --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_custom_fields_text/mod.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCustomFieldsText { + /// The maximum character length constraint for the customer's input. + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + pub minimum_length: Option, +} diff --git a/stripe_types/src/generated/payment_links_resource_custom_text/mod.rs b/stripe_types/src/generated/payment_links_resource_custom_text/mod.rs new file mode 100644 index 000000000..c57a3c7f5 --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_custom_text/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCustomText { + /// Custom text that should be displayed alongside shipping address collection. + pub shipping_address: Option, + /// Custom text that should be displayed alongside the payment confirmation button. + pub submit: Option, + /// Custom text that should be displayed in place of the default terms of service agreement text. + pub terms_of_service_acceptance: Option, +} diff --git a/stripe_types/src/generated/payment_links_resource_custom_text_position/mod.rs b/stripe_types/src/generated/payment_links_resource_custom_text_position/mod.rs new file mode 100644 index 000000000..cbef6514a --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_custom_text_position/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCustomTextPosition { + /// Text may be up to 1200 characters in length. + pub message: String, +} diff --git a/stripe_types/src/generated/payment_links_resource_invoice_creation/mod.rs b/stripe_types/src/generated/payment_links_resource_invoice_creation/mod.rs new file mode 100644 index 000000000..48b6f4c2e --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_invoice_creation/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceInvoiceCreation { + /// Enable creating an invoice on successful payment. + pub enabled: bool, + /// Configuration for the invoice. + /// + /// Default invoice values will be used if unspecified. + pub invoice_data: Option, +} diff --git a/stripe_types/src/generated/payment_links_resource_invoice_settings/mod.rs b/stripe_types/src/generated/payment_links_resource_invoice_settings/mod.rs new file mode 100644 index 000000000..fb81b060a --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_invoice_settings/mod.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceInvoiceSettings { + /// The account tax IDs associated with the invoice. + pub account_tax_ids: Option>>, + /// A list of up to 4 custom fields to be displayed on the invoice. + pub custom_fields: Option>, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// Footer to be displayed on the invoice. + pub footer: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// Options for invoice PDF rendering. + pub rendering_options: Option, +} diff --git a/stripe_types/src/generated/payment_links_resource_payment_intent_data/mod.rs b/stripe_types/src/generated/payment_links_resource_payment_intent_data/mod.rs new file mode 100644 index 000000000..063f465f4 --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_payment_intent_data/mod.rs @@ -0,0 +1,149 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourcePaymentIntentData { + /// Indicates when the funds will be captured from the customer's account. + pub capture_method: Option, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. + pub metadata: std::collections::HashMap, + /// Indicates that you intend to make future payments with the payment method collected during checkout. + pub setup_future_usage: Option, + /// Extra information about the payment. + /// + /// This will appear on your customer's statement when this payment succeeds in creating a charge. + pub statement_descriptor: Option, + /// Provides information about the charge that customers see on their statements. + /// + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. + /// Maximum 22 characters for the concatenated descriptor. + pub statement_descriptor_suffix: Option, +} +/// Indicates when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinksResourcePaymentIntentDataCaptureMethod { + Automatic, + AutomaticAsync, + Manual, +} +impl PaymentLinksResourcePaymentIntentDataCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentLinksResourcePaymentIntentDataCaptureMethod::*; + match self { + Automatic => "automatic", + AutomaticAsync => "automatic_async", + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentLinksResourcePaymentIntentDataCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinksResourcePaymentIntentDataCaptureMethod::*; + match s { + "automatic" => Ok(Automatic), + "automatic_async" => Ok(AutomaticAsync), + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for PaymentLinksResourcePaymentIntentDataCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentLinksResourcePaymentIntentDataCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinksResourcePaymentIntentDataCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinksResourcePaymentIntentDataCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinksResourcePaymentIntentDataCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentLinksResourcePaymentIntentDataCaptureMethod", + ) + }) + } +} +/// Indicates that you intend to make future payments with the payment method collected during checkout. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinksResourcePaymentIntentDataSetupFutureUsage { + OffSession, + OnSession, +} +impl PaymentLinksResourcePaymentIntentDataSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentLinksResourcePaymentIntentDataSetupFutureUsage::*; + match self { + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentLinksResourcePaymentIntentDataSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinksResourcePaymentIntentDataSetupFutureUsage::*; + match s { + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for PaymentLinksResourcePaymentIntentDataSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentLinksResourcePaymentIntentDataSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinksResourcePaymentIntentDataSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinksResourcePaymentIntentDataSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinksResourcePaymentIntentDataSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentLinksResourcePaymentIntentDataSetupFutureUsage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_links_resource_phone_number_collection/mod.rs b/stripe_types/src/generated/payment_links_resource_phone_number_collection/mod.rs new file mode 100644 index 000000000..20a7c9d22 --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_phone_number_collection/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourcePhoneNumberCollection { + /// If `true`, a phone number will be collected during checkout. + pub enabled: bool, +} diff --git a/stripe_types/src/generated/payment_links_resource_shipping_address_collection/mod.rs b/stripe_types/src/generated/payment_links_resource_shipping_address_collection/mod.rs new file mode 100644 index 000000000..66d4613e7 --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_shipping_address_collection/mod.rs @@ -0,0 +1,779 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceShippingAddressCollection { + /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. + /// + /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + pub allowed_countries: Vec, +} +/// An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. +/// +/// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentLinksResourceShippingAddressCollectionAllowedCountries { + Ac, + Ad, + Ae, + Af, + Ag, + Ai, + Al, + Am, + Ao, + Aq, + Ar, + At, + Au, + Aw, + Ax, + Az, + Ba, + Bb, + Bd, + Be, + Bf, + Bg, + Bh, + Bi, + Bj, + Bl, + Bm, + Bn, + Bo, + Bq, + Br, + Bs, + Bt, + Bv, + Bw, + By, + Bz, + Ca, + Cd, + Cf, + Cg, + Ch, + Ci, + Ck, + Cl, + Cm, + Cn, + Co, + Cr, + Cv, + Cw, + Cy, + Cz, + De, + Dj, + Dk, + Dm, + Do, + Dz, + Ec, + Ee, + Eg, + Eh, + Er, + Es, + Et, + Fi, + Fj, + Fk, + Fo, + Fr, + Ga, + Gb, + Gd, + Ge, + Gf, + Gg, + Gh, + Gi, + Gl, + Gm, + Gn, + Gp, + Gq, + Gr, + Gs, + Gt, + Gu, + Gw, + Gy, + Hk, + Hn, + Hr, + Ht, + Hu, + Id, + Ie, + Il, + Im, + In, + Io, + Iq, + Is, + It, + Je, + Jm, + Jo, + Jp, + Ke, + Kg, + Kh, + Ki, + Km, + Kn, + Kr, + Kw, + Ky, + Kz, + La, + Lb, + Lc, + Li, + Lk, + Lr, + Ls, + Lt, + Lu, + Lv, + Ly, + Ma, + Mc, + Md, + Me, + Mf, + Mg, + Mk, + Ml, + Mm, + Mn, + Mo, + Mq, + Mr, + Ms, + Mt, + Mu, + Mv, + Mw, + Mx, + My, + Mz, + Na, + Nc, + Ne, + Ng, + Ni, + Nl, + No, + Np, + Nr, + Nu, + Nz, + Om, + Pa, + Pe, + Pf, + Pg, + Ph, + Pk, + Pl, + Pm, + Pn, + Pr, + Ps, + Pt, + Py, + Qa, + Re, + Ro, + Rs, + Ru, + Rw, + Sa, + Sb, + Sc, + Se, + Sg, + Sh, + Si, + Sj, + Sk, + Sl, + Sm, + Sn, + So, + Sr, + Ss, + St, + Sv, + Sx, + Sz, + Ta, + Tc, + Td, + Tf, + Tg, + Th, + Tj, + Tk, + Tl, + Tm, + Tn, + To, + Tr, + Tt, + Tv, + Tw, + Tz, + Ua, + Ug, + Us, + Uy, + Uz, + Va, + Vc, + Ve, + Vg, + Vn, + Vu, + Wf, + Ws, + Xk, + Ye, + Yt, + Za, + Zm, + Zw, + Zz, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentLinksResourceShippingAddressCollectionAllowedCountries { + pub fn as_str(self) -> &'static str { + use PaymentLinksResourceShippingAddressCollectionAllowedCountries::*; + match self { + Ac => "AC", + Ad => "AD", + Ae => "AE", + Af => "AF", + Ag => "AG", + Ai => "AI", + Al => "AL", + Am => "AM", + Ao => "AO", + Aq => "AQ", + Ar => "AR", + At => "AT", + Au => "AU", + Aw => "AW", + Ax => "AX", + Az => "AZ", + Ba => "BA", + Bb => "BB", + Bd => "BD", + Be => "BE", + Bf => "BF", + Bg => "BG", + Bh => "BH", + Bi => "BI", + Bj => "BJ", + Bl => "BL", + Bm => "BM", + Bn => "BN", + Bo => "BO", + Bq => "BQ", + Br => "BR", + Bs => "BS", + Bt => "BT", + Bv => "BV", + Bw => "BW", + By => "BY", + Bz => "BZ", + Ca => "CA", + Cd => "CD", + Cf => "CF", + Cg => "CG", + Ch => "CH", + Ci => "CI", + Ck => "CK", + Cl => "CL", + Cm => "CM", + Cn => "CN", + Co => "CO", + Cr => "CR", + Cv => "CV", + Cw => "CW", + Cy => "CY", + Cz => "CZ", + De => "DE", + Dj => "DJ", + Dk => "DK", + Dm => "DM", + Do => "DO", + Dz => "DZ", + Ec => "EC", + Ee => "EE", + Eg => "EG", + Eh => "EH", + Er => "ER", + Es => "ES", + Et => "ET", + Fi => "FI", + Fj => "FJ", + Fk => "FK", + Fo => "FO", + Fr => "FR", + Ga => "GA", + Gb => "GB", + Gd => "GD", + Ge => "GE", + Gf => "GF", + Gg => "GG", + Gh => "GH", + Gi => "GI", + Gl => "GL", + Gm => "GM", + Gn => "GN", + Gp => "GP", + Gq => "GQ", + Gr => "GR", + Gs => "GS", + Gt => "GT", + Gu => "GU", + Gw => "GW", + Gy => "GY", + Hk => "HK", + Hn => "HN", + Hr => "HR", + Ht => "HT", + Hu => "HU", + Id => "ID", + Ie => "IE", + Il => "IL", + Im => "IM", + In => "IN", + Io => "IO", + Iq => "IQ", + Is => "IS", + It => "IT", + Je => "JE", + Jm => "JM", + Jo => "JO", + Jp => "JP", + Ke => "KE", + Kg => "KG", + Kh => "KH", + Ki => "KI", + Km => "KM", + Kn => "KN", + Kr => "KR", + Kw => "KW", + Ky => "KY", + Kz => "KZ", + La => "LA", + Lb => "LB", + Lc => "LC", + Li => "LI", + Lk => "LK", + Lr => "LR", + Ls => "LS", + Lt => "LT", + Lu => "LU", + Lv => "LV", + Ly => "LY", + Ma => "MA", + Mc => "MC", + Md => "MD", + Me => "ME", + Mf => "MF", + Mg => "MG", + Mk => "MK", + Ml => "ML", + Mm => "MM", + Mn => "MN", + Mo => "MO", + Mq => "MQ", + Mr => "MR", + Ms => "MS", + Mt => "MT", + Mu => "MU", + Mv => "MV", + Mw => "MW", + Mx => "MX", + My => "MY", + Mz => "MZ", + Na => "NA", + Nc => "NC", + Ne => "NE", + Ng => "NG", + Ni => "NI", + Nl => "NL", + No => "NO", + Np => "NP", + Nr => "NR", + Nu => "NU", + Nz => "NZ", + Om => "OM", + Pa => "PA", + Pe => "PE", + Pf => "PF", + Pg => "PG", + Ph => "PH", + Pk => "PK", + Pl => "PL", + Pm => "PM", + Pn => "PN", + Pr => "PR", + Ps => "PS", + Pt => "PT", + Py => "PY", + Qa => "QA", + Re => "RE", + Ro => "RO", + Rs => "RS", + Ru => "RU", + Rw => "RW", + Sa => "SA", + Sb => "SB", + Sc => "SC", + Se => "SE", + Sg => "SG", + Sh => "SH", + Si => "SI", + Sj => "SJ", + Sk => "SK", + Sl => "SL", + Sm => "SM", + Sn => "SN", + So => "SO", + Sr => "SR", + Ss => "SS", + St => "ST", + Sv => "SV", + Sx => "SX", + Sz => "SZ", + Ta => "TA", + Tc => "TC", + Td => "TD", + Tf => "TF", + Tg => "TG", + Th => "TH", + Tj => "TJ", + Tk => "TK", + Tl => "TL", + Tm => "TM", + Tn => "TN", + To => "TO", + Tr => "TR", + Tt => "TT", + Tv => "TV", + Tw => "TW", + Tz => "TZ", + Ua => "UA", + Ug => "UG", + Us => "US", + Uy => "UY", + Uz => "UZ", + Va => "VA", + Vc => "VC", + Ve => "VE", + Vg => "VG", + Vn => "VN", + Vu => "VU", + Wf => "WF", + Ws => "WS", + Xk => "XK", + Ye => "YE", + Yt => "YT", + Za => "ZA", + Zm => "ZM", + Zw => "ZW", + Zz => "ZZ", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentLinksResourceShippingAddressCollectionAllowedCountries { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinksResourceShippingAddressCollectionAllowedCountries::*; + match s { + "AC" => Ok(Ac), + "AD" => Ok(Ad), + "AE" => Ok(Ae), + "AF" => Ok(Af), + "AG" => Ok(Ag), + "AI" => Ok(Ai), + "AL" => Ok(Al), + "AM" => Ok(Am), + "AO" => Ok(Ao), + "AQ" => Ok(Aq), + "AR" => Ok(Ar), + "AT" => Ok(At), + "AU" => Ok(Au), + "AW" => Ok(Aw), + "AX" => Ok(Ax), + "AZ" => Ok(Az), + "BA" => Ok(Ba), + "BB" => Ok(Bb), + "BD" => Ok(Bd), + "BE" => Ok(Be), + "BF" => Ok(Bf), + "BG" => Ok(Bg), + "BH" => Ok(Bh), + "BI" => Ok(Bi), + "BJ" => Ok(Bj), + "BL" => Ok(Bl), + "BM" => Ok(Bm), + "BN" => Ok(Bn), + "BO" => Ok(Bo), + "BQ" => Ok(Bq), + "BR" => Ok(Br), + "BS" => Ok(Bs), + "BT" => Ok(Bt), + "BV" => Ok(Bv), + "BW" => Ok(Bw), + "BY" => Ok(By), + "BZ" => Ok(Bz), + "CA" => Ok(Ca), + "CD" => Ok(Cd), + "CF" => Ok(Cf), + "CG" => Ok(Cg), + "CH" => Ok(Ch), + "CI" => Ok(Ci), + "CK" => Ok(Ck), + "CL" => Ok(Cl), + "CM" => Ok(Cm), + "CN" => Ok(Cn), + "CO" => Ok(Co), + "CR" => Ok(Cr), + "CV" => Ok(Cv), + "CW" => Ok(Cw), + "CY" => Ok(Cy), + "CZ" => Ok(Cz), + "DE" => Ok(De), + "DJ" => Ok(Dj), + "DK" => Ok(Dk), + "DM" => Ok(Dm), + "DO" => Ok(Do), + "DZ" => Ok(Dz), + "EC" => Ok(Ec), + "EE" => Ok(Ee), + "EG" => Ok(Eg), + "EH" => Ok(Eh), + "ER" => Ok(Er), + "ES" => Ok(Es), + "ET" => Ok(Et), + "FI" => Ok(Fi), + "FJ" => Ok(Fj), + "FK" => Ok(Fk), + "FO" => Ok(Fo), + "FR" => Ok(Fr), + "GA" => Ok(Ga), + "GB" => Ok(Gb), + "GD" => Ok(Gd), + "GE" => Ok(Ge), + "GF" => Ok(Gf), + "GG" => Ok(Gg), + "GH" => Ok(Gh), + "GI" => Ok(Gi), + "GL" => Ok(Gl), + "GM" => Ok(Gm), + "GN" => Ok(Gn), + "GP" => Ok(Gp), + "GQ" => Ok(Gq), + "GR" => Ok(Gr), + "GS" => Ok(Gs), + "GT" => Ok(Gt), + "GU" => Ok(Gu), + "GW" => Ok(Gw), + "GY" => Ok(Gy), + "HK" => Ok(Hk), + "HN" => Ok(Hn), + "HR" => Ok(Hr), + "HT" => Ok(Ht), + "HU" => Ok(Hu), + "ID" => Ok(Id), + "IE" => Ok(Ie), + "IL" => Ok(Il), + "IM" => Ok(Im), + "IN" => Ok(In), + "IO" => Ok(Io), + "IQ" => Ok(Iq), + "IS" => Ok(Is), + "IT" => Ok(It), + "JE" => Ok(Je), + "JM" => Ok(Jm), + "JO" => Ok(Jo), + "JP" => Ok(Jp), + "KE" => Ok(Ke), + "KG" => Ok(Kg), + "KH" => Ok(Kh), + "KI" => Ok(Ki), + "KM" => Ok(Km), + "KN" => Ok(Kn), + "KR" => Ok(Kr), + "KW" => Ok(Kw), + "KY" => Ok(Ky), + "KZ" => Ok(Kz), + "LA" => Ok(La), + "LB" => Ok(Lb), + "LC" => Ok(Lc), + "LI" => Ok(Li), + "LK" => Ok(Lk), + "LR" => Ok(Lr), + "LS" => Ok(Ls), + "LT" => Ok(Lt), + "LU" => Ok(Lu), + "LV" => Ok(Lv), + "LY" => Ok(Ly), + "MA" => Ok(Ma), + "MC" => Ok(Mc), + "MD" => Ok(Md), + "ME" => Ok(Me), + "MF" => Ok(Mf), + "MG" => Ok(Mg), + "MK" => Ok(Mk), + "ML" => Ok(Ml), + "MM" => Ok(Mm), + "MN" => Ok(Mn), + "MO" => Ok(Mo), + "MQ" => Ok(Mq), + "MR" => Ok(Mr), + "MS" => Ok(Ms), + "MT" => Ok(Mt), + "MU" => Ok(Mu), + "MV" => Ok(Mv), + "MW" => Ok(Mw), + "MX" => Ok(Mx), + "MY" => Ok(My), + "MZ" => Ok(Mz), + "NA" => Ok(Na), + "NC" => Ok(Nc), + "NE" => Ok(Ne), + "NG" => Ok(Ng), + "NI" => Ok(Ni), + "NL" => Ok(Nl), + "NO" => Ok(No), + "NP" => Ok(Np), + "NR" => Ok(Nr), + "NU" => Ok(Nu), + "NZ" => Ok(Nz), + "OM" => Ok(Om), + "PA" => Ok(Pa), + "PE" => Ok(Pe), + "PF" => Ok(Pf), + "PG" => Ok(Pg), + "PH" => Ok(Ph), + "PK" => Ok(Pk), + "PL" => Ok(Pl), + "PM" => Ok(Pm), + "PN" => Ok(Pn), + "PR" => Ok(Pr), + "PS" => Ok(Ps), + "PT" => Ok(Pt), + "PY" => Ok(Py), + "QA" => Ok(Qa), + "RE" => Ok(Re), + "RO" => Ok(Ro), + "RS" => Ok(Rs), + "RU" => Ok(Ru), + "RW" => Ok(Rw), + "SA" => Ok(Sa), + "SB" => Ok(Sb), + "SC" => Ok(Sc), + "SE" => Ok(Se), + "SG" => Ok(Sg), + "SH" => Ok(Sh), + "SI" => Ok(Si), + "SJ" => Ok(Sj), + "SK" => Ok(Sk), + "SL" => Ok(Sl), + "SM" => Ok(Sm), + "SN" => Ok(Sn), + "SO" => Ok(So), + "SR" => Ok(Sr), + "SS" => Ok(Ss), + "ST" => Ok(St), + "SV" => Ok(Sv), + "SX" => Ok(Sx), + "SZ" => Ok(Sz), + "TA" => Ok(Ta), + "TC" => Ok(Tc), + "TD" => Ok(Td), + "TF" => Ok(Tf), + "TG" => Ok(Tg), + "TH" => Ok(Th), + "TJ" => Ok(Tj), + "TK" => Ok(Tk), + "TL" => Ok(Tl), + "TM" => Ok(Tm), + "TN" => Ok(Tn), + "TO" => Ok(To), + "TR" => Ok(Tr), + "TT" => Ok(Tt), + "TV" => Ok(Tv), + "TW" => Ok(Tw), + "TZ" => Ok(Tz), + "UA" => Ok(Ua), + "UG" => Ok(Ug), + "US" => Ok(Us), + "UY" => Ok(Uy), + "UZ" => Ok(Uz), + "VA" => Ok(Va), + "VC" => Ok(Vc), + "VE" => Ok(Ve), + "VG" => Ok(Vg), + "VN" => Ok(Vn), + "VU" => Ok(Vu), + "WF" => Ok(Wf), + "WS" => Ok(Ws), + "XK" => Ok(Xk), + "YE" => Ok(Ye), + "YT" => Ok(Yt), + "ZA" => Ok(Za), + "ZM" => Ok(Zm), + "ZW" => Ok(Zw), + "ZZ" => Ok(Zz), + _ => Err(()), + } + } +} +impl AsRef for PaymentLinksResourceShippingAddressCollectionAllowedCountries { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentLinksResourceShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinksResourceShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinksResourceShippingAddressCollectionAllowedCountries { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentLinksResourceShippingAddressCollectionAllowedCountries +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s) + .unwrap_or(PaymentLinksResourceShippingAddressCollectionAllowedCountries::Unknown)) + } +} diff --git a/stripe_types/src/generated/payment_links_resource_shipping_option/mod.rs b/stripe_types/src/generated/payment_links_resource_shipping_option/mod.rs new file mode 100644 index 000000000..830d4dcb4 --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_shipping_option/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceShippingOption { + /// A non-negative integer in cents representing how much to charge. + pub shipping_amount: i64, + /// The ID of the Shipping Rate to use for this shipping option. + pub shipping_rate: stripe_types::Expandable, +} diff --git a/stripe_types/src/generated/payment_links_resource_subscription_data/mod.rs b/stripe_types/src/generated/payment_links_resource_subscription_data/mod.rs new file mode 100644 index 000000000..1c3e38f24 --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_subscription_data/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceSubscriptionData { + /// The subscription's description, meant to be displayable to the customer. + /// + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + pub description: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. + pub metadata: std::collections::HashMap, + /// Integer representing the number of trial period days before the customer is charged for the first time. + pub trial_period_days: Option, +} diff --git a/stripe_types/src/generated/payment_links_resource_tax_id_collection/mod.rs b/stripe_types/src/generated/payment_links_resource_tax_id_collection/mod.rs new file mode 100644 index 000000000..9282ec204 --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_tax_id_collection/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceTaxIdCollection { + /// Indicates whether tax ID collection is enabled for the session. + pub enabled: bool, +} diff --git a/stripe_types/src/generated/payment_links_resource_transfer_data/mod.rs b/stripe_types/src/generated/payment_links_resource_transfer_data/mod.rs new file mode 100644 index 000000000..aa7d8cb8e --- /dev/null +++ b/stripe_types/src/generated/payment_links_resource_transfer_data/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceTransferData { + /// The amount in cents (or local equivalent) that will be transferred to the destination account. + /// + /// By default, the entire amount is transferred to the destination. + pub amount: Option, + /// The connected account receiving the transfer. + pub destination: stripe_types::Expandable, +} diff --git a/stripe_types/src/generated/payment_method/mod.rs b/stripe_types/src/generated/payment_method/mod.rs new file mode 100644 index 000000000..20dcb531e --- /dev/null +++ b/stripe_types/src/generated/payment_method/mod.rs @@ -0,0 +1,271 @@ +/// PaymentMethod objects represent your customer's payment instruments. +/// You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to +/// Customer objects to store instrument details for future payments. +/// +/// Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethod { + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + pub billing_details: stripe_types::BillingDetails, + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The ID of the Customer to which this PaymentMethod is saved. + /// + /// This will not be set when the PaymentMethod has not been saved to a Customer. + pub customer: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + /// Unique identifier for the object. + pub id: stripe_types::payment_method::PaymentMethodId, + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// The type of the PaymentMethod. + /// + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + pub type_: PaymentMethodType, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option, +} +/// The type of the PaymentMethod. +/// +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Card, + CardPresent, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + InteracPresent, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodType { + pub fn as_str(self) -> &'static str { + use PaymentMethodType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Card => "card", + CardPresent => "card_present", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + InteracPresent => "interac_present", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "card_present" => Ok(CardPresent), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "interac_present" => Ok(InteracPresent), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodType::Unknown)) + } +} +impl stripe_types::Object for PaymentMethod { + type Id = stripe_types::payment_method::PaymentMethodId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(PaymentMethodId, "pm_" | "card_" | "src_" | "ba_"); diff --git a/stripe_types/src/generated/payment_method_acss_debit/mod.rs b/stripe_types/src/generated/payment_method_acss_debit/mod.rs new file mode 100644 index 000000000..12e5943cd --- /dev/null +++ b/stripe_types/src/generated/payment_method_acss_debit/mod.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodAcssDebit { + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Uniquely identifies this particular bank account. + /// + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Institution number of the bank account. + pub institution_number: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// Transit number of the bank account. + pub transit_number: Option, +} diff --git a/stripe_types/src/generated/payment_method_affirm/mod.rs b/stripe_types/src/generated/payment_method_affirm/mod.rs new file mode 100644 index 000000000..21482a272 --- /dev/null +++ b/stripe_types/src/generated/payment_method_affirm/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodAffirm {} diff --git a/stripe_types/src/generated/payment_method_afterpay_clearpay/mod.rs b/stripe_types/src/generated/payment_method_afterpay_clearpay/mod.rs new file mode 100644 index 000000000..4a9cbd897 --- /dev/null +++ b/stripe_types/src/generated/payment_method_afterpay_clearpay/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodAfterpayClearpay {} diff --git a/stripe_types/src/generated/payment_method_au_becs_debit/mod.rs b/stripe_types/src/generated/payment_method_au_becs_debit/mod.rs new file mode 100644 index 000000000..a9c98e26e --- /dev/null +++ b/stripe_types/src/generated/payment_method_au_becs_debit/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodAuBecsDebit { + /// Six-digit number identifying bank and branch associated with this bank account. + pub bsb_number: Option, + /// Uniquely identifies this particular bank account. + /// + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, +} diff --git a/stripe_types/src/generated/payment_method_bacs_debit/mod.rs b/stripe_types/src/generated/payment_method_bacs_debit/mod.rs new file mode 100644 index 000000000..d9fca5b65 --- /dev/null +++ b/stripe_types/src/generated/payment_method_bacs_debit/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodBacsDebit { + /// Uniquely identifies this particular bank account. + /// + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// Sort code of the bank account. + /// + /// (e.g., `10-20-30`). + pub sort_code: Option, +} diff --git a/stripe_types/src/generated/payment_method_bancontact/mod.rs b/stripe_types/src/generated/payment_method_bancontact/mod.rs new file mode 100644 index 000000000..8c7d8a5b9 --- /dev/null +++ b/stripe_types/src/generated/payment_method_bancontact/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodBancontact {} diff --git a/stripe_types/src/generated/payment_method_blik/mod.rs b/stripe_types/src/generated/payment_method_blik/mod.rs new file mode 100644 index 000000000..f89a95af6 --- /dev/null +++ b/stripe_types/src/generated/payment_method_blik/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodBlik {} diff --git a/stripe_types/src/generated/payment_method_boleto/mod.rs b/stripe_types/src/generated/payment_method_boleto/mod.rs new file mode 100644 index 000000000..ec536a7cf --- /dev/null +++ b/stripe_types/src/generated/payment_method_boleto/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodBoleto { + /// Uniquely identifies the customer tax id (CNPJ or CPF). + pub tax_id: String, +} diff --git a/stripe_types/src/generated/payment_method_card/mod.rs b/stripe_types/src/generated/payment_method_card/mod.rs new file mode 100644 index 000000000..ab58e3425 --- /dev/null +++ b/stripe_types/src/generated/payment_method_card/mod.rs @@ -0,0 +1,50 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCard { + /// Card brand. + /// + /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub brand: String, + /// Checks on Card address and CVC if provided. + pub checks: Option, + /// Two-letter ISO code representing the country of the card. + /// + /// You could use this attribute to get a sense of the international breakdown of cards you've collected. + pub country: Option, + /// A high-level description of the type of cards issued in this range. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Two-digit number representing the card's expiration month. + pub exp_month: i64, + /// Four-digit number representing the card's expiration year. + pub exp_year: i64, + /// Uniquely identifies this particular card number. + /// + /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. + /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + /// Card funding type. + /// + /// Can be `credit`, `debit`, `prepaid`, or `unknown`. + pub funding: String, + /// Issuer identification number of the card. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + /// The name of the card's issuing bank. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// The last four digits of the card. + pub last4: String, + /// Contains information about card networks that can be used to process the payment. + pub networks: Option, + /// Contains details on how this Card may be used for 3D Secure authentication. + pub three_d_secure_usage: Option, + /// If this Card is part of a card wallet, this contains the details of the card wallet. + pub wallet: Option, +} diff --git a/stripe_types/src/generated/payment_method_card_checks/mod.rs b/stripe_types/src/generated/payment_method_card_checks/mod.rs new file mode 100644 index 000000000..4d44d424b --- /dev/null +++ b/stripe_types/src/generated/payment_method_card_checks/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardChecks { + /// If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub address_line1_check: Option, + /// If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub address_postal_code_check: Option, + /// If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub cvc_check: Option, +} diff --git a/stripe_types/src/generated/payment_method_card_present/mod.rs b/stripe_types/src/generated/payment_method_card_present/mod.rs new file mode 100644 index 000000000..111baa7d2 --- /dev/null +++ b/stripe_types/src/generated/payment_method_card_present/mod.rs @@ -0,0 +1,120 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardPresent { + /// Card brand. + /// + /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub brand: Option, + /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. + /// + /// May include alphanumeric characters, special characters and first/last name separator (`/`). + /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card. + /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + pub cardholder_name: Option, + /// Two-letter ISO code representing the country of the card. + /// + /// You could use this attribute to get a sense of the international breakdown of cards you've collected. + pub country: Option, + /// A high-level description of the type of cards issued in this range. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Two-digit number representing the card's expiration month. + pub exp_month: i64, + /// Four-digit number representing the card's expiration year. + pub exp_year: i64, + /// Uniquely identifies this particular card number. + /// + /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. + /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. + pub fingerprint: Option, + /// Card funding type. + /// + /// Can be `credit`, `debit`, `prepaid`, or `unknown`. + pub funding: Option, + /// Issuer identification number of the card. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + /// The name of the card's issuing bank. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// The last four digits of the card. + pub last4: Option, + /// Contains information about card networks that can be used to process the payment. + pub networks: Option, + /// How card details were read in this transaction. + pub read_method: Option, +} +/// How card details were read in this transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodCardPresentReadMethod { + ContactEmv, + ContactlessEmv, + ContactlessMagstripeMode, + MagneticStripeFallback, + MagneticStripeTrack2, +} +impl PaymentMethodCardPresentReadMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodCardPresentReadMethod::*; + match self { + ContactEmv => "contact_emv", + ContactlessEmv => "contactless_emv", + ContactlessMagstripeMode => "contactless_magstripe_mode", + MagneticStripeFallback => "magnetic_stripe_fallback", + MagneticStripeTrack2 => "magnetic_stripe_track2", + } + } +} + +impl std::str::FromStr for PaymentMethodCardPresentReadMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodCardPresentReadMethod::*; + match s { + "contact_emv" => Ok(ContactEmv), + "contactless_emv" => Ok(ContactlessEmv), + "contactless_magstripe_mode" => Ok(ContactlessMagstripeMode), + "magnetic_stripe_fallback" => Ok(MagneticStripeFallback), + "magnetic_stripe_track2" => Ok(MagneticStripeTrack2), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodCardPresentReadMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodCardPresentReadMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodCardPresentReadMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodCardPresentReadMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodCardPresentReadMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodCardPresentReadMethod") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_card_present_networks/mod.rs b/stripe_types/src/generated/payment_method_card_present_networks/mod.rs new file mode 100644 index 000000000..6385e724c --- /dev/null +++ b/stripe_types/src/generated/payment_method_card_present_networks/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardPresentNetworks { + /// All available networks for the card. + pub available: Vec, + /// The preferred network for the card. + pub preferred: Option, +} diff --git a/stripe_types/src/generated/payment_method_card_wallet/mod.rs b/stripe_types/src/generated/payment_method_card_wallet/mod.rs new file mode 100644 index 000000000..9059647e5 --- /dev/null +++ b/stripe_types/src/generated/payment_method_card_wallet/mod.rs @@ -0,0 +1,102 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardWallet { + #[serde(skip_serializing_if = "Option::is_none")] + pub amex_express_checkout: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub apple_pay: Option, + /// (For tokenized numbers only.) The last four digits of the device account number. + pub dynamic_last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub google_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub masterpass: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub samsung_pay: Option, + /// The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. + /// + /// An additional hash is included on the Wallet subhash with a name matching this value. + /// It contains additional information specific to the card wallet type. + #[serde(rename = "type")] + pub type_: PaymentMethodCardWalletType, + #[serde(skip_serializing_if = "Option::is_none")] + pub visa_checkout: Option, +} +/// The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. +/// +/// An additional hash is included on the Wallet subhash with a name matching this value. +/// It contains additional information specific to the card wallet type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodCardWalletType { + AmexExpressCheckout, + ApplePay, + GooglePay, + Link, + Masterpass, + SamsungPay, + VisaCheckout, +} +impl PaymentMethodCardWalletType { + pub fn as_str(self) -> &'static str { + use PaymentMethodCardWalletType::*; + match self { + AmexExpressCheckout => "amex_express_checkout", + ApplePay => "apple_pay", + GooglePay => "google_pay", + Link => "link", + Masterpass => "masterpass", + SamsungPay => "samsung_pay", + VisaCheckout => "visa_checkout", + } + } +} + +impl std::str::FromStr for PaymentMethodCardWalletType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodCardWalletType::*; + match s { + "amex_express_checkout" => Ok(AmexExpressCheckout), + "apple_pay" => Ok(ApplePay), + "google_pay" => Ok(GooglePay), + "link" => Ok(Link), + "masterpass" => Ok(Masterpass), + "samsung_pay" => Ok(SamsungPay), + "visa_checkout" => Ok(VisaCheckout), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodCardWalletType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodCardWalletType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodCardWalletType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodCardWalletType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodCardWalletType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PaymentMethodCardWalletType")) + } +} diff --git a/stripe_types/src/generated/payment_method_card_wallet_amex_express_checkout/mod.rs b/stripe_types/src/generated/payment_method_card_wallet_amex_express_checkout/mod.rs new file mode 100644 index 000000000..e96dafb68 --- /dev/null +++ b/stripe_types/src/generated/payment_method_card_wallet_amex_express_checkout/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardWalletAmexExpressCheckout {} diff --git a/stripe_types/src/generated/payment_method_card_wallet_apple_pay/mod.rs b/stripe_types/src/generated/payment_method_card_wallet_apple_pay/mod.rs new file mode 100644 index 000000000..9948e0e45 --- /dev/null +++ b/stripe_types/src/generated/payment_method_card_wallet_apple_pay/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardWalletApplePay {} diff --git a/stripe_types/src/generated/payment_method_card_wallet_google_pay/mod.rs b/stripe_types/src/generated/payment_method_card_wallet_google_pay/mod.rs new file mode 100644 index 000000000..c7282dd73 --- /dev/null +++ b/stripe_types/src/generated/payment_method_card_wallet_google_pay/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardWalletGooglePay {} diff --git a/stripe_types/src/generated/payment_method_card_wallet_link/mod.rs b/stripe_types/src/generated/payment_method_card_wallet_link/mod.rs new file mode 100644 index 000000000..ba0b9d736 --- /dev/null +++ b/stripe_types/src/generated/payment_method_card_wallet_link/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardWalletLink {} diff --git a/stripe_types/src/generated/payment_method_card_wallet_masterpass/mod.rs b/stripe_types/src/generated/payment_method_card_wallet_masterpass/mod.rs new file mode 100644 index 000000000..ea268458a --- /dev/null +++ b/stripe_types/src/generated/payment_method_card_wallet_masterpass/mod.rs @@ -0,0 +1,23 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardWalletMasterpass { + /// Owner's verified billing address. + /// + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub billing_address: Option, + /// Owner's verified email. + /// + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub email: Option, + /// Owner's verified full name. + /// + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub name: Option, + /// Owner's verified shipping address. + /// + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub shipping_address: Option, +} diff --git a/stripe_types/src/generated/payment_method_card_wallet_samsung_pay/mod.rs b/stripe_types/src/generated/payment_method_card_wallet_samsung_pay/mod.rs new file mode 100644 index 000000000..e015c6843 --- /dev/null +++ b/stripe_types/src/generated/payment_method_card_wallet_samsung_pay/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardWalletSamsungPay {} diff --git a/stripe_types/src/generated/payment_method_card_wallet_visa_checkout/mod.rs b/stripe_types/src/generated/payment_method_card_wallet_visa_checkout/mod.rs new file mode 100644 index 000000000..7659803c6 --- /dev/null +++ b/stripe_types/src/generated/payment_method_card_wallet_visa_checkout/mod.rs @@ -0,0 +1,23 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardWalletVisaCheckout { + /// Owner's verified billing address. + /// + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub billing_address: Option, + /// Owner's verified email. + /// + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub email: Option, + /// Owner's verified full name. + /// + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub name: Option, + /// Owner's verified shipping address. + /// + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub shipping_address: Option, +} diff --git a/stripe_types/src/generated/payment_method_cashapp/mod.rs b/stripe_types/src/generated/payment_method_cashapp/mod.rs new file mode 100644 index 000000000..f2d838cc6 --- /dev/null +++ b/stripe_types/src/generated/payment_method_cashapp/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCashapp { + /// A unique and immutable identifier assigned by Cash App to every buyer. + pub buyer_id: Option, + /// A public identifier for buyers using Cash App. + pub cashtag: Option, +} diff --git a/stripe_types/src/generated/payment_method_config_biz_payment_method_configuration_details/mod.rs b/stripe_types/src/generated/payment_method_config_biz_payment_method_configuration_details/mod.rs new file mode 100644 index 000000000..58c432f62 --- /dev/null +++ b/stripe_types/src/generated/payment_method_config_biz_payment_method_configuration_details/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodConfigBizPaymentMethodConfigurationDetails { + /// ID of the payment method configuration used. + pub id: String, + /// ID of the parent payment method configuration used. + pub parent: Option, +} diff --git a/stripe_types/src/generated/payment_method_customer_balance/mod.rs b/stripe_types/src/generated/payment_method_customer_balance/mod.rs new file mode 100644 index 000000000..6e1cd2152 --- /dev/null +++ b/stripe_types/src/generated/payment_method_customer_balance/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCustomerBalance {} diff --git a/stripe_types/src/generated/payment_method_details/mod.rs b/stripe_types/src/generated/payment_method_details/mod.rs new file mode 100644 index 000000000..abe482821 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details/mod.rs @@ -0,0 +1,88 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub ach_credit_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ach_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_credit_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub stripe_account: Option, + /// The type of transaction-specific details of the payment method used in the payment, one of `ach_credit_transfer`, `ach_debit`, `acss_debit`, `alipay`, `au_becs_debit`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `klarna`, `multibanco`, `p24`, `sepa_debit`, `sofort`, `stripe_account`, or `wechat`. + /// An additional hash is included on `payment_method_details` with a name matching this value. + /// It contains information specific to the payment method. + #[serde(rename = "type")] + pub type_: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_ach_credit_transfer/mod.rs b/stripe_types/src/generated/payment_method_details_ach_credit_transfer/mod.rs new file mode 100644 index 000000000..be72e0222 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_ach_credit_transfer/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsAchCreditTransfer { + /// Account number to transfer funds to. + pub account_number: Option, + /// Name of the bank associated with the routing number. + pub bank_name: Option, + /// Routing transit number for the bank account to transfer funds to. + pub routing_number: Option, + /// SWIFT code of the bank associated with the routing number. + pub swift_code: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_ach_debit/mod.rs b/stripe_types/src/generated/payment_method_details_ach_debit/mod.rs new file mode 100644 index 000000000..f1387ffcc --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_ach_debit/mod.rs @@ -0,0 +1,83 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsAchDebit { + /// Type of entity that holds the account. + /// + /// This can be either `individual` or `company`. + pub account_holder_type: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Two-letter ISO code representing the country the bank account is located in. + pub country: Option, + /// Uniquely identifies this particular bank account. + /// + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// Routing transit number of the bank account. + pub routing_number: Option, +} +/// Type of entity that holds the account. +/// +/// This can be either `individual` or `company`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsAchDebitAccountHolderType { + Company, + Individual, +} +impl PaymentMethodDetailsAchDebitAccountHolderType { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsAchDebitAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsAchDebitAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsAchDebitAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsAchDebitAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsAchDebitAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsAchDebitAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsAchDebitAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsAchDebitAccountHolderType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsAchDebitAccountHolderType", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_details_acss_debit/mod.rs b/stripe_types/src/generated/payment_method_details_acss_debit/mod.rs new file mode 100644 index 000000000..04a9aa9de --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_acss_debit/mod.rs @@ -0,0 +1,18 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsAcssDebit { + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Uniquely identifies this particular bank account. + /// + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Institution number of the bank account. + pub institution_number: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// ID of the mandate used to make this payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate: Option, + /// Transit number of the bank account. + pub transit_number: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_affirm/mod.rs b/stripe_types/src/generated/payment_method_details_affirm/mod.rs new file mode 100644 index 000000000..e88966e31 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_affirm/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsAffirm {} diff --git a/stripe_types/src/generated/payment_method_details_afterpay_clearpay/mod.rs b/stripe_types/src/generated/payment_method_details_afterpay_clearpay/mod.rs new file mode 100644 index 000000000..a03a3296f --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_afterpay_clearpay/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsAfterpayClearpay { + /// The Afterpay order ID associated with this payment intent. + pub order_id: Option, + /// Order identifier shown to the merchant in Afterpay’s online portal. + pub reference: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_au_becs_debit/mod.rs b/stripe_types/src/generated/payment_method_details_au_becs_debit/mod.rs new file mode 100644 index 000000000..ef4074e06 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_au_becs_debit/mod.rs @@ -0,0 +1,14 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsAuBecsDebit { + /// Bank-State-Branch number of the bank account. + pub bsb_number: Option, + /// Uniquely identifies this particular bank account. + /// + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// ID of the mandate used to make this payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_bacs_debit/mod.rs b/stripe_types/src/generated/payment_method_details_bacs_debit/mod.rs new file mode 100644 index 000000000..2e8971bd6 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_bacs_debit/mod.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsBacsDebit { + /// Uniquely identifies this particular bank account. + /// + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// ID of the mandate used to make this payment. + pub mandate: Option, + /// Sort code of the bank account. + /// + /// (e.g., `10-20-30`). + pub sort_code: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_bancontact/mod.rs b/stripe_types/src/generated/payment_method_details_bancontact/mod.rs new file mode 100644 index 000000000..59754a2df --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_bancontact/mod.rs @@ -0,0 +1,92 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsBancontact { + /// Bank code of bank associated with the bank account. + pub bank_code: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Bank Identifier Code of the bank associated with the bank account. + pub bic: Option, + /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + pub generated_sepa_debit: Option>, + /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + pub generated_sepa_debit_mandate: Option>, + /// Last four characters of the IBAN. + pub iban_last4: Option, + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + /// Can be one of `en`, `de`, `fr`, or `nl`. + pub preferred_language: Option, + /// Owner's verified full name. + /// + /// Values are verified or provided by Bancontact directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub verified_name: Option, +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +/// Can be one of `en`, `de`, `fr`, or `nl`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl PaymentMethodDetailsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsBancontactPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsBancontactPreferredLanguage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsBancontactPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsBancontactPreferredLanguage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsBancontactPreferredLanguage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_details_blik/mod.rs b/stripe_types/src/generated/payment_method_details_blik/mod.rs new file mode 100644 index 000000000..d19223ff9 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_blik/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsBlik {} diff --git a/stripe_types/src/generated/payment_method_details_boleto/mod.rs b/stripe_types/src/generated/payment_method_details_boleto/mod.rs new file mode 100644 index 000000000..25cd594f2 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_boleto/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsBoleto { + /// The tax ID of the customer (CPF for individuals consumers or CNPJ for businesses consumers). + pub tax_id: String, +} diff --git a/stripe_types/src/generated/payment_method_details_card/mod.rs b/stripe_types/src/generated/payment_method_details_card/mod.rs new file mode 100644 index 000000000..38f02a1a3 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_card/mod.rs @@ -0,0 +1,78 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCard { + /// The authorized amount. +pub amount_authorized: Option, + /// Card brand. + /// + /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. +pub brand: Option, + /// When using manual capture, a future timestamp at which the charge will be automatically refunded if uncaptured. +#[serde(skip_serializing_if = "Option::is_none")] +pub capture_before: Option, + /// Check results by Card networks on Card address and CVC at time of payment. +pub checks: Option, + /// Two-letter ISO code representing the country of the card. + /// + /// You could use this attribute to get a sense of the international breakdown of cards you've collected. +pub country: Option, + /// A high-level description of the type of cards issued in this range. + /// + /// (For internal use only and not typically available in standard API requests.). +#[serde(skip_serializing_if = "Option::is_none")] +pub description: Option, + /// Two-digit number representing the card's expiration month. +pub exp_month: i64, + /// Four-digit number representing the card's expiration year. +pub exp_year: i64, +#[serde(skip_serializing_if = "Option::is_none")] +pub extended_authorization: Option, + /// Uniquely identifies this particular card number. + /// + /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. + /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. +#[serde(skip_serializing_if = "Option::is_none")] +pub fingerprint: Option, + /// Card funding type. + /// + /// Can be `credit`, `debit`, `prepaid`, or `unknown`. +pub funding: Option, + /// Issuer identification number of the card. + /// + /// (For internal use only and not typically available in standard API requests.). +#[serde(skip_serializing_if = "Option::is_none")] +pub iin: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub incremental_authorization: Option, + /// Installment details for this payment (Mexico only). + /// + /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). +pub installments: Option, + /// The name of the card's issuing bank. + /// + /// (For internal use only and not typically available in standard API requests.). +#[serde(skip_serializing_if = "Option::is_none")] +pub issuer: Option, + /// The last four digits of the card. +pub last4: Option, + /// ID of the mandate used to make this payment or created by it. +pub mandate: Option, + /// True if this payment was marked as MOTO and out of scope for SCA. +#[serde(skip_serializing_if = "Option::is_none")] +pub moto: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub multicapture: Option, + /// Identifies which network this charge was processed on. + /// + /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. +pub network: Option, + /// If this card has network token credentials, this contains the details of the network token credentials. +#[serde(skip_serializing_if = "Option::is_none")] +pub network_token: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub overcapture: Option, + /// Populated if this transaction used 3D Secure authentication. +pub three_d_secure: Option, + /// If this Card is part of a card wallet, this contains the details of the card wallet. +pub wallet: Option, + +} diff --git a/stripe_types/src/generated/payment_method_details_card_checks/mod.rs b/stripe_types/src/generated/payment_method_details_card_checks/mod.rs new file mode 100644 index 000000000..3f0d16aff --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_card_checks/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardChecks { + /// If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub address_line1_check: Option, + /// If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub address_postal_code_check: Option, + /// If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub cvc_check: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_card_installments/mod.rs b/stripe_types/src/generated/payment_method_details_card_installments/mod.rs new file mode 100644 index 000000000..b234ba1b0 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_card_installments/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardInstallments { + /// Installment plan selected for the payment. + pub plan: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_card_installments_plan/mod.rs b/stripe_types/src/generated/payment_method_details_card_installments_plan/mod.rs new file mode 100644 index 000000000..6d9f8c8bb --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_card_installments_plan/mod.rs @@ -0,0 +1,130 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardInstallmentsPlan { + /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + pub count: Option, + /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + /// One of `month`. + pub interval: Option, + /// Type of installment plan, one of `fixed_count`. + #[serde(rename = "type")] + pub type_: PaymentMethodDetailsCardInstallmentsPlanType, +} +/// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. +/// One of `month`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsCardInstallmentsPlanInterval { + Month, +} +impl PaymentMethodDetailsCardInstallmentsPlanInterval { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsCardInstallmentsPlanInterval::*; + match self { + Month => "month", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsCardInstallmentsPlanInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsCardInstallmentsPlanInterval::*; + match s { + "month" => Ok(Month), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsCardInstallmentsPlanInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsCardInstallmentsPlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsCardInstallmentsPlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsCardInstallmentsPlanInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsCardInstallmentsPlanInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsCardInstallmentsPlanInterval", + ) + }) + } +} +/// Type of installment plan, one of `fixed_count`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsCardInstallmentsPlanType { + FixedCount, +} +impl PaymentMethodDetailsCardInstallmentsPlanType { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsCardInstallmentsPlanType::*; + match self { + FixedCount => "fixed_count", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsCardInstallmentsPlanType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsCardInstallmentsPlanType::*; + match s { + "fixed_count" => Ok(FixedCount), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsCardInstallmentsPlanType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsCardInstallmentsPlanType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsCardInstallmentsPlanType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsCardInstallmentsPlanType", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_details_card_network_token/mod.rs b/stripe_types/src/generated/payment_method_details_card_network_token/mod.rs new file mode 100644 index 000000000..14178b946 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_card_network_token/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardNetworkToken { + /// Indicates if Stripe used a network token, either user provided or Stripe managed when processing the transaction. + pub used: bool, +} diff --git a/stripe_types/src/generated/payment_method_details_card_present/mod.rs b/stripe_types/src/generated/payment_method_details_card_present/mod.rs new file mode 100644 index 000000000..d15611895 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_card_present/mod.rs @@ -0,0 +1,145 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardPresent { + /// The authorized amount. + pub amount_authorized: Option, + /// Card brand. + /// + /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub brand: Option, + /// When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_before: Option, + /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. + /// + /// May include alphanumeric characters, special characters and first/last name separator (`/`). + /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card. + /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + pub cardholder_name: Option, + /// Two-letter ISO code representing the country of the card. + /// + /// You could use this attribute to get a sense of the international breakdown of cards you've collected. + pub country: Option, + /// A high-level description of the type of cards issued in this range. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Authorization response cryptogram. + pub emv_auth_data: Option, + /// Two-digit number representing the card's expiration month. + pub exp_month: i64, + /// Four-digit number representing the card's expiration year. + pub exp_year: i64, + /// Uniquely identifies this particular card number. + /// + /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. + /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. + pub fingerprint: Option, + /// Card funding type. + /// + /// Can be `credit`, `debit`, `prepaid`, or `unknown`. + pub funding: Option, + /// ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. + /// + /// Only present if it was possible to generate a card PaymentMethod. + pub generated_card: Option, + /// Issuer identification number of the card. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + /// Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. + /// + /// Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support). + pub incremental_authorization_supported: bool, + /// The name of the card's issuing bank. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// The last four digits of the card. + pub last4: Option, + /// Identifies which network this charge was processed on. + /// + /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub network: Option, + /// Details about payments collected offline. + pub offline: Option, + /// Defines whether the authorized amount can be over-captured or not. + pub overcapture_supported: bool, + /// How card details were read in this transaction. + pub read_method: Option, + /// A collection of fields required to be displayed on receipts. + /// + /// Only required for EMV transactions. + pub receipt: Option, +} +/// How card details were read in this transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsCardPresentReadMethod { + ContactEmv, + ContactlessEmv, + ContactlessMagstripeMode, + MagneticStripeFallback, + MagneticStripeTrack2, +} +impl PaymentMethodDetailsCardPresentReadMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsCardPresentReadMethod::*; + match self { + ContactEmv => "contact_emv", + ContactlessEmv => "contactless_emv", + ContactlessMagstripeMode => "contactless_magstripe_mode", + MagneticStripeFallback => "magnetic_stripe_fallback", + MagneticStripeTrack2 => "magnetic_stripe_track2", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsCardPresentReadMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsCardPresentReadMethod::*; + match s { + "contact_emv" => Ok(ContactEmv), + "contactless_emv" => Ok(ContactlessEmv), + "contactless_magstripe_mode" => Ok(ContactlessMagstripeMode), + "magnetic_stripe_fallback" => Ok(MagneticStripeFallback), + "magnetic_stripe_track2" => Ok(MagneticStripeTrack2), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsCardPresentReadMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsCardPresentReadMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsCardPresentReadMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsCardPresentReadMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsCardPresentReadMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodDetailsCardPresentReadMethod") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_details_card_present_offline/mod.rs b/stripe_types/src/generated/payment_method_details_card_present_offline/mod.rs new file mode 100644 index 000000000..a8a1622d7 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_card_present_offline/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardPresentOffline { + /// Time at which the payment was collected while offline. + pub stored_at: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_card_present_receipt/mod.rs b/stripe_types/src/generated/payment_method_details_card_present_receipt/mod.rs new file mode 100644 index 000000000..904106519 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_card_present_receipt/mod.rs @@ -0,0 +1,94 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardPresentReceipt { + /// The type of account being debited or credited. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// EMV tag 9F26, cryptogram generated by the integrated circuit chip. + pub application_cryptogram: Option, + /// Mnenomic of the Application Identifier. + pub application_preferred_name: Option, + /// Identifier for this transaction. + pub authorization_code: Option, + /// EMV tag 8A. + /// + /// A code returned by the card issuer. + pub authorization_response_code: Option, + /// How the cardholder verified ownership of the card. + pub cardholder_verification_method: Option, + /// EMV tag 84. + /// + /// Similar to the application identifier stored on the integrated circuit chip. + pub dedicated_file_name: Option, + /// The outcome of a series of EMV functions performed by the card reader. + pub terminal_verification_results: Option, + /// An indication of various EMV functions performed during the transaction. + pub transaction_status_information: Option, +} +/// The type of account being debited or credited. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsCardPresentReceiptAccountType { + Checking, + Credit, + Prepaid, + Unknown, +} +impl PaymentMethodDetailsCardPresentReceiptAccountType { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsCardPresentReceiptAccountType::*; + match self { + Checking => "checking", + Credit => "credit", + Prepaid => "prepaid", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsCardPresentReceiptAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsCardPresentReceiptAccountType::*; + match s { + "checking" => Ok(Checking), + "credit" => Ok(Credit), + "prepaid" => Ok(Prepaid), + "unknown" => Ok(Unknown), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsCardPresentReceiptAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsCardPresentReceiptAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsCardPresentReceiptAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsCardPresentReceiptAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsCardPresentReceiptAccountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsCardPresentReceiptAccountType", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_details_card_wallet/mod.rs b/stripe_types/src/generated/payment_method_details_card_wallet/mod.rs new file mode 100644 index 000000000..4581b0d14 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_card_wallet/mod.rs @@ -0,0 +1,104 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardWallet { + #[serde(skip_serializing_if = "Option::is_none")] + pub amex_express_checkout: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub apple_pay: Option, + /// (For tokenized numbers only.) The last four digits of the device account number. + pub dynamic_last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub google_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub masterpass: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub samsung_pay: Option, + /// The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. + /// + /// An additional hash is included on the Wallet subhash with a name matching this value. + /// It contains additional information specific to the card wallet type. + #[serde(rename = "type")] + pub type_: PaymentMethodDetailsCardWalletType, + #[serde(skip_serializing_if = "Option::is_none")] + pub visa_checkout: Option, +} +/// The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. +/// +/// An additional hash is included on the Wallet subhash with a name matching this value. +/// It contains additional information specific to the card wallet type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsCardWalletType { + AmexExpressCheckout, + ApplePay, + GooglePay, + Link, + Masterpass, + SamsungPay, + VisaCheckout, +} +impl PaymentMethodDetailsCardWalletType { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsCardWalletType::*; + match self { + AmexExpressCheckout => "amex_express_checkout", + ApplePay => "apple_pay", + GooglePay => "google_pay", + Link => "link", + Masterpass => "masterpass", + SamsungPay => "samsung_pay", + VisaCheckout => "visa_checkout", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsCardWalletType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsCardWalletType::*; + match s { + "amex_express_checkout" => Ok(AmexExpressCheckout), + "apple_pay" => Ok(ApplePay), + "google_pay" => Ok(GooglePay), + "link" => Ok(Link), + "masterpass" => Ok(Masterpass), + "samsung_pay" => Ok(SamsungPay), + "visa_checkout" => Ok(VisaCheckout), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsCardWalletType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsCardWalletType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsCardWalletType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsCardWalletType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsCardWalletType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodDetailsCardWalletType") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_details_card_wallet_amex_express_checkout/mod.rs b/stripe_types/src/generated/payment_method_details_card_wallet_amex_express_checkout/mod.rs new file mode 100644 index 000000000..d6bb316e9 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_card_wallet_amex_express_checkout/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardWalletAmexExpressCheckout {} diff --git a/stripe_types/src/generated/payment_method_details_card_wallet_apple_pay/mod.rs b/stripe_types/src/generated/payment_method_details_card_wallet_apple_pay/mod.rs new file mode 100644 index 000000000..7acbfb6e3 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_card_wallet_apple_pay/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardWalletApplePay {} diff --git a/stripe_types/src/generated/payment_method_details_card_wallet_google_pay/mod.rs b/stripe_types/src/generated/payment_method_details_card_wallet_google_pay/mod.rs new file mode 100644 index 000000000..6695fbe5f --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_card_wallet_google_pay/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardWalletGooglePay {} diff --git a/stripe_types/src/generated/payment_method_details_card_wallet_link/mod.rs b/stripe_types/src/generated/payment_method_details_card_wallet_link/mod.rs new file mode 100644 index 000000000..873024f1d --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_card_wallet_link/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardWalletLink {} diff --git a/stripe_types/src/generated/payment_method_details_card_wallet_masterpass/mod.rs b/stripe_types/src/generated/payment_method_details_card_wallet_masterpass/mod.rs new file mode 100644 index 000000000..9e1c73ea1 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_card_wallet_masterpass/mod.rs @@ -0,0 +1,23 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardWalletMasterpass { + /// Owner's verified billing address. + /// + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub billing_address: Option, + /// Owner's verified email. + /// + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub email: Option, + /// Owner's verified full name. + /// + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub name: Option, + /// Owner's verified shipping address. + /// + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub shipping_address: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_card_wallet_samsung_pay/mod.rs b/stripe_types/src/generated/payment_method_details_card_wallet_samsung_pay/mod.rs new file mode 100644 index 000000000..cca8ef217 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_card_wallet_samsung_pay/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardWalletSamsungPay {} diff --git a/stripe_types/src/generated/payment_method_details_card_wallet_visa_checkout/mod.rs b/stripe_types/src/generated/payment_method_details_card_wallet_visa_checkout/mod.rs new file mode 100644 index 000000000..e4c2a1e6a --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_card_wallet_visa_checkout/mod.rs @@ -0,0 +1,23 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardWalletVisaCheckout { + /// Owner's verified billing address. + /// + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub billing_address: Option, + /// Owner's verified email. + /// + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub email: Option, + /// Owner's verified full name. + /// + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub name: Option, + /// Owner's verified shipping address. + /// + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub shipping_address: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_cashapp/mod.rs b/stripe_types/src/generated/payment_method_details_cashapp/mod.rs new file mode 100644 index 000000000..86783959f --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_cashapp/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCashapp { + /// A unique and immutable identifier assigned by Cash App to every buyer. + pub buyer_id: Option, + /// A public identifier for buyers using Cash App. + pub cashtag: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_customer_balance/mod.rs b/stripe_types/src/generated/payment_method_details_customer_balance/mod.rs new file mode 100644 index 000000000..14673643c --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_customer_balance/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCustomerBalance {} diff --git a/stripe_types/src/generated/payment_method_details_eps/mod.rs b/stripe_types/src/generated/payment_method_details_eps/mod.rs new file mode 100644 index 000000000..0f4af5708 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_eps/mod.rs @@ -0,0 +1,154 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsEps { + /// The customer's bank. + /// + /// Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. + pub bank: Option, + /// Owner's verified full name. + /// + /// Values are verified or provided by EPS directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. EPS rarely provides this information so the attribute is usually empty. + pub verified_name: Option, +} +/// The customer's bank. +/// +/// Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodDetailsEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodDetailsEpsBank { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsEpsBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsEpsBank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodDetailsEpsBank::Unknown)) + } +} diff --git a/stripe_types/src/generated/payment_method_details_fpx/mod.rs b/stripe_types/src/generated/payment_method_details_fpx/mod.rs new file mode 100644 index 000000000..353036c36 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_fpx/mod.rs @@ -0,0 +1,199 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsFpx { + /// Account holder type, if provided. + /// + /// Can be one of `individual` or `company`. + pub account_holder_type: Option, + /// The customer's bank. + /// + /// Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + pub bank: PaymentMethodDetailsFpxBank, + /// Unique transaction id generated by FPX for every request from the merchant. + pub transaction_id: Option, +} +/// Account holder type, if provided. +/// +/// Can be one of `individual` or `company`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsFpxAccountHolderType { + Company, + Individual, +} +impl PaymentMethodDetailsFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsFpxAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsFpxAccountHolderType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodDetailsFpxAccountHolderType") + }) + } +} +/// The customer's bank. +/// +/// Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodDetailsFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodDetailsFpxBank { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsFpxBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsFpxBank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodDetailsFpxBank::Unknown)) + } +} diff --git a/stripe_types/src/generated/payment_method_details_giropay/mod.rs b/stripe_types/src/generated/payment_method_details_giropay/mod.rs new file mode 100644 index 000000000..859f62f13 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_giropay/mod.rs @@ -0,0 +1,14 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsGiropay { + /// Bank code of bank associated with the bank account. + pub bank_code: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Bank Identifier Code of the bank associated with the bank account. + pub bic: Option, + /// Owner's verified full name. + /// + /// Values are verified or provided by Giropay directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. Giropay rarely provides this information so the attribute is usually empty. + pub verified_name: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_grabpay/mod.rs b/stripe_types/src/generated/payment_method_details_grabpay/mod.rs new file mode 100644 index 000000000..7abe8be96 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_grabpay/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsGrabpay { + /// Unique transaction id generated by GrabPay. + pub transaction_id: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_ideal/mod.rs b/stripe_types/src/generated/payment_method_details_ideal/mod.rs new file mode 100644 index 000000000..3599bae0b --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_ideal/mod.rs @@ -0,0 +1,227 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsIdeal { + /// The customer's bank. + /// + /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + pub bank: Option, + /// The Bank Identifier Code of the customer's bank. + pub bic: Option, + /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + pub generated_sepa_debit: Option>, + /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + pub generated_sepa_debit_mandate: Option>, + /// Last four characters of the IBAN. + pub iban_last4: Option, + /// Owner's verified full name. + /// + /// Values are verified or provided by iDEAL directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub verified_name: Option, +} +/// The customer's bank. +/// +/// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodDetailsIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodDetailsIdealBank { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsIdealBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsIdealBank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodDetailsIdealBank::Unknown)) + } +} +/// The Bank Identifier Code of the customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodDetailsIdealBic { + Abnanl2a, + Asnbnl21, + Bitsnl2a, + Bunqnl2a, + Fvlbnl22, + Handnl2a, + Ingbnl2a, + Knabnl2h, + Moyonl21, + Ntsbdeb1, + Rabonl2u, + Rbrbnl21, + Revoie23, + Revolt21, + Snsbnl2a, + Trionl2u, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodDetailsIdealBic { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsIdealBic::*; + match self { + Abnanl2a => "ABNANL2A", + Asnbnl21 => "ASNBNL21", + Bitsnl2a => "BITSNL2A", + Bunqnl2a => "BUNQNL2A", + Fvlbnl22 => "FVLBNL22", + Handnl2a => "HANDNL2A", + Ingbnl2a => "INGBNL2A", + Knabnl2h => "KNABNL2H", + Moyonl21 => "MOYONL21", + Ntsbdeb1 => "NTSBDEB1", + Rabonl2u => "RABONL2U", + Rbrbnl21 => "RBRBNL21", + Revoie23 => "REVOIE23", + Revolt21 => "REVOLT21", + Snsbnl2a => "SNSBNL2A", + Trionl2u => "TRIONL2U", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsIdealBic { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsIdealBic::*; + match s { + "ABNANL2A" => Ok(Abnanl2a), + "ASNBNL21" => Ok(Asnbnl21), + "BITSNL2A" => Ok(Bitsnl2a), + "BUNQNL2A" => Ok(Bunqnl2a), + "FVLBNL22" => Ok(Fvlbnl22), + "HANDNL2A" => Ok(Handnl2a), + "INGBNL2A" => Ok(Ingbnl2a), + "KNABNL2H" => Ok(Knabnl2h), + "MOYONL21" => Ok(Moyonl21), + "NTSBDEB1" => Ok(Ntsbdeb1), + "RABONL2U" => Ok(Rabonl2u), + "RBRBNL21" => Ok(Rbrbnl21), + "REVOIE23" => Ok(Revoie23), + "REVOLT21" => Ok(Revolt21), + "SNSBNL2A" => Ok(Snsbnl2a), + "TRIONL2U" => Ok(Trionl2u), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsIdealBic { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsIdealBic { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsIdealBic { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsIdealBic { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsIdealBic { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodDetailsIdealBic::Unknown)) + } +} diff --git a/stripe_types/src/generated/payment_method_details_interac_present/mod.rs b/stripe_types/src/generated/payment_method_details_interac_present/mod.rs new file mode 100644 index 000000000..8cb95dd50 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_interac_present/mod.rs @@ -0,0 +1,138 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsInteracPresent { + /// Card brand. + /// + /// Can be `interac`, `mastercard` or `visa`. + pub brand: Option, + /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. + /// + /// May include alphanumeric characters, special characters and first/last name separator (`/`). + /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card. + /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + pub cardholder_name: Option, + /// Two-letter ISO code representing the country of the card. + /// + /// You could use this attribute to get a sense of the international breakdown of cards you've collected. + pub country: Option, + /// A high-level description of the type of cards issued in this range. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Authorization response cryptogram. + pub emv_auth_data: Option, + /// Two-digit number representing the card's expiration month. + pub exp_month: i64, + /// Four-digit number representing the card's expiration year. + pub exp_year: i64, + /// Uniquely identifies this particular card number. + /// + /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. + /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. + pub fingerprint: Option, + /// Card funding type. + /// + /// Can be `credit`, `debit`, `prepaid`, or `unknown`. + pub funding: Option, + /// ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. + /// + /// Only present if it was possible to generate a card PaymentMethod. + pub generated_card: Option, + /// Issuer identification number of the card. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + /// The name of the card's issuing bank. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// The last four digits of the card. + pub last4: Option, + /// Identifies which network this charge was processed on. + /// + /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub network: Option, + /// EMV tag 5F2D. + /// + /// Preferred languages specified by the integrated circuit chip. + pub preferred_locales: Option>, + /// How card details were read in this transaction. + pub read_method: Option, + /// A collection of fields required to be displayed on receipts. + /// + /// Only required for EMV transactions. + pub receipt: Option, +} +/// How card details were read in this transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsInteracPresentReadMethod { + ContactEmv, + ContactlessEmv, + ContactlessMagstripeMode, + MagneticStripeFallback, + MagneticStripeTrack2, +} +impl PaymentMethodDetailsInteracPresentReadMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsInteracPresentReadMethod::*; + match self { + ContactEmv => "contact_emv", + ContactlessEmv => "contactless_emv", + ContactlessMagstripeMode => "contactless_magstripe_mode", + MagneticStripeFallback => "magnetic_stripe_fallback", + MagneticStripeTrack2 => "magnetic_stripe_track2", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsInteracPresentReadMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsInteracPresentReadMethod::*; + match s { + "contact_emv" => Ok(ContactEmv), + "contactless_emv" => Ok(ContactlessEmv), + "contactless_magstripe_mode" => Ok(ContactlessMagstripeMode), + "magnetic_stripe_fallback" => Ok(MagneticStripeFallback), + "magnetic_stripe_track2" => Ok(MagneticStripeTrack2), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsInteracPresentReadMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsInteracPresentReadMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsInteracPresentReadMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsInteracPresentReadMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsInteracPresentReadMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsInteracPresentReadMethod", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_details_interac_present_receipt/mod.rs b/stripe_types/src/generated/payment_method_details_interac_present_receipt/mod.rs new file mode 100644 index 000000000..3600cd0b6 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_interac_present_receipt/mod.rs @@ -0,0 +1,91 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsInteracPresentReceipt { + /// The type of account being debited or credited. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// EMV tag 9F26, cryptogram generated by the integrated circuit chip. + pub application_cryptogram: Option, + /// Mnenomic of the Application Identifier. + pub application_preferred_name: Option, + /// Identifier for this transaction. + pub authorization_code: Option, + /// EMV tag 8A. + /// + /// A code returned by the card issuer. + pub authorization_response_code: Option, + /// How the cardholder verified ownership of the card. + pub cardholder_verification_method: Option, + /// EMV tag 84. + /// + /// Similar to the application identifier stored on the integrated circuit chip. + pub dedicated_file_name: Option, + /// The outcome of a series of EMV functions performed by the card reader. + pub terminal_verification_results: Option, + /// An indication of various EMV functions performed during the transaction. + pub transaction_status_information: Option, +} +/// The type of account being debited or credited. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsInteracPresentReceiptAccountType { + Checking, + Savings, + Unknown, +} +impl PaymentMethodDetailsInteracPresentReceiptAccountType { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsInteracPresentReceiptAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsInteracPresentReceiptAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsInteracPresentReceiptAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + "unknown" => Ok(Unknown), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsInteracPresentReceiptAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsInteracPresentReceiptAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsInteracPresentReceiptAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsInteracPresentReceiptAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsInteracPresentReceiptAccountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsInteracPresentReceiptAccountType", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_details_klarna/mod.rs b/stripe_types/src/generated/payment_method_details_klarna/mod.rs new file mode 100644 index 000000000..12b24c863 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_klarna/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsKlarna { + /// The Klarna payment method used for this transaction. + /// Can be one of `pay_later`, `pay_now`, `pay_with_financing`, or `pay_in_installments`. + pub payment_method_category: Option, + /// Preferred language of the Klarna authorization page that the customer is redirected to. + /// Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, `en-FR`, `cs-CZ`, `en-CZ`, `el-GR`, `en-GR`, `en-AU`, `en-NZ`, `en-CA`, `fr-CA`, `pl-PL`, `en-PL`, `pt-PT`, `en-PT`, `de-CH`, `fr-CH`, `it-CH`, or `en-CH`. + pub preferred_locale: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_konbini/mod.rs b/stripe_types/src/generated/payment_method_details_konbini/mod.rs new file mode 100644 index 000000000..3f4f27a12 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_konbini/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsKonbini { + /// If the payment succeeded, this contains the details of the convenience store where the payment was completed. + pub store: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_konbini_store/mod.rs b/stripe_types/src/generated/payment_method_details_konbini_store/mod.rs new file mode 100644 index 000000000..baef5dfe2 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_konbini_store/mod.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsKonbiniStore { + /// The name of the convenience store chain where the payment was completed. + pub chain: Option, +} +/// The name of the convenience store chain where the payment was completed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsKonbiniStoreChain { + Familymart, + Lawson, + Ministop, + Seicomart, +} +impl PaymentMethodDetailsKonbiniStoreChain { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsKonbiniStoreChain::*; + match self { + Familymart => "familymart", + Lawson => "lawson", + Ministop => "ministop", + Seicomart => "seicomart", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsKonbiniStoreChain { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsKonbiniStoreChain::*; + match s { + "familymart" => Ok(Familymart), + "lawson" => Ok(Lawson), + "ministop" => Ok(Ministop), + "seicomart" => Ok(Seicomart), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsKonbiniStoreChain { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsKonbiniStoreChain { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsKonbiniStoreChain { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsKonbiniStoreChain { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsKonbiniStoreChain { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodDetailsKonbiniStoreChain") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_details_link/mod.rs b/stripe_types/src/generated/payment_method_details_link/mod.rs new file mode 100644 index 000000000..987e76d1d --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_link/mod.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsLink { + /// Two-letter ISO code representing the funding source country beneath the Link payment. + /// You could use this attribute to get a sense of international fees. + pub country: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_multibanco/mod.rs b/stripe_types/src/generated/payment_method_details_multibanco/mod.rs new file mode 100644 index 000000000..3bf8acff6 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_multibanco/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsMultibanco { + /// Entity number associated with this Multibanco payment. + pub entity: Option, + /// Reference number associated with this Multibanco payment. + pub reference: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_oxxo/mod.rs b/stripe_types/src/generated/payment_method_details_oxxo/mod.rs new file mode 100644 index 000000000..19953ae62 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_oxxo/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsOxxo { + /// OXXO reference number. + pub number: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_p24/mod.rs b/stripe_types/src/generated/payment_method_details_p24/mod.rs new file mode 100644 index 000000000..e1565b191 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_p24/mod.rs @@ -0,0 +1,147 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsP24 { + /// The customer's bank. + /// + /// Can be one of `ing`, `citi_handlowy`, `tmobile_usbugi_bankowe`, `plus_bank`, `etransfer_pocztowy24`, `banki_spbdzielcze`, `bank_nowy_bfg_sa`, `getin_bank`, `blik`, `noble_pay`, `ideabank`, `envelobank`, `santander_przelew24`, `nest_przelew`, `mbank_mtransfer`, `inteligo`, `pbac_z_ipko`, `bnp_paribas`, `credit_agricole`, `toyota_bank`, `bank_pekao_sa`, `volkswagen_bank`, `bank_millennium`, `alior_bank`, or `boz`. + pub bank: Option, + /// Unique reference for this Przelewy24 payment. + pub reference: Option, + /// Owner's verified full name. + /// + /// Values are verified or provided by Przelewy24 directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. Przelewy24 rarely provides this information so the attribute is usually empty. + pub verified_name: Option, +} +/// The customer's bank. +/// +/// Can be one of `ing`, `citi_handlowy`, `tmobile_usbugi_bankowe`, `plus_bank`, `etransfer_pocztowy24`, `banki_spbdzielcze`, `bank_nowy_bfg_sa`, `getin_bank`, `blik`, `noble_pay`, `ideabank`, `envelobank`, `santander_przelew24`, `nest_przelew`, `mbank_mtransfer`, `inteligo`, `pbac_z_ipko`, `bnp_paribas`, `credit_agricole`, `toyota_bank`, `bank_pekao_sa`, `volkswagen_bank`, `bank_millennium`, `alior_bank`, or `boz`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodDetailsP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodDetailsP24Bank { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsP24Bank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsP24Bank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodDetailsP24Bank::Unknown)) + } +} diff --git a/stripe_types/src/generated/payment_method_details_paynow/mod.rs b/stripe_types/src/generated/payment_method_details_paynow/mod.rs new file mode 100644 index 000000000..285ff4fb7 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_paynow/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsPaynow { + /// Reference number associated with this PayNow payment. + pub reference: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_paypal/mod.rs b/stripe_types/src/generated/payment_method_details_paypal/mod.rs new file mode 100644 index 000000000..de3e2ecf6 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_paypal/mod.rs @@ -0,0 +1,21 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsPaypal { + /// Owner's email. + /// + /// Values are provided by PayPal directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub payer_email: Option, + /// PayPal account PayerID. + /// + /// This identifier uniquely identifies the PayPal customer. + pub payer_id: Option, + /// Owner's full name. + /// + /// Values provided by PayPal directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub payer_name: Option, + /// The level of protection offered as defined by PayPal Seller Protection for Merchants, for this transaction. + pub seller_protection: Option, + /// A unique ID generated by PayPal for this transaction. + pub transaction_id: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_pix/mod.rs b/stripe_types/src/generated/payment_method_details_pix/mod.rs new file mode 100644 index 000000000..e0c5bd38d --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_pix/mod.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsPix { + /// Unique transaction id generated by BCB. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transaction_id: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_promptpay/mod.rs b/stripe_types/src/generated/payment_method_details_promptpay/mod.rs new file mode 100644 index 000000000..95718c940 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_promptpay/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsPromptpay { + /// Bill reference generated by PromptPay. + pub reference: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_revolut_pay/mod.rs b/stripe_types/src/generated/payment_method_details_revolut_pay/mod.rs new file mode 100644 index 000000000..8207d189c --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_revolut_pay/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsRevolutPay {} diff --git a/stripe_types/src/generated/payment_method_details_sepa_credit_transfer/mod.rs b/stripe_types/src/generated/payment_method_details_sepa_credit_transfer/mod.rs new file mode 100644 index 000000000..008b614cc --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_sepa_credit_transfer/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsSepaCreditTransfer { + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Bank Identifier Code of the bank associated with the bank account. + pub bic: Option, + /// IBAN of the bank account to transfer funds to. + pub iban: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_sepa_debit/mod.rs b/stripe_types/src/generated/payment_method_details_sepa_debit/mod.rs new file mode 100644 index 000000000..9b780db56 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_sepa_debit/mod.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsSepaDebit { + /// Bank code of bank associated with the bank account. + pub bank_code: Option, + /// Branch code of bank associated with the bank account. + pub branch_code: Option, + /// Two-letter ISO code representing the country the bank account is located in. + pub country: Option, + /// Uniquely identifies this particular bank account. + /// + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four characters of the IBAN. + pub last4: Option, + /// Find the ID of the mandate used for this payment under the [payment_method_details.sepa_debit.mandate](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate) property on the Charge. + /// + /// Use this mandate ID to [retrieve the Mandate](https://stripe.com/docs/api/mandates/retrieve). + pub mandate: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_sofort/mod.rs b/stripe_types/src/generated/payment_method_details_sofort/mod.rs new file mode 100644 index 000000000..e9a3343d8 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_sofort/mod.rs @@ -0,0 +1,103 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsSofort { + /// Bank code of bank associated with the bank account. + pub bank_code: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Bank Identifier Code of the bank associated with the bank account. + pub bic: Option, + /// Two-letter ISO code representing the country the bank account is located in. + pub country: Option, + /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + pub generated_sepa_debit: Option>, + /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + pub generated_sepa_debit_mandate: Option>, + /// Last four characters of the IBAN. + pub iban_last4: Option, + /// Preferred language of the SOFORT authorization page that the customer is redirected to. + /// Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl`. + pub preferred_language: Option, + /// Owner's verified full name. + /// + /// Values are verified or provided by SOFORT directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub verified_name: Option, +} +/// Preferred language of the SOFORT authorization page that the customer is redirected to. +/// Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsSofortPreferredLanguage { + De, + En, + Es, + Fr, + It, + Nl, + Pl, +} +impl PaymentMethodDetailsSofortPreferredLanguage { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsSofortPreferredLanguage::*; + match self { + De => "de", + En => "en", + Es => "es", + Fr => "fr", + It => "it", + Nl => "nl", + Pl => "pl", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsSofortPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsSofortPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "es" => Ok(Es), + "fr" => Ok(Fr), + "it" => Ok(It), + "nl" => Ok(Nl), + "pl" => Ok(Pl), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsSofortPreferredLanguage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsSofortPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsSofortPreferredLanguage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsSofortPreferredLanguage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_details_stripe_account/mod.rs b/stripe_types/src/generated/payment_method_details_stripe_account/mod.rs new file mode 100644 index 000000000..730157405 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_stripe_account/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsStripeAccount {} diff --git a/stripe_types/src/generated/payment_method_details_us_bank_account/mod.rs b/stripe_types/src/generated/payment_method_details_us_bank_account/mod.rs new file mode 100644 index 000000000..f2009f898 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_us_bank_account/mod.rs @@ -0,0 +1,145 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsUsBankAccount { + /// Account holder type: individual or company. + pub account_holder_type: Option, + /// Account type: checkings or savings. + /// + /// Defaults to checking if omitted. + pub account_type: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Uniquely identifies this particular bank account. + /// + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// Routing number of the bank account. + pub routing_number: Option, +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsUsBankAccountAccountHolderType { + Company, + Individual, +} +impl PaymentMethodDetailsUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsUsBankAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsUsBankAccountAccountHolderType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsUsBankAccountAccountHolderType", + ) + }) + } +} +/// Account type: checkings or savings. +/// +/// Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsUsBankAccountAccountType { + Checking, + Savings, +} +impl PaymentMethodDetailsUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodDetailsUsBankAccountAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodDetailsUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsUsBankAccountAccountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsUsBankAccountAccountType", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_details_wechat/mod.rs b/stripe_types/src/generated/payment_method_details_wechat/mod.rs new file mode 100644 index 000000000..33dbea74d --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_wechat/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsWechat {} diff --git a/stripe_types/src/generated/payment_method_details_wechat_pay/mod.rs b/stripe_types/src/generated/payment_method_details_wechat_pay/mod.rs new file mode 100644 index 000000000..3ed1a96f2 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_wechat_pay/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsWechatPay { + /// Uniquely identifies this particular WeChat Pay account. + /// + /// You can use this attribute to check whether two WeChat accounts are the same. + pub fingerprint: Option, + /// Transaction ID of this particular WeChat Pay transaction. + pub transaction_id: Option, +} diff --git a/stripe_types/src/generated/payment_method_details_zip/mod.rs b/stripe_types/src/generated/payment_method_details_zip/mod.rs new file mode 100644 index 000000000..4dfd4c934 --- /dev/null +++ b/stripe_types/src/generated/payment_method_details_zip/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsZip {} diff --git a/stripe_types/src/generated/payment_method_eps/mod.rs b/stripe_types/src/generated/payment_method_eps/mod.rs new file mode 100644 index 000000000..439fe3324 --- /dev/null +++ b/stripe_types/src/generated/payment_method_eps/mod.rs @@ -0,0 +1,149 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodEps { + /// The customer's bank. + /// + /// Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. + pub bank: Option, +} +/// The customer's bank. +/// +/// Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodEpsBank { + pub fn as_str(self) -> &'static str { + use PaymentMethodEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodEpsBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodEpsBank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodEpsBank::Unknown)) + } +} diff --git a/stripe_types/src/generated/payment_method_fpx/mod.rs b/stripe_types/src/generated/payment_method_fpx/mod.rs new file mode 100644 index 000000000..e823c5945 --- /dev/null +++ b/stripe_types/src/generated/payment_method_fpx/mod.rs @@ -0,0 +1,197 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodFpx { + /// Account holder type, if provided. + /// + /// Can be one of `individual` or `company`. + pub account_holder_type: Option, + /// The customer's bank, if provided. + /// + /// Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + pub bank: PaymentMethodFpxBank, +} +/// Account holder type, if provided. +/// +/// Can be one of `individual` or `company`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodFpxAccountHolderType { + Company, + Individual, +} +impl PaymentMethodFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use PaymentMethodFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for PaymentMethodFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodFpxAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodFpxAccountHolderType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodFpxAccountHolderType") + }) + } +} +/// The customer's bank, if provided. +/// +/// Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodFpxBank { + pub fn as_str(self) -> &'static str { + use PaymentMethodFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodFpxBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodFpxBank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodFpxBank::Unknown)) + } +} diff --git a/stripe_types/src/generated/payment_method_giropay/mod.rs b/stripe_types/src/generated/payment_method_giropay/mod.rs new file mode 100644 index 000000000..1003535de --- /dev/null +++ b/stripe_types/src/generated/payment_method_giropay/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodGiropay {} diff --git a/stripe_types/src/generated/payment_method_grabpay/mod.rs b/stripe_types/src/generated/payment_method_grabpay/mod.rs new file mode 100644 index 000000000..8832df64a --- /dev/null +++ b/stripe_types/src/generated/payment_method_grabpay/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodGrabpay {} diff --git a/stripe_types/src/generated/payment_method_ideal/mod.rs b/stripe_types/src/generated/payment_method_ideal/mod.rs new file mode 100644 index 000000000..b878437d7 --- /dev/null +++ b/stripe_types/src/generated/payment_method_ideal/mod.rs @@ -0,0 +1,216 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodIdeal { + /// The customer's bank, if provided. + /// + /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + pub bank: Option, + /// The Bank Identifier Code of the customer's bank, if the bank was provided. + pub bic: Option, +} +/// The customer's bank, if provided. +/// +/// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodIdealBank { + pub fn as_str(self) -> &'static str { + use PaymentMethodIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodIdealBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodIdealBank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodIdealBank::Unknown)) + } +} +/// The Bank Identifier Code of the customer's bank, if the bank was provided. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodIdealBic { + Abnanl2a, + Asnbnl21, + Bitsnl2a, + Bunqnl2a, + Fvlbnl22, + Handnl2a, + Ingbnl2a, + Knabnl2h, + Moyonl21, + Ntsbdeb1, + Rabonl2u, + Rbrbnl21, + Revoie23, + Revolt21, + Snsbnl2a, + Trionl2u, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodIdealBic { + pub fn as_str(self) -> &'static str { + use PaymentMethodIdealBic::*; + match self { + Abnanl2a => "ABNANL2A", + Asnbnl21 => "ASNBNL21", + Bitsnl2a => "BITSNL2A", + Bunqnl2a => "BUNQNL2A", + Fvlbnl22 => "FVLBNL22", + Handnl2a => "HANDNL2A", + Ingbnl2a => "INGBNL2A", + Knabnl2h => "KNABNL2H", + Moyonl21 => "MOYONL21", + Ntsbdeb1 => "NTSBDEB1", + Rabonl2u => "RABONL2U", + Rbrbnl21 => "RBRBNL21", + Revoie23 => "REVOIE23", + Revolt21 => "REVOLT21", + Snsbnl2a => "SNSBNL2A", + Trionl2u => "TRIONL2U", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodIdealBic { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodIdealBic::*; + match s { + "ABNANL2A" => Ok(Abnanl2a), + "ASNBNL21" => Ok(Asnbnl21), + "BITSNL2A" => Ok(Bitsnl2a), + "BUNQNL2A" => Ok(Bunqnl2a), + "FVLBNL22" => Ok(Fvlbnl22), + "HANDNL2A" => Ok(Handnl2a), + "INGBNL2A" => Ok(Ingbnl2a), + "KNABNL2H" => Ok(Knabnl2h), + "MOYONL21" => Ok(Moyonl21), + "NTSBDEB1" => Ok(Ntsbdeb1), + "RABONL2U" => Ok(Rabonl2u), + "RBRBNL21" => Ok(Rbrbnl21), + "REVOIE23" => Ok(Revoie23), + "REVOLT21" => Ok(Revolt21), + "SNSBNL2A" => Ok(Snsbnl2a), + "TRIONL2U" => Ok(Trionl2u), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodIdealBic { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodIdealBic { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodIdealBic { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodIdealBic { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodIdealBic { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodIdealBic::Unknown)) + } +} diff --git a/stripe_types/src/generated/payment_method_interac_present/mod.rs b/stripe_types/src/generated/payment_method_interac_present/mod.rs new file mode 100644 index 000000000..5da296acf --- /dev/null +++ b/stripe_types/src/generated/payment_method_interac_present/mod.rs @@ -0,0 +1,124 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodInteracPresent { + /// Card brand. + /// + /// Can be `interac`, `mastercard` or `visa`. + pub brand: Option, + /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. + /// + /// May include alphanumeric characters, special characters and first/last name separator (`/`). + /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card. + /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + pub cardholder_name: Option, + /// Two-letter ISO code representing the country of the card. + /// + /// You could use this attribute to get a sense of the international breakdown of cards you've collected. + pub country: Option, + /// A high-level description of the type of cards issued in this range. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Two-digit number representing the card's expiration month. + pub exp_month: i64, + /// Four-digit number representing the card's expiration year. + pub exp_year: i64, + /// Uniquely identifies this particular card number. + /// + /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. + /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. + pub fingerprint: Option, + /// Card funding type. + /// + /// Can be `credit`, `debit`, `prepaid`, or `unknown`. + pub funding: Option, + /// Issuer identification number of the card. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + /// The name of the card's issuing bank. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// The last four digits of the card. + pub last4: Option, + /// Contains information about card networks that can be used to process the payment. + pub networks: Option, + /// EMV tag 5F2D. + /// + /// Preferred languages specified by the integrated circuit chip. + pub preferred_locales: Option>, + /// How card details were read in this transaction. + pub read_method: Option, +} +/// How card details were read in this transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodInteracPresentReadMethod { + ContactEmv, + ContactlessEmv, + ContactlessMagstripeMode, + MagneticStripeFallback, + MagneticStripeTrack2, +} +impl PaymentMethodInteracPresentReadMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodInteracPresentReadMethod::*; + match self { + ContactEmv => "contact_emv", + ContactlessEmv => "contactless_emv", + ContactlessMagstripeMode => "contactless_magstripe_mode", + MagneticStripeFallback => "magnetic_stripe_fallback", + MagneticStripeTrack2 => "magnetic_stripe_track2", + } + } +} + +impl std::str::FromStr for PaymentMethodInteracPresentReadMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodInteracPresentReadMethod::*; + match s { + "contact_emv" => Ok(ContactEmv), + "contactless_emv" => Ok(ContactlessEmv), + "contactless_magstripe_mode" => Ok(ContactlessMagstripeMode), + "magnetic_stripe_fallback" => Ok(MagneticStripeFallback), + "magnetic_stripe_track2" => Ok(MagneticStripeTrack2), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodInteracPresentReadMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodInteracPresentReadMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodInteracPresentReadMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodInteracPresentReadMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodInteracPresentReadMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodInteracPresentReadMethod") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_klarna/mod.rs b/stripe_types/src/generated/payment_method_klarna/mod.rs new file mode 100644 index 000000000..2855c68b7 --- /dev/null +++ b/stripe_types/src/generated/payment_method_klarna/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodKlarna { + /// The customer's date of birth, if provided. + pub dob: Option, +} diff --git a/stripe_types/src/generated/payment_method_konbini/mod.rs b/stripe_types/src/generated/payment_method_konbini/mod.rs new file mode 100644 index 000000000..0df2b4210 --- /dev/null +++ b/stripe_types/src/generated/payment_method_konbini/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodKonbini {} diff --git a/stripe_types/src/generated/payment_method_link/mod.rs b/stripe_types/src/generated/payment_method_link/mod.rs new file mode 100644 index 000000000..45718fced --- /dev/null +++ b/stripe_types/src/generated/payment_method_link/mod.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodLink { + /// Account owner's email address. + pub email: Option, + /// \[Deprecated\] This is a legacy parameter that no longer has any function. + #[serde(skip_serializing_if = "Option::is_none")] + pub persistent_token: Option, +} diff --git a/stripe_types/src/generated/payment_method_options_affirm/mod.rs b/stripe_types/src/generated/payment_method_options_affirm/mod.rs new file mode 100644 index 000000000..5b5ec5d3d --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_affirm/mod.rs @@ -0,0 +1,134 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsAffirm { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred language of the Affirm authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsAffirmCaptureMethod { + Manual, +} +impl PaymentMethodOptionsAffirmCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsAffirmCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsAffirmCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsAffirmCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsAffirmCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsAffirmCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsAffirmCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsAffirmCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsAffirmCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsAffirmCaptureMethod") + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsAffirmSetupFutureUsage { + None, +} +impl PaymentMethodOptionsAffirmSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsAffirmSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsAffirmSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsAffirmSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsAffirmSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsAffirmSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsAffirmSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsAffirmSetupFutureUsage") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_afterpay_clearpay/mod.rs b/stripe_types/src/generated/payment_method_options_afterpay_clearpay/mod.rs new file mode 100644 index 000000000..db630a5d4 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_afterpay_clearpay/mod.rs @@ -0,0 +1,139 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsAfterpayClearpay { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// An internal identifier or reference that this payment corresponds to. + /// + /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. + pub reference: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsAfterpayClearpayCaptureMethod { + Manual, +} +impl PaymentMethodOptionsAfterpayClearpayCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsAfterpayClearpayCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsAfterpayClearpayCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsAfterpayClearpayCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsAfterpayClearpayCaptureMethod", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + None, +} +impl PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_alipay/mod.rs b/stripe_types/src/generated/payment_method_options_alipay/mod.rs new file mode 100644 index 000000000..9b2e37ad8 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_alipay/mod.rs @@ -0,0 +1,74 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsAlipay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsAlipaySetupFutureUsage { + None, + OffSession, +} +impl PaymentMethodOptionsAlipaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsAlipaySetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsAlipaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsAlipaySetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsAlipaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsAlipaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsAlipaySetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsAlipaySetupFutureUsage") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_bacs_debit/mod.rs b/stripe_types/src/generated/payment_method_options_bacs_debit/mod.rs new file mode 100644 index 000000000..eb856a737 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_bacs_debit/mod.rs @@ -0,0 +1,79 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsBacsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsBacsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl PaymentMethodOptionsBacsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsBacsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsBacsDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsBacsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsBacsDebitSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsBacsDebitSetupFutureUsage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_bancontact/mod.rs b/stripe_types/src/generated/payment_method_options_bancontact/mod.rs new file mode 100644 index 000000000..952d52baa --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_bancontact/mod.rs @@ -0,0 +1,146 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + pub preferred_language: PaymentMethodOptionsBancontactPreferredLanguage, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl PaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsBancontactPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsBancontactPreferredLanguage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsBancontactPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsBancontactPreferredLanguage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsBancontactPreferredLanguage", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsBancontactSetupFutureUsage { + None, + OffSession, +} +impl PaymentMethodOptionsBancontactSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsBancontactSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsBancontactSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsBancontactSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsBancontactSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsBancontactSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsBancontactSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsBancontactSetupFutureUsage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_boleto/mod.rs b/stripe_types/src/generated/payment_method_options_boleto/mod.rs new file mode 100644 index 000000000..9a0722703 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_boleto/mod.rs @@ -0,0 +1,81 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsBoleto { + /// The number of calendar days before a Boleto voucher expires. + /// + /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time. + pub expires_after_days: u32, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsBoletoSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl PaymentMethodOptionsBoletoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsBoletoSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsBoletoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsBoletoSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsBoletoSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsBoletoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsBoletoSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsBoletoSetupFutureUsage") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_card_installments/mod.rs b/stripe_types/src/generated/payment_method_options_card_installments/mod.rs new file mode 100644 index 000000000..b4eed0303 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_card_installments/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsCardInstallments { + /// Installment plans that may be selected for this PaymentIntent. + pub available_plans: Option>, + /// Whether Installments are enabled for this PaymentIntent. + pub enabled: bool, + /// Installment plan selected for this PaymentIntent. + pub plan: Option, +} diff --git a/stripe_types/src/generated/payment_method_options_card_mandate_options/mod.rs b/stripe_types/src/generated/payment_method_options_card_mandate_options/mod.rs new file mode 100644 index 000000000..17f7df706 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_card_mandate_options/mod.rs @@ -0,0 +1,236 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsCardMandateOptions { + /// Amount to be charged for future payments. + pub amount: i64, + /// One of `fixed` or `maximum`. + /// + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: PaymentMethodOptionsCardMandateOptionsAmountType, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + pub description: Option, + /// End date of the mandate or subscription. + /// + /// If not provided, the mandate will be active until canceled. + /// If provided, end date should be after start date. + pub end_date: Option, + /// Specifies payment frequency. + /// + /// One of `day`, `week`, `month`, `year`, or `sporadic`. + pub interval: PaymentMethodOptionsCardMandateOptionsInterval, + /// The number of intervals between payments. + /// + /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// This parameter is optional when `interval=sporadic`. + pub interval_count: Option, + /// Unique identifier for the mandate or subscription. + pub reference: String, + /// Start date of the mandate or subscription. + /// + /// Start date should not be lesser than yesterday. + pub start_date: stripe_types::Timestamp, + /// Specifies the type of mandates supported. + /// + /// Possible values are `india`. + pub supported_types: Option>, +} +/// One of `fixed` or `maximum`. +/// +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl PaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCardMandateOptionsAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsCardMandateOptionsAmountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCardMandateOptionsAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCardMandateOptionsAmountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsCardMandateOptionsAmountType", + ) + }) + } +} +/// Specifies payment frequency. +/// +/// One of `day`, `week`, `month`, `year`, or `sporadic`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCardMandateOptionsInterval { + Day, + Month, + Sporadic, + Week, + Year, +} +impl PaymentMethodOptionsCardMandateOptionsInterval { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCardMandateOptionsInterval::*; + match self { + Day => "day", + Month => "month", + Sporadic => "sporadic", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCardMandateOptionsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCardMandateOptionsInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "sporadic" => Ok(Sporadic), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsCardMandateOptionsInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCardMandateOptionsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCardMandateOptionsInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsCardMandateOptionsInterval", + ) + }) + } +} +/// Specifies the type of mandates supported. +/// +/// Possible values are `india`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCardMandateOptionsSupportedTypes { + India, +} +impl PaymentMethodOptionsCardMandateOptionsSupportedTypes { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match self { + India => "india", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCardMandateOptionsSupportedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match s { + "india" => Ok(India), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsCardMandateOptionsSupportedTypes", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_card_present/mod.rs b/stripe_types/src/generated/payment_method_options_card_present/mod.rs new file mode 100644 index 000000000..8547d67b5 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_card_present/mod.rs @@ -0,0 +1,9 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsCardPresent { + /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity). + pub request_extended_authorization: Option, + /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. + /// + /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. + pub request_incremental_authorization_support: Option, +} diff --git a/stripe_types/src/generated/payment_method_options_cashapp/mod.rs b/stripe_types/src/generated/payment_method_options_cashapp/mod.rs new file mode 100644 index 000000000..4b263cb82 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_cashapp/mod.rs @@ -0,0 +1,139 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsCashapp { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCashappCaptureMethod { + Manual, +} +impl PaymentMethodOptionsCashappCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCashappCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCashappCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCashappCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsCashappCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCashappCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCashappCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsCashappCaptureMethod") + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCashappSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl PaymentMethodOptionsCashappSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCashappSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCashappSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCashappSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsCashappSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCashappSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCashappSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsCashappSetupFutureUsage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_customer_balance/mod.rs b/stripe_types/src/generated/payment_method_options_customer_balance/mod.rs new file mode 100644 index 000000000..29acb4c50 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_customer_balance/mod.rs @@ -0,0 +1,140 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsCustomerBalance { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: Option, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// + /// Permitted values include: `bank_transfer`. + pub funding_type: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// The funding method type to be used when there are not enough funds in the customer balance. +/// +/// Permitted values include: `bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCustomerBalanceFundingType { + BankTransfer, +} +impl PaymentMethodOptionsCustomerBalanceFundingType { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCustomerBalanceFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCustomerBalanceFundingType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCustomerBalanceFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsCustomerBalanceFundingType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCustomerBalanceFundingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCustomerBalanceFundingType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsCustomerBalanceFundingType", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCustomerBalanceSetupFutureUsage { + None, +} +impl PaymentMethodOptionsCustomerBalanceSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCustomerBalanceSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsCustomerBalanceSetupFutureUsage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_customer_balance_bank_transfer/mod.rs b/stripe_types/src/generated/payment_method_options_customer_balance_bank_transfer/mod.rs new file mode 100644 index 000000000..25d04a333 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_customer_balance_bank_transfer/mod.rs @@ -0,0 +1,162 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsCustomerBalanceBankTransfer { + #[serde(skip_serializing_if = "Option::is_none")] + pub eu_bank_transfer: Option, + /// List of address types that should be returned in the financial_addresses response. + /// + /// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested_address_types: + Option>, + /// The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + #[serde(rename = "type")] + pub type_: Option, +} +/// List of address types that should be returned in the financial_addresses response. +/// +/// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + Aba, + Iban, + Sepa, + SortCode, + Spei, + Swift, + Zengin, +} +impl PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match self { + Aba => "aba", + Iban => "iban", + Sepa => "sepa", + SortCode => "sort_code", + Spei => "spei", + Swift => "swift", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match s { + "aba" => Ok(Aba), + "iban" => Ok(Iban), + "sepa" => Ok(Sepa), + "sort_code" => Ok(SortCode), + "spei" => Ok(Spei), + "swift" => Ok(Swift), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes")) + } +} +/// The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCustomerBalanceBankTransferType { + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl PaymentMethodOptionsCustomerBalanceBankTransferType { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCustomerBalanceBankTransferType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCustomerBalanceBankTransferType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCustomerBalanceBankTransferType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "gb_bank_transfer" => Ok(GbBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + "mx_bank_transfer" => Ok(MxBankTransfer), + "us_bank_transfer" => Ok(UsBankTransfer), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsCustomerBalanceBankTransferType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCustomerBalanceBankTransferType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCustomerBalanceBankTransferType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsCustomerBalanceBankTransferType", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_customer_balance_eu_bank_account/mod.rs b/stripe_types/src/generated/payment_method_options_customer_balance_eu_bank_account/mod.rs new file mode 100644 index 000000000..52bd197fb --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_customer_balance_eu_bank_account/mod.rs @@ -0,0 +1,83 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsCustomerBalanceEuBankAccount { + /// The desired country code of the bank account information. + /// + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: PaymentMethodOptionsCustomerBalanceEuBankAccountCountry, +} +/// The desired country code of the bank account information. +/// +/// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { + Be, + De, + Es, + Fr, + Ie, + Nl, +} +impl PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::*; + match self { + Be => "BE", + De => "DE", + Es => "ES", + Fr => "FR", + Ie => "IE", + Nl => "NL", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::*; + match s { + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "FR" => Ok(Fr), + "IE" => Ok(Ie), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_fpx/mod.rs b/stripe_types/src/generated/payment_method_options_fpx/mod.rs new file mode 100644 index 000000000..a54bba55c --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_fpx/mod.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsFpx { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsFpxSetupFutureUsage { + None, +} +impl PaymentMethodOptionsFpxSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsFpxSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsFpxSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsFpxSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsFpxSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsFpxSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsFpxSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsFpxSetupFutureUsage") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_giropay/mod.rs b/stripe_types/src/generated/payment_method_options_giropay/mod.rs new file mode 100644 index 000000000..d6790a144 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_giropay/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsGiropay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsGiropaySetupFutureUsage { + None, +} +impl PaymentMethodOptionsGiropaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsGiropaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsGiropaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsGiropaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsGiropaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsGiropaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsGiropaySetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsGiropaySetupFutureUsage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_grabpay/mod.rs b/stripe_types/src/generated/payment_method_options_grabpay/mod.rs new file mode 100644 index 000000000..b987f57d0 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_grabpay/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsGrabpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsGrabpaySetupFutureUsage { + None, +} +impl PaymentMethodOptionsGrabpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsGrabpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsGrabpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsGrabpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsGrabpaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsGrabpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsGrabpaySetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsGrabpaySetupFutureUsage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_ideal/mod.rs b/stripe_types/src/generated/payment_method_options_ideal/mod.rs new file mode 100644 index 000000000..019bb8ef3 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_ideal/mod.rs @@ -0,0 +1,74 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsIdeal { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsIdealSetupFutureUsage { + None, + OffSession, +} +impl PaymentMethodOptionsIdealSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsIdealSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsIdealSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsIdealSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsIdealSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsIdealSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsIdealSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsIdealSetupFutureUsage") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_interac_present/mod.rs b/stripe_types/src/generated/payment_method_options_interac_present/mod.rs new file mode 100644 index 000000000..702a90947 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_interac_present/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsInteracPresent {} diff --git a/stripe_types/src/generated/payment_method_options_klarna/mod.rs b/stripe_types/src/generated/payment_method_options_klarna/mod.rs new file mode 100644 index 000000000..57dbcd76f --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_klarna/mod.rs @@ -0,0 +1,133 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsKlarna { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred locale of the Klarna checkout page that the customer is redirected to. + pub preferred_locale: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsKlarnaCaptureMethod { + Manual, +} +impl PaymentMethodOptionsKlarnaCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsKlarnaCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsKlarnaCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsKlarnaCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsKlarnaCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsKlarnaCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsKlarnaCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsKlarnaCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsKlarnaCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsKlarnaCaptureMethod") + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsKlarnaSetupFutureUsage { + None, +} +impl PaymentMethodOptionsKlarnaSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsKlarnaSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsKlarnaSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsKlarnaSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsKlarnaSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsKlarnaSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsKlarnaSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsKlarnaSetupFutureUsage") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_konbini/mod.rs b/stripe_types/src/generated/payment_method_options_konbini/mod.rs new file mode 100644 index 000000000..882bb7e48 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_konbini/mod.rs @@ -0,0 +1,85 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsKonbini { + /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. + pub confirmation_number: Option, + /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. + /// + /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. + pub expires_after_days: Option, + /// The timestamp at which the Konbini payment instructions will expire. + /// + /// Only one of `expires_after_days` or `expires_at` may be set. + pub expires_at: Option, + /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + pub product_description: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsKonbiniSetupFutureUsage { + None, +} +impl PaymentMethodOptionsKonbiniSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsKonbiniSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsKonbiniSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsKonbiniSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsKonbiniSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsKonbiniSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsKonbiniSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsKonbiniSetupFutureUsage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_oxxo/mod.rs b/stripe_types/src/generated/payment_method_options_oxxo/mod.rs new file mode 100644 index 000000000..755a3f4de --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_oxxo/mod.rs @@ -0,0 +1,75 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsOxxo { + /// The number of calendar days before an OXXO invoice expires. + /// + /// For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + pub expires_after_days: u32, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsOxxoSetupFutureUsage { + None, +} +impl PaymentMethodOptionsOxxoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsOxxoSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsOxxoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsOxxoSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsOxxoSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsOxxoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsOxxoSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsOxxoSetupFutureUsage") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_p24/mod.rs b/stripe_types/src/generated/payment_method_options_p24/mod.rs new file mode 100644 index 000000000..d8a37b85d --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_p24/mod.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsP24 { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsP24SetupFutureUsage { + None, +} +impl PaymentMethodOptionsP24SetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsP24SetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsP24SetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsP24SetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsP24SetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsP24SetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsP24SetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsP24SetupFutureUsage") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_paynow/mod.rs b/stripe_types/src/generated/payment_method_options_paynow/mod.rs new file mode 100644 index 000000000..ac488456f --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_paynow/mod.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsPaynow { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsPaynowSetupFutureUsage { + None, +} +impl PaymentMethodOptionsPaynowSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsPaynowSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsPaynowSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsPaynowSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsPaynowSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsPaynowSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsPaynowSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsPaynowSetupFutureUsage") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_paypal/mod.rs b/stripe_types/src/generated/payment_method_options_paypal/mod.rs new file mode 100644 index 000000000..e4f25a38c --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_paypal/mod.rs @@ -0,0 +1,140 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsPaypal { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred locale of the PayPal checkout page that the customer is redirected to. + pub preferred_locale: Option, + /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. + /// + /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + pub reference: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsPaypalCaptureMethod { + Manual, +} +impl PaymentMethodOptionsPaypalCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsPaypalCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsPaypalCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsPaypalCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsPaypalCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsPaypalCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsPaypalCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsPaypalCaptureMethod") + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsPaypalSetupFutureUsage { + None, + OffSession, +} +impl PaymentMethodOptionsPaypalSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsPaypalSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsPaypalSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsPaypalSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsPaypalSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsPaypalSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsPaypalSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsPaypalSetupFutureUsage") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_pix/mod.rs b/stripe_types/src/generated/payment_method_options_pix/mod.rs new file mode 100644 index 000000000..ac1f75857 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_pix/mod.rs @@ -0,0 +1,75 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsPix { + /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. + pub expires_after_seconds: Option, + /// The timestamp at which the Pix expires. + pub expires_at: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsPixSetupFutureUsage { + None, +} +impl PaymentMethodOptionsPixSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsPixSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsPixSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsPixSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsPixSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsPixSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsPixSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsPixSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsPixSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsPixSetupFutureUsage") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_promptpay/mod.rs b/stripe_types/src/generated/payment_method_options_promptpay/mod.rs new file mode 100644 index 000000000..ebf6630a1 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_promptpay/mod.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsPromptpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsPromptpaySetupFutureUsage { + None, +} +impl PaymentMethodOptionsPromptpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsPromptpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsPromptpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsPromptpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsPromptpaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsPromptpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsPromptpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsPromptpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsPromptpaySetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsPromptpaySetupFutureUsage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_revolut_pay/mod.rs b/stripe_types/src/generated/payment_method_options_revolut_pay/mod.rs new file mode 100644 index 000000000..75f50f7a6 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_revolut_pay/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsRevolutPay {} diff --git a/stripe_types/src/generated/payment_method_options_sofort/mod.rs b/stripe_types/src/generated/payment_method_options_sofort/mod.rs new file mode 100644 index 000000000..df2d8ac5a --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_sofort/mod.rs @@ -0,0 +1,153 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsSofort { + /// Preferred language of the SOFORT authorization page that the customer is redirected to. + pub preferred_language: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Preferred language of the SOFORT authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsSofortPreferredLanguage { + De, + En, + Es, + Fr, + It, + Nl, + Pl, +} +impl PaymentMethodOptionsSofortPreferredLanguage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsSofortPreferredLanguage::*; + match self { + De => "de", + En => "en", + Es => "es", + Fr => "fr", + It => "it", + Nl => "nl", + Pl => "pl", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsSofortPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsSofortPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "es" => Ok(Es), + "fr" => Ok(Fr), + "it" => Ok(It), + "nl" => Ok(Nl), + "pl" => Ok(Pl), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsSofortPreferredLanguage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsSofortPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsSofortPreferredLanguage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsSofortPreferredLanguage", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsSofortSetupFutureUsage { + None, + OffSession, +} +impl PaymentMethodOptionsSofortSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsSofortSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsSofortSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsSofortSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsSofortSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsSofortSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsSofortSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsSofortSetupFutureUsage") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_wechat_pay/mod.rs b/stripe_types/src/generated/payment_method_options_wechat_pay/mod.rs new file mode 100644 index 000000000..de5cb5757 --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_wechat_pay/mod.rs @@ -0,0 +1,142 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsWechatPay { + /// The app ID registered with WeChat Pay. + /// + /// Only required when client is ios or android. + pub app_id: Option, + /// The client type that the end customer will pay from. + pub client: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// The client type that the end customer will pay from. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsWechatPayClient { + Android, + Ios, + Web, +} +impl PaymentMethodOptionsWechatPayClient { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsWechatPayClient::*; + match self { + Android => "android", + Ios => "ios", + Web => "web", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsWechatPayClient { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsWechatPayClient::*; + match s { + "android" => Ok(Android), + "ios" => Ok(Ios), + "web" => Ok(Web), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsWechatPayClient { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsWechatPayClient { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsWechatPayClient { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsWechatPayClient") + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsWechatPaySetupFutureUsage { + None, +} +impl PaymentMethodOptionsWechatPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsWechatPaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsWechatPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsWechatPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsWechatPaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsWechatPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsWechatPaySetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsWechatPaySetupFutureUsage", + ) + }) + } +} diff --git a/stripe_types/src/generated/payment_method_options_zip/mod.rs b/stripe_types/src/generated/payment_method_options_zip/mod.rs new file mode 100644 index 000000000..01f1217fb --- /dev/null +++ b/stripe_types/src/generated/payment_method_options_zip/mod.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsZip { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsZipSetupFutureUsage { + None, +} +impl PaymentMethodOptionsZipSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsZipSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsZipSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsZipSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodOptionsZipSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodOptionsZipSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsZipSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsZipSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsZipSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsZipSetupFutureUsage") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_oxxo/mod.rs b/stripe_types/src/generated/payment_method_oxxo/mod.rs new file mode 100644 index 000000000..5680d3a17 --- /dev/null +++ b/stripe_types/src/generated/payment_method_oxxo/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOxxo {} diff --git a/stripe_types/src/generated/payment_method_p24/mod.rs b/stripe_types/src/generated/payment_method_p24/mod.rs new file mode 100644 index 000000000..dc4c1d617 --- /dev/null +++ b/stripe_types/src/generated/payment_method_p24/mod.rs @@ -0,0 +1,136 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodP24 { + /// The customer's bank, if provided. + pub bank: Option, +} +/// The customer's bank, if provided. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodP24Bank { + pub fn as_str(self) -> &'static str { + use PaymentMethodP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodP24Bank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodP24Bank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodP24Bank::Unknown)) + } +} diff --git a/stripe_types/src/generated/payment_method_paynow/mod.rs b/stripe_types/src/generated/payment_method_paynow/mod.rs new file mode 100644 index 000000000..e48602eee --- /dev/null +++ b/stripe_types/src/generated/payment_method_paynow/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodPaynow {} diff --git a/stripe_types/src/generated/payment_method_paypal/mod.rs b/stripe_types/src/generated/payment_method_paypal/mod.rs new file mode 100644 index 000000000..5b99771d4 --- /dev/null +++ b/stripe_types/src/generated/payment_method_paypal/mod.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodPaypal { + /// Owner's email. + /// + /// Values are provided by PayPal directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub payer_email: Option, + /// PayPal account PayerID. + /// + /// This identifier uniquely identifies the PayPal customer. + pub payer_id: Option, +} diff --git a/stripe_types/src/generated/payment_method_pix/mod.rs b/stripe_types/src/generated/payment_method_pix/mod.rs new file mode 100644 index 000000000..d85b9e220 --- /dev/null +++ b/stripe_types/src/generated/payment_method_pix/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodPix {} diff --git a/stripe_types/src/generated/payment_method_promptpay/mod.rs b/stripe_types/src/generated/payment_method_promptpay/mod.rs new file mode 100644 index 000000000..6f706eb99 --- /dev/null +++ b/stripe_types/src/generated/payment_method_promptpay/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodPromptpay {} diff --git a/stripe_types/src/generated/payment_method_revolut_pay/mod.rs b/stripe_types/src/generated/payment_method_revolut_pay/mod.rs new file mode 100644 index 000000000..d51e34e8a --- /dev/null +++ b/stripe_types/src/generated/payment_method_revolut_pay/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodRevolutPay {} diff --git a/stripe_types/src/generated/payment_method_sepa_debit/mod.rs b/stripe_types/src/generated/payment_method_sepa_debit/mod.rs new file mode 100644 index 000000000..5f033e079 --- /dev/null +++ b/stripe_types/src/generated/payment_method_sepa_debit/mod.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodSepaDebit { + /// Bank code of bank associated with the bank account. + pub bank_code: Option, + /// Branch code of bank associated with the bank account. + pub branch_code: Option, + /// Two-letter ISO code representing the country the bank account is located in. + pub country: Option, + /// Uniquely identifies this particular bank account. + /// + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Information about the object that generated this PaymentMethod. + pub generated_from: Option, + /// Last four characters of the IBAN. + pub last4: Option, +} diff --git a/stripe_types/src/generated/payment_method_sofort/mod.rs b/stripe_types/src/generated/payment_method_sofort/mod.rs new file mode 100644 index 000000000..5932ff7bd --- /dev/null +++ b/stripe_types/src/generated/payment_method_sofort/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodSofort { + /// Two-letter ISO code representing the country the bank account is located in. + pub country: Option, +} diff --git a/stripe_types/src/generated/payment_method_us_bank_account/mod.rs b/stripe_types/src/generated/payment_method_us_bank_account/mod.rs new file mode 100644 index 000000000..0dcdefb3e --- /dev/null +++ b/stripe_types/src/generated/payment_method_us_bank_account/mod.rs @@ -0,0 +1,149 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodUsBankAccount { + /// Account holder type: individual or company. + pub account_holder_type: Option, + /// Account type: checkings or savings. + /// + /// Defaults to checking if omitted. + pub account_type: Option, + /// The name of the bank. + pub bank_name: Option, + /// The ID of the Financial Connections Account used to create the payment method. + pub financial_connections_account: Option, + /// Uniquely identifies this particular bank account. + /// + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// Contains information about US bank account networks that can be used. + pub networks: Option, + /// Routing number of the bank account. + pub routing_number: Option, + /// Contains information about the future reusability of this PaymentMethod. + pub status_details: Option, +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodUsBankAccountAccountHolderType { + Company, + Individual, +} +impl PaymentMethodUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use PaymentMethodUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for PaymentMethodUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodUsBankAccountAccountHolderType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodUsBankAccountAccountHolderType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodUsBankAccountAccountHolderType", + ) + }) + } +} +/// Account type: checkings or savings. +/// +/// Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodUsBankAccountAccountType { + Checking, + Savings, +} +impl PaymentMethodUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use PaymentMethodUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for PaymentMethodUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodUsBankAccountAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodUsBankAccountAccountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodUsBankAccountAccountType") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_us_bank_account_blocked/mod.rs b/stripe_types/src/generated/payment_method_us_bank_account_blocked/mod.rs new file mode 100644 index 000000000..0742d7112 --- /dev/null +++ b/stripe_types/src/generated/payment_method_us_bank_account_blocked/mod.rs @@ -0,0 +1,171 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodUsBankAccountBlocked { + /// The ACH network code that resulted in this block. + pub network_code: Option, + /// The reason why this PaymentMethod's fingerprint has been blocked. + pub reason: Option, +} +/// The ACH network code that resulted in this block. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodUsBankAccountBlockedNetworkCode { + R02, + R03, + R04, + R05, + R07, + R08, + R10, + R11, + R16, + R20, + R29, + R31, +} +impl PaymentMethodUsBankAccountBlockedNetworkCode { + pub fn as_str(self) -> &'static str { + use PaymentMethodUsBankAccountBlockedNetworkCode::*; + match self { + R02 => "R02", + R03 => "R03", + R04 => "R04", + R05 => "R05", + R07 => "R07", + R08 => "R08", + R10 => "R10", + R11 => "R11", + R16 => "R16", + R20 => "R20", + R29 => "R29", + R31 => "R31", + } + } +} + +impl std::str::FromStr for PaymentMethodUsBankAccountBlockedNetworkCode { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodUsBankAccountBlockedNetworkCode::*; + match s { + "R02" => Ok(R02), + "R03" => Ok(R03), + "R04" => Ok(R04), + "R05" => Ok(R05), + "R07" => Ok(R07), + "R08" => Ok(R08), + "R10" => Ok(R10), + "R11" => Ok(R11), + "R16" => Ok(R16), + "R20" => Ok(R20), + "R29" => Ok(R29), + "R31" => Ok(R31), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodUsBankAccountBlockedNetworkCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodUsBankAccountBlockedNetworkCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodUsBankAccountBlockedNetworkCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodUsBankAccountBlockedNetworkCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodUsBankAccountBlockedNetworkCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodUsBankAccountBlockedNetworkCode", + ) + }) + } +} +/// The reason why this PaymentMethod's fingerprint has been blocked. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodUsBankAccountBlockedReason { + BankAccountClosed, + BankAccountFrozen, + BankAccountInvalidDetails, + BankAccountRestricted, + BankAccountUnusable, + DebitNotAuthorized, +} +impl PaymentMethodUsBankAccountBlockedReason { + pub fn as_str(self) -> &'static str { + use PaymentMethodUsBankAccountBlockedReason::*; + match self { + BankAccountClosed => "bank_account_closed", + BankAccountFrozen => "bank_account_frozen", + BankAccountInvalidDetails => "bank_account_invalid_details", + BankAccountRestricted => "bank_account_restricted", + BankAccountUnusable => "bank_account_unusable", + DebitNotAuthorized => "debit_not_authorized", + } + } +} + +impl std::str::FromStr for PaymentMethodUsBankAccountBlockedReason { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodUsBankAccountBlockedReason::*; + match s { + "bank_account_closed" => Ok(BankAccountClosed), + "bank_account_frozen" => Ok(BankAccountFrozen), + "bank_account_invalid_details" => Ok(BankAccountInvalidDetails), + "bank_account_restricted" => Ok(BankAccountRestricted), + "bank_account_unusable" => Ok(BankAccountUnusable), + "debit_not_authorized" => Ok(DebitNotAuthorized), + _ => Err(()), + } + } +} +impl AsRef for PaymentMethodUsBankAccountBlockedReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaymentMethodUsBankAccountBlockedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodUsBankAccountBlockedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodUsBankAccountBlockedReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodUsBankAccountBlockedReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodUsBankAccountBlockedReason") + }) + } +} diff --git a/stripe_types/src/generated/payment_method_us_bank_account_status_details/mod.rs b/stripe_types/src/generated/payment_method_us_bank_account_status_details/mod.rs new file mode 100644 index 000000000..5eb7e4065 --- /dev/null +++ b/stripe_types/src/generated/payment_method_us_bank_account_status_details/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodUsBankAccountStatusDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub blocked: Option, +} diff --git a/stripe_types/src/generated/payment_method_wechat_pay/mod.rs b/stripe_types/src/generated/payment_method_wechat_pay/mod.rs new file mode 100644 index 000000000..704c7830c --- /dev/null +++ b/stripe_types/src/generated/payment_method_wechat_pay/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodWechatPay {} diff --git a/stripe_types/src/generated/payment_method_zip/mod.rs b/stripe_types/src/generated/payment_method_zip/mod.rs new file mode 100644 index 000000000..425e0d65f --- /dev/null +++ b/stripe_types/src/generated/payment_method_zip/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodZip {} diff --git a/stripe_types/src/generated/payment_source/mod.rs b/stripe_types/src/generated/payment_source/mod.rs new file mode 100644 index 000000000..8b97cac94 --- /dev/null +++ b/stripe_types/src/generated/payment_source/mod.rs @@ -0,0 +1,24 @@ +/// The resource representing a Stripe Polymorphic. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum PaymentSource { + #[serde(rename = "account")] + Account(stripe_types::Account), + #[serde(rename = "bank_account")] + BankAccount(stripe_types::BankAccount), + #[serde(rename = "card")] + Card(stripe_types::Card), + #[serde(rename = "source")] + Source(stripe_types::Source), +} +impl stripe_types::Object for PaymentSource { + type Id = String; + fn id(&self) -> Option<&str> { + match self { + Self::Account(v) => Some(v.id.as_str()), + Self::BankAccount(v) => Some(v.id.as_str()), + Self::Card(v) => Some(v.id.as_str()), + Self::Source(v) => Some(v.id.as_str()), + } + } +} diff --git a/stripe_types/src/generated/payout/mod.rs b/stripe_types/src/generated/payout/mod.rs new file mode 100644 index 000000000..e22eeb845 --- /dev/null +++ b/stripe_types/src/generated/payout/mod.rs @@ -0,0 +1,201 @@ +/// A `Payout` object is created when you receive funds from Stripe, or when you +/// initiate a payout to either a bank account or debit card of a [connected +/// Stripe account](/docs/connect/bank-debit-card-payouts). +/// +/// You can retrieve individual payouts, and list all payouts. +/// Payouts are made on [varying schedules](/docs/connect/manage-payout-schedule), depending on your country and industry. Related guide: [Receiving payouts](https://stripe.com/docs/payouts) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Payout { + /// The amount (in cents (or local equivalent)) that transfers to your bank account or debit card. + pub amount: i64, + /// Date that you can expect the payout to arrive in the bank. + /// + /// This factors in delays to account for weekends or bank holidays. + pub arrival_date: stripe_types::Timestamp, + /// Returns `true` if the payout is created by an [automated payout schedule](https://stripe.com/docs/payouts#payout-schedule) and `false` if it's [requested manually](https://stripe.com/docs/payouts#manual-payouts). + pub automatic: bool, + /// ID of the balance transaction that describes the impact of this payout on your account balance. + pub balance_transaction: Option>, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// ID of the bank account or card the payout is sent to. + pub destination: Option>, + /// If the payout fails or cancels, this is the ID of the balance transaction that reverses the initial balance transaction and returns the funds from the failed payout back in your balance. + pub failure_balance_transaction: + Option>, + /// Error code that provides a reason for a payout failure, if available. + /// + /// View our [list of failure codes](https://stripe.com/docs/api#payout_failures). + pub failure_code: Option, + /// Message that provides the reason for a payout failure, if available. + pub failure_message: Option, + /// Unique identifier for the object. + pub id: stripe_types::payout::PayoutId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// The method used to send this payout, which can be `standard` or `instant`. + /// + /// `instant` is supported for payouts to debit cards and bank accounts in certain countries. + /// Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). + pub method: String, + /// If the payout reverses another, this is the ID of the original payout. + pub original_payout: Option>, + /// If `completed`, you can use the [Balance Transactions API](https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout) to list all balance transactions that are paid out in this payout. + pub reconciliation_status: PayoutReconciliationStatus, + /// If the payout reverses, this is the ID of the payout that reverses this payout. + pub reversed_by: Option>, + /// The source balance this payout came from, which can be one of the following: `card`, `fpx`, or `bank_account`. + pub source_type: String, + /// Extra information about a payout that displays on the user's bank statement. + pub statement_descriptor: Option, + /// Current status of the payout: `paid`, `pending`, `in_transit`, `canceled` or `failed`. + /// + /// A payout is `pending` until it's submitted to the bank, when it becomes `in_transit`. + /// The status changes to `paid` if the transaction succeeds, or to `failed` or `canceled` (within 5 business days). + /// Some payouts that fail might initially show as `paid`, then change to `failed`. + pub status: String, + /// Can be `bank_account` or `card`. + #[serde(rename = "type")] + pub type_: PayoutType, +} +/// If `completed`, you can use the [Balance Transactions API](https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout) to list all balance transactions that are paid out in this payout. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PayoutReconciliationStatus { + Completed, + InProgress, + NotApplicable, +} +impl PayoutReconciliationStatus { + pub fn as_str(self) -> &'static str { + use PayoutReconciliationStatus::*; + match self { + Completed => "completed", + InProgress => "in_progress", + NotApplicable => "not_applicable", + } + } +} + +impl std::str::FromStr for PayoutReconciliationStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use PayoutReconciliationStatus::*; + match s { + "completed" => Ok(Completed), + "in_progress" => Ok(InProgress), + "not_applicable" => Ok(NotApplicable), + _ => Err(()), + } + } +} +impl AsRef for PayoutReconciliationStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PayoutReconciliationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PayoutReconciliationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PayoutReconciliationStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PayoutReconciliationStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PayoutReconciliationStatus")) + } +} +/// Can be `bank_account` or `card`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PayoutType { + BankAccount, + Card, +} +impl PayoutType { + pub fn as_str(self) -> &'static str { + use PayoutType::*; + match self { + BankAccount => "bank_account", + Card => "card", + } + } +} + +impl std::str::FromStr for PayoutType { + type Err = (); + fn from_str(s: &str) -> Result { + use PayoutType::*; + match s { + "bank_account" => Ok(BankAccount), + "card" => Ok(Card), + _ => Err(()), + } + } +} +impl AsRef for PayoutType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PayoutType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PayoutType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PayoutType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PayoutType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PayoutType")) + } +} +impl stripe_types::Object for Payout { + type Id = stripe_types::payout::PayoutId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(PayoutId, "po_"); diff --git a/stripe_types/src/generated/paypal_seller_protection/mod.rs b/stripe_types/src/generated/paypal_seller_protection/mod.rs new file mode 100644 index 000000000..04e194a54 --- /dev/null +++ b/stripe_types/src/generated/paypal_seller_protection/mod.rs @@ -0,0 +1,129 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaypalSellerProtection { + /// An array of conditions that are covered for the transaction, if applicable. + pub dispute_categories: Option>, + /// Indicates whether the transaction is eligible for PayPal's seller protection. + pub status: PaypalSellerProtectionStatus, +} +/// An array of conditions that are covered for the transaction, if applicable. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaypalSellerProtectionDisputeCategories { + Fraudulent, + ProductNotReceived, +} +impl PaypalSellerProtectionDisputeCategories { + pub fn as_str(self) -> &'static str { + use PaypalSellerProtectionDisputeCategories::*; + match self { + Fraudulent => "fraudulent", + ProductNotReceived => "product_not_received", + } + } +} + +impl std::str::FromStr for PaypalSellerProtectionDisputeCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use PaypalSellerProtectionDisputeCategories::*; + match s { + "fraudulent" => Ok(Fraudulent), + "product_not_received" => Ok(ProductNotReceived), + _ => Err(()), + } + } +} +impl AsRef for PaypalSellerProtectionDisputeCategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaypalSellerProtectionDisputeCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaypalSellerProtectionDisputeCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaypalSellerProtectionDisputeCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaypalSellerProtectionDisputeCategories { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaypalSellerProtectionDisputeCategories") + }) + } +} +/// Indicates whether the transaction is eligible for PayPal's seller protection. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaypalSellerProtectionStatus { + Eligible, + NotEligible, + PartiallyEligible, +} +impl PaypalSellerProtectionStatus { + pub fn as_str(self) -> &'static str { + use PaypalSellerProtectionStatus::*; + match self { + Eligible => "eligible", + NotEligible => "not_eligible", + PartiallyEligible => "partially_eligible", + } + } +} + +impl std::str::FromStr for PaypalSellerProtectionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use PaypalSellerProtectionStatus::*; + match s { + "eligible" => Ok(Eligible), + "not_eligible" => Ok(NotEligible), + "partially_eligible" => Ok(PartiallyEligible), + _ => Err(()), + } + } +} +impl AsRef for PaypalSellerProtectionStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PaypalSellerProtectionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaypalSellerProtectionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaypalSellerProtectionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaypalSellerProtectionStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PaypalSellerProtectionStatus")) + } +} diff --git a/stripe_types/src/generated/period/mod.rs b/stripe_types/src/generated/period/mod.rs new file mode 100644 index 000000000..099082d36 --- /dev/null +++ b/stripe_types/src/generated/period/mod.rs @@ -0,0 +1,11 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct Period { + /// The end date of this usage period. + /// + /// All usage up to and including this point in time is included. + pub end: Option, + /// The start date of this usage period. + /// + /// All usage after this point in time is included. + pub start: Option, +} diff --git a/stripe_types/src/generated/person/mod.rs b/stripe_types/src/generated/person/mod.rs new file mode 100644 index 000000000..28314bc94 --- /dev/null +++ b/stripe_types/src/generated/person/mod.rs @@ -0,0 +1,168 @@ +/// This is an object representing a person associated with a Stripe account. +/// +/// A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. +/// See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform prefilling and account onboarding steps. +/// +/// Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/handling-api-verification#person-information) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Person { + /// The account the person is associated with. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_tos_acceptances: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option, + /// The Kana variation of the person's address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option, + /// The Kanji variation of the person's address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, + /// The person's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option, + /// The person's first name. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option, + /// The Kana variation of the person's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kana: Option, + /// The Kanji variation of the person's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kanji: Option, + /// A list of alternate names or aliases that the person is known by. + #[serde(skip_serializing_if = "Option::is_none")] + pub full_name_aliases: Option>, + /// Information about the [upcoming new requirements for this person](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when. + #[serde(skip_serializing_if = "Option::is_none")] + pub future_requirements: Option, + /// The person's gender (International regulations require either "male" or "female"). + #[serde(skip_serializing_if = "Option::is_none")] + pub gender: Option, + /// Unique identifier for the object. + pub id: stripe_types::person::PersonId, + /// Whether the person's `id_number` was provided. + /// + /// True if either the full ID number was provided or if only the required part of the ID number was provided (ex. + /// last four of an individual's SSN for the US indicated by `ssn_last_4_provided`). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number_provided: Option, + /// Whether the person's `id_number_secondary` was provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number_secondary_provided: Option, + /// The person's last name. + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option, + /// The Kana variation of the person's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kana: Option, + /// The Kanji variation of the person's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kanji: Option, + /// The person's maiden name. + #[serde(skip_serializing_if = "Option::is_none")] + pub maiden_name: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option>, + /// The country where the person is a national. + #[serde(skip_serializing_if = "Option::is_none")] + pub nationality: Option, + /// The person's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option, + /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + #[serde(skip_serializing_if = "Option::is_none")] + pub political_exposure: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub registered_address: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub relationship: Option, + /// Information about the requirements for this person, including what information needs to be collected, and by when. + #[serde(skip_serializing_if = "Option::is_none")] + pub requirements: Option, + /// Whether the last four digits of the person's Social Security number have been provided (U.S. + /// + /// only). + #[serde(skip_serializing_if = "Option::is_none")] + pub ssn_last_4_provided: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option, +} +/// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PersonPoliticalExposure { + Existing, + None, +} +impl PersonPoliticalExposure { + pub fn as_str(self) -> &'static str { + use PersonPoliticalExposure::*; + match self { + Existing => "existing", + None => "none", + } + } +} + +impl std::str::FromStr for PersonPoliticalExposure { + type Err = (); + fn from_str(s: &str) -> Result { + use PersonPoliticalExposure::*; + match s { + "existing" => Ok(Existing), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for PersonPoliticalExposure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PersonPoliticalExposure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PersonPoliticalExposure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PersonPoliticalExposure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PersonPoliticalExposure { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PersonPoliticalExposure")) + } +} +impl stripe_types::Object for Person { + type Id = stripe_types::person::PersonId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(PersonId, "person_"); diff --git a/stripe_types/src/generated/person_additional_tos_acceptance/mod.rs b/stripe_types/src/generated/person_additional_tos_acceptance/mod.rs new file mode 100644 index 000000000..e0d67e184 --- /dev/null +++ b/stripe_types/src/generated/person_additional_tos_acceptance/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PersonAdditionalTosAcceptance { + /// The Unix timestamp marking when the legal guardian accepted the service agreement. + pub date: Option, + /// The IP address from which the legal guardian accepted the service agreement. + pub ip: Option, + /// The user agent of the browser from which the legal guardian accepted the service agreement. + pub user_agent: Option, +} diff --git a/stripe_types/src/generated/person_additional_tos_acceptances/mod.rs b/stripe_types/src/generated/person_additional_tos_acceptances/mod.rs new file mode 100644 index 000000000..b8909d6b3 --- /dev/null +++ b/stripe_types/src/generated/person_additional_tos_acceptances/mod.rs @@ -0,0 +1,4 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PersonAdditionalTosAcceptances { + pub account: stripe_types::PersonAdditionalTosAcceptance, +} diff --git a/stripe_types/src/generated/person_future_requirements/mod.rs b/stripe_types/src/generated/person_future_requirements/mod.rs new file mode 100644 index 000000000..c6172a4d6 --- /dev/null +++ b/stripe_types/src/generated/person_future_requirements/mod.rs @@ -0,0 +1,25 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PersonFutureRequirements { + /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + pub alternatives: Option>, + /// Fields that need to be collected to keep the person's account enabled. + /// + /// If not collected by the account's `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash, and may immediately become `past_due`, but the account may also be given a grace period depending on the account's enablement state prior to transition. + pub currently_due: Vec, + /// Fields that are `currently_due` and need to be collected again because validation or verification failed. + pub errors: Vec, + /// Fields that need to be collected assuming all volume thresholds are reached. + /// + /// As they become required, they appear in `currently_due` as well, and the account's `future_requirements[current_deadline]` becomes set. + pub eventually_due: Vec, + /// Fields that weren't collected by the account's `requirements.current_deadline`. + /// + /// These fields need to be collected to enable the person's account. + /// New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. + pub past_due: Vec, + /// Fields that may become required depending on the results of verification or review. + /// + /// Will be an empty array unless an asynchronous verification is pending. + /// If verification fails, these fields move to `eventually_due` or `currently_due`. + pub pending_verification: Vec, +} diff --git a/stripe_types/src/generated/person_relationship/mod.rs b/stripe_types/src/generated/person_relationship/mod.rs new file mode 100644 index 000000000..314c314c3 --- /dev/null +++ b/stripe_types/src/generated/person_relationship/mod.rs @@ -0,0 +1,23 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PersonRelationship { + /// Whether the person is a director of the account's legal entity. + /// + /// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + pub director: Option, + /// Whether the person has significant responsibility to control, manage, or direct the organization. + pub executive: Option, + /// Whether the person is the legal guardian of the account's representative. + pub legal_guardian: Option, + /// Whether the person is an owner of the account’s legal entity. + pub owner: Option, + /// The percent owned by the person of the account's legal entity. + pub percent_ownership: Option, + /// Whether the person is authorized as the primary representative of the account. + /// + /// This is the person nominated by the business to provide information about themselves, and general information about the account. + /// There can only be one representative at any given time. + /// At the time the account is created, this person should be set to the person responsible for opening the account. + pub representative: Option, + /// The person's title (e.g., CEO, Support Engineer). + pub title: Option, +} diff --git a/stripe_types/src/generated/person_requirements/mod.rs b/stripe_types/src/generated/person_requirements/mod.rs new file mode 100644 index 000000000..d41658814 --- /dev/null +++ b/stripe_types/src/generated/person_requirements/mod.rs @@ -0,0 +1,24 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PersonRequirements { + /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + pub alternatives: Option>, + /// Fields that need to be collected to keep the person's account enabled. + /// + /// If not collected by the account's `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. + pub currently_due: Vec, + /// Fields that are `currently_due` and need to be collected again because validation or verification failed. + pub errors: Vec, + /// Fields that need to be collected assuming all volume thresholds are reached. + /// + /// As they become required, they appear in `currently_due` as well, and the account's `current_deadline` becomes set. + pub eventually_due: Vec, + /// Fields that weren't collected by the account's `current_deadline`. + /// + /// These fields need to be collected to enable the person's account. + pub past_due: Vec, + /// Fields that may become required depending on the results of verification or review. + /// + /// Will be an empty array unless an asynchronous verification is pending. + /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + pub pending_verification: Vec, +} diff --git a/stripe_types/src/generated/plan/mod.rs b/stripe_types/src/generated/plan/mod.rs new file mode 100644 index 000000000..6ec59475f --- /dev/null +++ b/stripe_types/src/generated/plan/mod.rs @@ -0,0 +1,409 @@ +/// You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). +/// +/// It replaces the Plans API and is backwards compatible to simplify your migration. Plans define the base price, currency, and billing cycle for recurring purchases of products. [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and plans help you track pricing. +/// Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. +/// This approach lets you change prices without having to change your provisioning scheme. For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year. Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](https://stripe.com/docs/products-prices/overview). For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Plan { + /// Whether the plan can be used for new purchases. + pub active: bool, + /// Specifies a usage aggregation strategy for plans of `usage_type=metered`. + /// + /// Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. + /// Defaults to `sum`. + pub aggregate_usage: Option, + /// The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. + /// + /// Only set if `billing_scheme=per_unit`. + pub amount: Option, + /// The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. + /// + /// Only set if `billing_scheme=per_unit`. + pub amount_decimal: Option, + /// Describes how to compute the price per period. + /// + /// Either `per_unit` or `tiered`. + /// `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). + /// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. + pub billing_scheme: PlanBillingScheme, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Unique identifier for the object. + pub id: stripe_types::plan::PlanId, + /// The frequency at which a subscription is billed. + /// + /// One of `day`, `week`, `month` or `year`. + pub interval: PlanInterval, + /// The number of intervals (specified in the `interval` attribute) between subscription billings. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + pub interval_count: u64, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// A brief description of the plan, hidden from customers. + pub nickname: Option, + /// The product whose pricing this plan determines. + pub product: Option>, + /// Each element represents a pricing tier. + /// + /// This parameter requires `billing_scheme` to be set to `tiered`. + /// See also the documentation for `billing_scheme`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers: Option>, + /// Defines if the tiering price should be `graduated` or `volume` based. + /// + /// In `volume`-based tiering, the maximum quantity within a period determines the per unit price. + /// In `graduated` tiering, pricing can change as the quantity grows. + pub tiers_mode: Option, + /// Apply a transformation to the reported usage or set quantity before computing the amount billed. + /// + /// Cannot be combined with `tiers`. + pub transform_usage: Option, + /// Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). + pub trial_period_days: Option, + /// Configures how the quantity per period should be determined. + /// + /// Can be either `metered` or `licensed`. + /// `licensed` automatically bills the `quantity` set when adding it to a subscription. + /// `metered` aggregates the total usage based on usage records. + /// Defaults to `licensed`. + pub usage_type: PlanUsageType, +} +/// Specifies a usage aggregation strategy for plans of `usage_type=metered`. +/// +/// Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. +/// Defaults to `sum`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PlanAggregateUsage { + LastDuringPeriod, + LastEver, + Max, + Sum, +} +impl PlanAggregateUsage { + pub fn as_str(self) -> &'static str { + use PlanAggregateUsage::*; + match self { + LastDuringPeriod => "last_during_period", + LastEver => "last_ever", + Max => "max", + Sum => "sum", + } + } +} + +impl std::str::FromStr for PlanAggregateUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PlanAggregateUsage::*; + match s { + "last_during_period" => Ok(LastDuringPeriod), + "last_ever" => Ok(LastEver), + "max" => Ok(Max), + "sum" => Ok(Sum), + _ => Err(()), + } + } +} +impl AsRef for PlanAggregateUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PlanAggregateUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PlanAggregateUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PlanAggregateUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PlanAggregateUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PlanAggregateUsage")) + } +} +/// Describes how to compute the price per period. +/// +/// Either `per_unit` or `tiered`. +/// `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). +/// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PlanBillingScheme { + PerUnit, + Tiered, +} +impl PlanBillingScheme { + pub fn as_str(self) -> &'static str { + use PlanBillingScheme::*; + match self { + PerUnit => "per_unit", + Tiered => "tiered", + } + } +} + +impl std::str::FromStr for PlanBillingScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use PlanBillingScheme::*; + match s { + "per_unit" => Ok(PerUnit), + "tiered" => Ok(Tiered), + _ => Err(()), + } + } +} +impl AsRef for PlanBillingScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PlanBillingScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PlanBillingScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PlanBillingScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PlanBillingScheme { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PlanBillingScheme")) + } +} +/// The frequency at which a subscription is billed. +/// +/// One of `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PlanInterval { + Day, + Month, + Week, + Year, +} +impl PlanInterval { + pub fn as_str(self) -> &'static str { + use PlanInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for PlanInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use PlanInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for PlanInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PlanInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PlanInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PlanInterval")) + } +} +/// Defines if the tiering price should be `graduated` or `volume` based. +/// +/// In `volume`-based tiering, the maximum quantity within a period determines the per unit price. +/// In `graduated` tiering, pricing can change as the quantity grows. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PlanTiersMode { + Graduated, + Volume, +} +impl PlanTiersMode { + pub fn as_str(self) -> &'static str { + use PlanTiersMode::*; + match self { + Graduated => "graduated", + Volume => "volume", + } + } +} + +impl std::str::FromStr for PlanTiersMode { + type Err = (); + fn from_str(s: &str) -> Result { + use PlanTiersMode::*; + match s { + "graduated" => Ok(Graduated), + "volume" => Ok(Volume), + _ => Err(()), + } + } +} +impl AsRef for PlanTiersMode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PlanTiersMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PlanTiersMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PlanTiersMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PlanTiersMode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PlanTiersMode")) + } +} +/// Configures how the quantity per period should be determined. +/// +/// Can be either `metered` or `licensed`. +/// `licensed` automatically bills the `quantity` set when adding it to a subscription. +/// `metered` aggregates the total usage based on usage records. +/// Defaults to `licensed`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PlanUsageType { + Licensed, + Metered, +} +impl PlanUsageType { + pub fn as_str(self) -> &'static str { + use PlanUsageType::*; + match self { + Licensed => "licensed", + Metered => "metered", + } + } +} + +impl std::str::FromStr for PlanUsageType { + type Err = (); + fn from_str(s: &str) -> Result { + use PlanUsageType::*; + match s { + "licensed" => Ok(Licensed), + "metered" => Ok(Metered), + _ => Err(()), + } + } +} +impl AsRef for PlanUsageType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PlanUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PlanUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PlanUsageType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PlanUsageType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PlanUsageType")) + } +} +impl stripe_types::Object for Plan { + type Id = stripe_types::plan::PlanId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(PlanId); diff --git a/stripe_types/src/generated/plan_tier/mod.rs b/stripe_types/src/generated/plan_tier/mod.rs new file mode 100644 index 000000000..ad338db35 --- /dev/null +++ b/stripe_types/src/generated/plan_tier/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PlanTier { + /// Price for the entire tier. + pub flat_amount: Option, + /// Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. + pub flat_amount_decimal: Option, + /// Per unit price for units relevant to the tier. + pub unit_amount: Option, + /// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + pub unit_amount_decimal: Option, + /// Up to and including to this quantity will be contained in the tier. + pub up_to: Option, +} diff --git a/stripe_types/src/generated/platform_fee/mod.rs b/stripe_types/src/generated/platform_fee/mod.rs new file mode 100644 index 000000000..8d9433f68 --- /dev/null +++ b/stripe_types/src/generated/platform_fee/mod.rs @@ -0,0 +1,43 @@ +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PlatformFee { + /// ID of the Stripe account this fee was taken from. + pub account: stripe_types::Expandable, + /// Amount earned, in cents (or local equivalent). + pub amount: i64, + /// Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the fee if a partial refund was issued). + pub amount_refunded: i64, + /// ID of the Connect application that earned the fee. + pub application: stripe_types::Expandable, + /// Balance transaction that describes the impact of this collected application fee on your account balance (not including refunds). + pub balance_transaction: Option>, + /// ID of the charge that the application fee was taken from. + pub charge: stripe_types::Expandable, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Unique identifier for the object. + pub id: stripe_types::platform_fee::ApplicationFeeId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// ID of the corresponding charge on the platform account, if this fee was the result of a charge using the `destination` parameter. + pub originating_transaction: Option>, + /// Whether the fee has been fully refunded. + /// + /// If the fee is only partially refunded, this attribute will still be false. + pub refunded: bool, + /// A list of refunds that have been applied to the fee. + pub refunds: stripe_types::List, +} +impl stripe_types::Object for PlatformFee { + type Id = stripe_types::platform_fee::ApplicationFeeId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(ApplicationFeeId, "fee_"); diff --git a/stripe_types/src/generated/platform_tax/mod.rs b/stripe_types/src/generated/platform_tax/mod.rs new file mode 100644 index 000000000..7105afe35 --- /dev/null +++ b/stripe_types/src/generated/platform_tax/mod.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PlatformTax { + /// The Connected account that incurred this charge. + pub account: String, + /// Unique identifier for the object. + pub id: stripe_types::platform_tax::PlatformTaxFeeId, + /// The payment object that caused this tax to be inflicted. + pub source_transaction: String, + /// The type of tax (VAT). + #[serde(rename = "type")] + pub type_: String, +} +impl stripe_types::Object for PlatformTax { + type Id = stripe_types::platform_tax::PlatformTaxFeeId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(PlatformTaxFeeId, "ptf_"); diff --git a/stripe_types/src/generated/price/mod.rs b/stripe_types/src/generated/price/mod.rs new file mode 100644 index 000000000..330717464 --- /dev/null +++ b/stripe_types/src/generated/price/mod.rs @@ -0,0 +1,337 @@ +/// Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. +/// [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and prices help you track payment terms. +/// +/// Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. +/// This approach lets you change prices without having to change your provisioning scheme. For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once. Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/products-prices/overview). For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Price { + /// Whether the price can be used for new purchases. + pub active: bool, + /// Describes how to compute the price per period. + /// + /// Either `per_unit` or `tiered`. + /// `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). + /// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. + pub billing_scheme: PriceBillingScheme, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Prices defined in each available currency option. + /// + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: + Option>, + /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + pub custom_unit_amount: Option, + /// Unique identifier for the object. + pub id: stripe_types::price::PriceId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// A lookup key used to retrieve prices dynamically from a static string. + /// + /// This may be up to 200 characters. + pub lookup_key: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// A brief description of the price, hidden from customers. + pub nickname: Option, + /// The ID of the product this price is associated with. + pub product: stripe_types::Expandable, + /// The recurring components of a price such as `interval` and `usage_type`. + pub recurring: Option, + /// 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. + /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + pub tax_behavior: Option, + /// Each element represents a pricing tier. + /// + /// This parameter requires `billing_scheme` to be set to `tiered`. + /// See also the documentation for `billing_scheme`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers: Option>, + /// Defines if the tiering price should be `graduated` or `volume` based. + /// + /// In `volume`-based tiering, the maximum quantity within a period determines the per unit price. + /// In `graduated` tiering, pricing can change as the quantity grows. + pub tiers_mode: Option, + /// Apply a transformation to the reported usage or set quantity before computing the amount billed. + /// + /// Cannot be combined with `tiers`. + pub transform_quantity: Option, + /// One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. + #[serde(rename = "type")] + pub type_: PriceType, + /// The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. + /// + /// Only set if `billing_scheme=per_unit`. + pub unit_amount: Option, + /// The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. + /// + /// Only set if `billing_scheme=per_unit`. + pub unit_amount_decimal: Option, +} +/// Describes how to compute the price per period. +/// +/// Either `per_unit` or `tiered`. +/// `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). +/// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PriceBillingScheme { + PerUnit, + Tiered, +} +impl PriceBillingScheme { + pub fn as_str(self) -> &'static str { + use PriceBillingScheme::*; + match self { + PerUnit => "per_unit", + Tiered => "tiered", + } + } +} + +impl std::str::FromStr for PriceBillingScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use PriceBillingScheme::*; + match s { + "per_unit" => Ok(PerUnit), + "tiered" => Ok(Tiered), + _ => Err(()), + } + } +} +impl AsRef for PriceBillingScheme { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PriceBillingScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PriceBillingScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PriceBillingScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PriceBillingScheme { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PriceBillingScheme")) + } +} +/// 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. +/// +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PriceTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl PriceTaxBehavior { + pub fn as_str(self) -> &'static str { + use PriceTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for PriceTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use PriceTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for PriceTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PriceTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PriceTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PriceTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PriceTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PriceTaxBehavior")) + } +} +/// Defines if the tiering price should be `graduated` or `volume` based. +/// +/// In `volume`-based tiering, the maximum quantity within a period determines the per unit price. +/// In `graduated` tiering, pricing can change as the quantity grows. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PriceTiersMode { + Graduated, + Volume, +} +impl PriceTiersMode { + pub fn as_str(self) -> &'static str { + use PriceTiersMode::*; + match self { + Graduated => "graduated", + Volume => "volume", + } + } +} + +impl std::str::FromStr for PriceTiersMode { + type Err = (); + fn from_str(s: &str) -> Result { + use PriceTiersMode::*; + match s { + "graduated" => Ok(Graduated), + "volume" => Ok(Volume), + _ => Err(()), + } + } +} +impl AsRef for PriceTiersMode { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PriceTiersMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PriceTiersMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PriceTiersMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PriceTiersMode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PriceTiersMode")) + } +} +/// One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PriceType { + OneTime, + Recurring, +} +impl PriceType { + pub fn as_str(self) -> &'static str { + use PriceType::*; + match self { + OneTime => "one_time", + Recurring => "recurring", + } + } +} + +impl std::str::FromStr for PriceType { + type Err = (); + fn from_str(s: &str) -> Result { + use PriceType::*; + match s { + "one_time" => Ok(OneTime), + "recurring" => Ok(Recurring), + _ => Err(()), + } + } +} +impl AsRef for PriceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for PriceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PriceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PriceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PriceType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PriceType")) + } +} +impl stripe_types::Object for Price { + type Id = stripe_types::price::PriceId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(PriceId, "price_"); diff --git a/stripe_types/src/generated/price_tier/mod.rs b/stripe_types/src/generated/price_tier/mod.rs new file mode 100644 index 000000000..6cd47e0a1 --- /dev/null +++ b/stripe_types/src/generated/price_tier/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PriceTier { + /// Price for the entire tier. + pub flat_amount: Option, + /// Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. + pub flat_amount_decimal: Option, + /// Per unit price for units relevant to the tier. + pub unit_amount: Option, + /// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + pub unit_amount_decimal: Option, + /// Up to and including to this quantity will be contained in the tier. + pub up_to: Option, +} diff --git a/stripe_types/src/generated/product/mod.rs b/stripe_types/src/generated/product/mod.rs new file mode 100644 index 000000000..b089ee55f --- /dev/null +++ b/stripe_types/src/generated/product/mod.rs @@ -0,0 +1,136 @@ +/// Products describe the specific goods or services you offer to your customers. +/// For example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product. +/// They can be used in conjunction with [Prices](https://stripe.com/docs/api#prices) to configure pricing in Payment Links, Checkout, and Subscriptions. +/// +/// Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), +/// [share a Payment Link](https://stripe.com/docs/payment-links), +/// [accept payments with Checkout](https://stripe.com/docs/payments/accept-a-payment#create-product-prices-upfront), +/// and more about [Products and Prices](https://stripe.com/docs/products-prices/overview) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Product { + /// Whether the product is currently available for purchase. + pub active: bool, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_price: Option>, + /// The product's description, meant to be displayable to the customer. + /// + /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + pub description: Option, + /// A list of up to 15 features for this product. + /// + /// These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). + pub features: Vec, + /// Unique identifier for the object. + pub id: stripe_types::product::ProductId, + /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + pub images: Vec, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The product's name, meant to be displayable to the customer. + pub name: String, + /// The dimensions of this product for shipping purposes. + pub package_dimensions: Option, + /// Whether this product is shipped (i.e., physical goods). + pub shippable: Option, + /// Extra information about a product which will appear on your customer's credit card statement. + /// + /// In the case that multiple products are billed at once, the first statement descriptor will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + pub tax_code: Option>, + /// The type of the product. + /// + /// The product is either of type `good`, which is eligible for use with Orders and SKUs, or `service`, which is eligible for use with Subscriptions and Plans. + #[serde(rename = "type")] + pub type_: ProductType, + /// A label that represents units of this product. + /// + /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_label: Option, + /// Time at which the object was last updated. + /// + /// Measured in seconds since the Unix epoch. + pub updated: stripe_types::Timestamp, + /// A URL of a publicly-accessible webpage for this product. + pub url: Option, +} +/// The type of the product. +/// +/// The product is either of type `good`, which is eligible for use with Orders and SKUs, or `service`, which is eligible for use with Subscriptions and Plans. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ProductType { + Good, + Service, +} +impl ProductType { + pub fn as_str(self) -> &'static str { + use ProductType::*; + match self { + Good => "good", + Service => "service", + } + } +} + +impl std::str::FromStr for ProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use ProductType::*; + match s { + "good" => Ok(Good), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl AsRef for ProductType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ProductType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ProductType")) + } +} +impl stripe_types::Object for Product { + type Id = stripe_types::product::ProductId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(ProductId); diff --git a/stripe_types/src/generated/product_feature/mod.rs b/stripe_types/src/generated/product_feature/mod.rs new file mode 100644 index 000000000..86a5e41ae --- /dev/null +++ b/stripe_types/src/generated/product_feature/mod.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct ProductFeature { + /// The feature's name. + /// + /// Up to 80 characters long. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, +} diff --git a/stripe_types/src/generated/promotion_code/mod.rs b/stripe_types/src/generated/promotion_code/mod.rs new file mode 100644 index 000000000..b6f6a802d --- /dev/null +++ b/stripe_types/src/generated/promotion_code/mod.rs @@ -0,0 +1,43 @@ +/// A Promotion Code represents a customer-redeemable code for a [coupon](https://stripe.com/docs/api#coupons). +/// +/// It can be used to create multiple codes for a single coupon. For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PromotionCode { + /// Whether the promotion code is currently active. + /// + /// A promotion code is only active if the coupon is also valid. + pub active: bool, + /// The customer-facing code. + /// + /// Regardless of case, this code must be unique across all active promotion codes for each customer. + pub code: String, + pub coupon: stripe_types::Coupon, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The customer that this promotion code can be used by. + pub customer: Option>, + /// Date at which the promotion code can no longer be redeemed. + pub expires_at: Option, + /// Unique identifier for the object. + pub id: stripe_types::promotion_code::PromotionCodeId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Maximum number of times this promotion code can be redeemed. + pub max_redemptions: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + pub restrictions: stripe_types::PromotionCodesResourceRestrictions, + /// Number of times this promotion code has been used. + pub times_redeemed: i64, +} +impl stripe_types::Object for PromotionCode { + type Id = stripe_types::promotion_code::PromotionCodeId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(PromotionCodeId, "promo_"); diff --git a/stripe_types/src/generated/promotion_code_currency_option/mod.rs b/stripe_types/src/generated/promotion_code_currency_option/mod.rs new file mode 100644 index 000000000..87758d03e --- /dev/null +++ b/stripe_types/src/generated/promotion_code_currency_option/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PromotionCodeCurrencyOption { + /// Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + pub minimum_amount: i64, +} diff --git a/stripe_types/src/generated/promotion_codes_resource_restrictions/mod.rs b/stripe_types/src/generated/promotion_codes_resource_restrictions/mod.rs new file mode 100644 index 000000000..9ad362db8 --- /dev/null +++ b/stripe_types/src/generated/promotion_codes_resource_restrictions/mod.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PromotionCodesResourceRestrictions { + /// Promotion code restrictions defined in each available currency option. + /// + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + std::collections::HashMap< + stripe_types::Currency, + stripe_types::PromotionCodeCurrencyOption, + >, + >, + /// A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices. + pub first_time_transaction: bool, + /// Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + pub minimum_amount: Option, + /// Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount. + pub minimum_amount_currency: Option, +} diff --git a/stripe_types/src/generated/quote/mod.rs b/stripe_types/src/generated/quote/mod.rs new file mode 100644 index 000000000..3b50295c7 --- /dev/null +++ b/stripe_types/src/generated/quote/mod.rs @@ -0,0 +1,232 @@ +/// A Quote is a way to model prices that you'd like to provide to a customer. +/// Once accepted, it will automatically create an invoice, subscription or subscription schedule. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Quote { + /// Total before any discounts or taxes are applied. + pub amount_subtotal: i64, + /// Total after discounts and taxes are applied. + pub amount_total: i64, + /// ID of the Connect Application that created the quote. + pub application: Option>, + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// + /// Only applicable if there are no line items with recurring prices on the quote. + pub application_fee_amount: Option, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// Only applicable if there are line items with recurring prices on the quote. + pub application_fee_percent: Option, + pub automatic_tax: stripe_types::QuotesResourceAutomaticTax, + /// Either `charge_automatically`, or `send_invoice`. + /// + /// When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically`. + pub collection_method: QuoteCollectionMethod, + pub computed: stripe_types::QuotesResourceComputed, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: Option, + /// The customer which this quote belongs to. + /// + /// A customer is required before finalizing the quote. + /// Once specified, it cannot be changed. + pub customer: Option>, + /// The tax rates applied to this quote. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option>>, + /// A description that will be displayed on the quote PDF. + pub description: Option, + /// The discounts applied to this quote. + pub discounts: Vec>, + /// The date on which the quote will be canceled if in `open` or `draft` status. + /// + /// Measured in seconds since the Unix epoch. + pub expires_at: stripe_types::Timestamp, + /// A footer that will be displayed on the quote PDF. + pub footer: Option, + /// Details of the quote that was cloned. + /// + /// See the [cloning documentation](https://stripe.com/docs/quotes/clone) for more details. + pub from_quote: Option, + /// A header that will be displayed on the quote PDF. + pub header: Option, + /// Unique identifier for the object. + pub id: stripe_types::quote::QuoteId, + /// The invoice that was created from this quote. + pub invoice: Option>, + /// All invoices will be billed using the specified settings. + pub invoice_settings: Option, + /// A list of items the customer is being quoted for. + #[serde(default)] + pub line_items: stripe_types::List, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// A unique number that identifies this particular quote. + /// + /// This number is assigned once the quote is [finalized](https://stripe.com/docs/quotes/overview#finalize). + pub number: Option, + /// The account on behalf of which to charge. + /// + /// See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. + pub on_behalf_of: Option>, + /// The status of the quote. + pub status: QuoteStatus, + pub status_transitions: stripe_types::QuotesResourceStatusTransitions, + /// The subscription that was created or updated from this quote. + pub subscription: Option>, + pub subscription_data: stripe_types::QuotesResourceSubscriptionDataSubscriptionData, + /// The subscription schedule that was created or updated from this quote. + pub subscription_schedule: Option>, + /// ID of the test clock this quote belongs to. + pub test_clock: Option>, + pub total_details: stripe_types::QuotesResourceTotalDetails, + /// The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices. + pub transfer_data: Option, +} +/// Either `charge_automatically`, or `send_invoice`. +/// +/// When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +/// Defaults to `charge_automatically`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum QuoteCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl QuoteCollectionMethod { + pub fn as_str(self) -> &'static str { + use QuoteCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for QuoteCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use QuoteCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl AsRef for QuoteCollectionMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for QuoteCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for QuoteCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for QuoteCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for QuoteCollectionMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for QuoteCollectionMethod")) + } +} +/// The status of the quote. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum QuoteStatus { + Accepted, + Canceled, + Draft, + Open, +} +impl QuoteStatus { + pub fn as_str(self) -> &'static str { + use QuoteStatus::*; + match self { + Accepted => "accepted", + Canceled => "canceled", + Draft => "draft", + Open => "open", + } + } +} + +impl std::str::FromStr for QuoteStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use QuoteStatus::*; + match s { + "accepted" => Ok(Accepted), + "canceled" => Ok(Canceled), + "draft" => Ok(Draft), + "open" => Ok(Open), + _ => Err(()), + } + } +} +impl AsRef for QuoteStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for QuoteStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for QuoteStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for QuoteStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for QuoteStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for QuoteStatus")) + } +} +impl stripe_types::Object for Quote { + type Id = stripe_types::quote::QuoteId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(QuoteId, "qt_"); diff --git a/stripe_types/src/generated/quotes_resource_automatic_tax/mod.rs b/stripe_types/src/generated/quotes_resource_automatic_tax/mod.rs new file mode 100644 index 000000000..6689efb5a --- /dev/null +++ b/stripe_types/src/generated/quotes_resource_automatic_tax/mod.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceAutomaticTax { + /// Automatically calculate taxes. + pub enabled: bool, + /// The status of the most recent automated tax calculation for this quote. + pub status: Option, +} +/// The status of the most recent automated tax calculation for this quote. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum QuotesResourceAutomaticTaxStatus { + Complete, + Failed, + RequiresLocationInputs, +} +impl QuotesResourceAutomaticTaxStatus { + pub fn as_str(self) -> &'static str { + use QuotesResourceAutomaticTaxStatus::*; + match self { + Complete => "complete", + Failed => "failed", + RequiresLocationInputs => "requires_location_inputs", + } + } +} + +impl std::str::FromStr for QuotesResourceAutomaticTaxStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use QuotesResourceAutomaticTaxStatus::*; + match s { + "complete" => Ok(Complete), + "failed" => Ok(Failed), + "requires_location_inputs" => Ok(RequiresLocationInputs), + _ => Err(()), + } + } +} +impl AsRef for QuotesResourceAutomaticTaxStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for QuotesResourceAutomaticTaxStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for QuotesResourceAutomaticTaxStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for QuotesResourceAutomaticTaxStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for QuotesResourceAutomaticTaxStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for QuotesResourceAutomaticTaxStatus") + }) + } +} diff --git a/stripe_types/src/generated/quotes_resource_computed/mod.rs b/stripe_types/src/generated/quotes_resource_computed/mod.rs new file mode 100644 index 000000000..88837e351 --- /dev/null +++ b/stripe_types/src/generated/quotes_resource_computed/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceComputed { + /// The definitive totals and line items the customer will be charged on a recurring basis. + /// + /// Takes into account the line items with recurring prices and discounts with `duration=forever` coupons only. + /// Defaults to `null` if no inputted line items with recurring prices. + pub recurring: Option, + pub upfront: stripe_types::QuotesResourceUpfront, +} diff --git a/stripe_types/src/generated/quotes_resource_from_quote/mod.rs b/stripe_types/src/generated/quotes_resource_from_quote/mod.rs new file mode 100644 index 000000000..5310c0e24 --- /dev/null +++ b/stripe_types/src/generated/quotes_resource_from_quote/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceFromQuote { + /// Whether this quote is a revision of a different quote. + pub is_revision: bool, + /// The quote that was cloned. + pub quote: stripe_types::Expandable, +} diff --git a/stripe_types/src/generated/quotes_resource_recurring/mod.rs b/stripe_types/src/generated/quotes_resource_recurring/mod.rs new file mode 100644 index 000000000..474e108fb --- /dev/null +++ b/stripe_types/src/generated/quotes_resource_recurring/mod.rs @@ -0,0 +1,84 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceRecurring { + /// Total before any discounts or taxes are applied. + pub amount_subtotal: i64, + /// Total after discounts and taxes are applied. + pub amount_total: i64, + /// The frequency at which a subscription is billed. + /// + /// One of `day`, `week`, `month` or `year`. + pub interval: QuotesResourceRecurringInterval, + /// The number of intervals (specified in the `interval` attribute) between subscription billings. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + pub interval_count: u64, + pub total_details: stripe_types::QuotesResourceTotalDetails, +} +/// The frequency at which a subscription is billed. +/// +/// One of `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum QuotesResourceRecurringInterval { + Day, + Month, + Week, + Year, +} +impl QuotesResourceRecurringInterval { + pub fn as_str(self) -> &'static str { + use QuotesResourceRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for QuotesResourceRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use QuotesResourceRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for QuotesResourceRecurringInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for QuotesResourceRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for QuotesResourceRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for QuotesResourceRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for QuotesResourceRecurringInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for QuotesResourceRecurringInterval") + }) + } +} diff --git a/stripe_types/src/generated/quotes_resource_status_transitions/mod.rs b/stripe_types/src/generated/quotes_resource_status_transitions/mod.rs new file mode 100644 index 000000000..97ed3b9aa --- /dev/null +++ b/stripe_types/src/generated/quotes_resource_status_transitions/mod.rs @@ -0,0 +1,15 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceStatusTransitions { + /// The time that the quote was accepted. + /// + /// Measured in seconds since Unix epoch. + pub accepted_at: Option, + /// The time that the quote was canceled. + /// + /// Measured in seconds since Unix epoch. + pub canceled_at: Option, + /// The time that the quote was finalized. + /// + /// Measured in seconds since Unix epoch. + pub finalized_at: Option, +} diff --git a/stripe_types/src/generated/quotes_resource_subscription_data_subscription_data/mod.rs b/stripe_types/src/generated/quotes_resource_subscription_data_subscription_data/mod.rs new file mode 100644 index 000000000..7004ab115 --- /dev/null +++ b/stripe_types/src/generated/quotes_resource_subscription_data_subscription_data/mod.rs @@ -0,0 +1,21 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceSubscriptionDataSubscriptionData { + /// The subscription's description, meant to be displayable to the customer. + /// + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + pub description: Option, + /// When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. + /// + /// This date is ignored if it is in the past when the quote is accepted. + /// Measured in seconds since the Unix epoch. + pub effective_date: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. + /// + /// If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. + /// If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. + /// Unlike object-level metadata, this field is declarative. + /// Updates will clear prior values. + pub metadata: Option>, + /// Integer representing the number of trial period days before the customer is charged for the first time. + pub trial_period_days: Option, +} diff --git a/stripe_types/src/generated/quotes_resource_total_details/mod.rs b/stripe_types/src/generated/quotes_resource_total_details/mod.rs new file mode 100644 index 000000000..3e2a74ce5 --- /dev/null +++ b/stripe_types/src/generated/quotes_resource_total_details/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceTotalDetails { + /// This is the sum of all the discounts. + pub amount_discount: i64, + /// This is the sum of all the shipping amounts. + pub amount_shipping: Option, + /// This is the sum of all the tax amounts. + pub amount_tax: i64, + #[serde(skip_serializing_if = "Option::is_none")] + pub breakdown: Option, +} diff --git a/stripe_types/src/generated/quotes_resource_total_details_resource_breakdown/mod.rs b/stripe_types/src/generated/quotes_resource_total_details_resource_breakdown/mod.rs new file mode 100644 index 000000000..2d7a7de7d --- /dev/null +++ b/stripe_types/src/generated/quotes_resource_total_details_resource_breakdown/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceTotalDetailsResourceBreakdown { + /// The aggregated discounts. + pub discounts: Vec, + /// The aggregated tax amounts by rate. + pub taxes: Vec, +} diff --git a/stripe_types/src/generated/quotes_resource_transfer_data/mod.rs b/stripe_types/src/generated/quotes_resource_transfer_data/mod.rs new file mode 100644 index 000000000..1ae1c3eaf --- /dev/null +++ b/stripe_types/src/generated/quotes_resource_transfer_data/mod.rs @@ -0,0 +1,14 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceTransferData { + /// The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. + /// + /// By default, the entire amount is transferred to the destination. + pub amount: Option, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. + /// By default, the entire amount will be transferred to the destination. + pub amount_percent: Option, + /// The account where funds from the payment will be transferred to upon payment success. + pub destination: stripe_types::Expandable, +} diff --git a/stripe_types/src/generated/quotes_resource_upfront/mod.rs b/stripe_types/src/generated/quotes_resource_upfront/mod.rs new file mode 100644 index 000000000..7a3a67317 --- /dev/null +++ b/stripe_types/src/generated/quotes_resource_upfront/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceUpfront { + /// Total before any discounts or taxes are applied. + pub amount_subtotal: i64, + /// Total after discounts and taxes are applied. + pub amount_total: i64, + /// The line items that will appear on the next invoice after this quote is accepted. + /// + /// This does not include pending invoice items that exist on the customer but may still be included in the next invoice. + #[serde(default)] + pub line_items: stripe_types::List, + pub total_details: stripe_types::QuotesResourceTotalDetails, +} diff --git a/stripe_types/src/generated/radar_radar_options/mod.rs b/stripe_types/src/generated/radar_radar_options/mod.rs new file mode 100644 index 000000000..81f65a281 --- /dev/null +++ b/stripe_types/src/generated/radar_radar_options/mod.rs @@ -0,0 +1,9 @@ +/// Options to configure Radar. +/// +/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct RadarRadarOptions { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option, +} diff --git a/stripe_types/src/generated/radar_review/mod.rs b/stripe_types/src/generated/radar_review/mod.rs new file mode 100644 index 000000000..b9c7ab263 --- /dev/null +++ b/stripe_types/src/generated/radar_review/mod.rs @@ -0,0 +1,184 @@ +/// Reviews can be used to supplement automated fraud detection with human expertise. +/// +/// Learn more about [Radar](/radar) and reviewing payments +/// [here](https://stripe.com/docs/radar/reviews). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct RadarReview { + /// The ZIP or postal code of the card used, if applicable. + pub billing_zip: Option, + /// The charge associated with this review. + pub charge: Option>, + /// The reason the review was closed, or null if it has not yet been closed. + /// + /// One of `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. + pub closed_reason: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Unique identifier for the object. + pub id: stripe_types::radar_review::ReviewId, + /// The IP address where the payment originated. + pub ip_address: Option, + /// Information related to the location of the payment. + /// + /// Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address. + pub ip_address_location: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// If `true`, the review needs action. + pub open: bool, + /// The reason the review was opened. + /// + /// One of `rule` or `manual`. + pub opened_reason: RadarReviewOpenedReason, + /// The PaymentIntent ID associated with this review, if one exists. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option>, + /// The reason the review is currently open or closed. + /// + /// One of `rule`, `manual`, `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. + pub reason: String, + /// Information related to the browsing session of the user who initiated the payment. + pub session: Option, +} +/// The reason the review was closed, or null if it has not yet been closed. +/// +/// One of `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum RadarReviewClosedReason { + Approved, + Disputed, + Redacted, + Refunded, + RefundedAsFraud, +} +impl RadarReviewClosedReason { + pub fn as_str(self) -> &'static str { + use RadarReviewClosedReason::*; + match self { + Approved => "approved", + Disputed => "disputed", + Redacted => "redacted", + Refunded => "refunded", + RefundedAsFraud => "refunded_as_fraud", + } + } +} + +impl std::str::FromStr for RadarReviewClosedReason { + type Err = (); + fn from_str(s: &str) -> Result { + use RadarReviewClosedReason::*; + match s { + "approved" => Ok(Approved), + "disputed" => Ok(Disputed), + "redacted" => Ok(Redacted), + "refunded" => Ok(Refunded), + "refunded_as_fraud" => Ok(RefundedAsFraud), + _ => Err(()), + } + } +} +impl AsRef for RadarReviewClosedReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for RadarReviewClosedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for RadarReviewClosedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for RadarReviewClosedReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for RadarReviewClosedReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for RadarReviewClosedReason")) + } +} +/// The reason the review was opened. +/// +/// One of `rule` or `manual`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum RadarReviewOpenedReason { + Manual, + Rule, +} +impl RadarReviewOpenedReason { + pub fn as_str(self) -> &'static str { + use RadarReviewOpenedReason::*; + match self { + Manual => "manual", + Rule => "rule", + } + } +} + +impl std::str::FromStr for RadarReviewOpenedReason { + type Err = (); + fn from_str(s: &str) -> Result { + use RadarReviewOpenedReason::*; + match s { + "manual" => Ok(Manual), + "rule" => Ok(Rule), + _ => Err(()), + } + } +} +impl AsRef for RadarReviewOpenedReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for RadarReviewOpenedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for RadarReviewOpenedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for RadarReviewOpenedReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for RadarReviewOpenedReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for RadarReviewOpenedReason")) + } +} +impl stripe_types::Object for RadarReview { + type Id = stripe_types::radar_review::ReviewId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(ReviewId, "prv_"); diff --git a/stripe_types/src/generated/radar_review_resource_location/mod.rs b/stripe_types/src/generated/radar_review_resource_location/mod.rs new file mode 100644 index 000000000..a658c5806 --- /dev/null +++ b/stripe_types/src/generated/radar_review_resource_location/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct RadarReviewResourceLocation { + /// The city where the payment originated. + pub city: Option, + /// Two-letter ISO code representing the country where the payment originated. + pub country: Option, + /// The geographic latitude where the payment originated. + pub latitude: Option, + /// The geographic longitude where the payment originated. + pub longitude: Option, + /// The state/county/province/region where the payment originated. + pub region: Option, +} diff --git a/stripe_types/src/generated/radar_review_resource_session/mod.rs b/stripe_types/src/generated/radar_review_resource_session/mod.rs new file mode 100644 index 000000000..5bc93e651 --- /dev/null +++ b/stripe_types/src/generated/radar_review_resource_session/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct RadarReviewResourceSession { + /// The browser used in this browser session (e.g., `Chrome`). + pub browser: Option, + /// Information about the device used for the browser session (e.g., `Samsung SM-G930T`). + pub device: Option, + /// The platform for the browser session (e.g., `Macintosh`). + pub platform: Option, + /// The version for the browser session (e.g., `61.0.3163.100`). + pub version: Option, +} diff --git a/stripe_types/src/generated/radar_rule/mod.rs b/stripe_types/src/generated/radar_rule/mod.rs new file mode 100644 index 000000000..ceb501b19 --- /dev/null +++ b/stripe_types/src/generated/radar_rule/mod.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct RadarRule { + /// The action taken on the payment. + pub action: String, + /// Unique identifier for the object. + pub id: stripe_types::radar_rule::RuleId, + /// The predicate to evaluate the payment against. + pub predicate: String, +} +impl stripe_types::Object for RadarRule { + type Id = stripe_types::radar_rule::RuleId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(RuleId); diff --git a/stripe_types/src/generated/recurring/mod.rs b/stripe_types/src/generated/recurring/mod.rs new file mode 100644 index 000000000..4b5f880be --- /dev/null +++ b/stripe_types/src/generated/recurring/mod.rs @@ -0,0 +1,224 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Recurring { + /// Specifies a usage aggregation strategy for prices of `usage_type=metered`. + /// + /// Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. + /// Defaults to `sum`. + pub aggregate_usage: Option, + /// The frequency at which a subscription is billed. + /// + /// One of `day`, `week`, `month` or `year`. + pub interval: RecurringInterval, + /// The number of intervals (specified in the `interval` attribute) between subscription billings. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + pub interval_count: u64, + /// Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). + pub trial_period_days: Option, + /// Configures how the quantity per period should be determined. + /// + /// Can be either `metered` or `licensed`. + /// `licensed` automatically bills the `quantity` set when adding it to a subscription. + /// `metered` aggregates the total usage based on usage records. + /// Defaults to `licensed`. + pub usage_type: RecurringUsageType, +} +/// Specifies a usage aggregation strategy for prices of `usage_type=metered`. +/// +/// Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. +/// Defaults to `sum`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum RecurringAggregateUsage { + LastDuringPeriod, + LastEver, + Max, + Sum, +} +impl RecurringAggregateUsage { + pub fn as_str(self) -> &'static str { + use RecurringAggregateUsage::*; + match self { + LastDuringPeriod => "last_during_period", + LastEver => "last_ever", + Max => "max", + Sum => "sum", + } + } +} + +impl std::str::FromStr for RecurringAggregateUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use RecurringAggregateUsage::*; + match s { + "last_during_period" => Ok(LastDuringPeriod), + "last_ever" => Ok(LastEver), + "max" => Ok(Max), + "sum" => Ok(Sum), + _ => Err(()), + } + } +} +impl AsRef for RecurringAggregateUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for RecurringAggregateUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for RecurringAggregateUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for RecurringAggregateUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for RecurringAggregateUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for RecurringAggregateUsage")) + } +} +/// The frequency at which a subscription is billed. +/// +/// One of `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum RecurringInterval { + Day, + Month, + Week, + Year, +} +impl RecurringInterval { + pub fn as_str(self) -> &'static str { + use RecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for RecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use RecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for RecurringInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for RecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for RecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for RecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for RecurringInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for RecurringInterval")) + } +} +/// Configures how the quantity per period should be determined. +/// +/// Can be either `metered` or `licensed`. +/// `licensed` automatically bills the `quantity` set when adding it to a subscription. +/// `metered` aggregates the total usage based on usage records. +/// Defaults to `licensed`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum RecurringUsageType { + Licensed, + Metered, +} +impl RecurringUsageType { + pub fn as_str(self) -> &'static str { + use RecurringUsageType::*; + match self { + Licensed => "licensed", + Metered => "metered", + } + } +} + +impl std::str::FromStr for RecurringUsageType { + type Err = (); + fn from_str(s: &str) -> Result { + use RecurringUsageType::*; + match s { + "licensed" => Ok(Licensed), + "metered" => Ok(Metered), + _ => Err(()), + } + } +} +impl AsRef for RecurringUsageType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for RecurringUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for RecurringUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for RecurringUsageType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for RecurringUsageType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for RecurringUsageType")) + } +} diff --git a/stripe_types/src/generated/refund/mod.rs b/stripe_types/src/generated/refund/mod.rs new file mode 100644 index 000000000..ae8a32844 --- /dev/null +++ b/stripe_types/src/generated/refund/mod.rs @@ -0,0 +1,137 @@ +/// Refund objects allow you to refund a previously created charge that isn't +/// refunded yet. +/// +/// Funds are refunded to the credit or debit card that's initially charged. Related guide: [Refunds](https://stripe.com/docs/refunds) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Refund { + /// Amount, in cents (or local equivalent). + pub amount: i64, + /// Balance transaction that describes the impact on your account balance. + pub balance_transaction: Option>, + /// ID of the charge that's refunded. + pub charge: Option>, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// You can use this for displaying to users (available on non-card refunds only). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// After the refund fails, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub failure_balance_transaction: + Option>, + /// Provides the reason for the refund failure. + /// + /// Possible values are: `lost_or_stolen_card`, `expired_or_canceled_card`, `charge_for_pending_refund_disputed`, `insufficient_funds`, `declined`, `merchant_request`, or `unknown`. + #[serde(skip_serializing_if = "Option::is_none")] + pub failure_reason: Option, + /// Unique identifier for the object. + pub id: stripe_types::refund::RefundId, + /// For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions. + #[serde(skip_serializing_if = "Option::is_none")] + pub instructions_email: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub next_action: Option, + /// ID of the PaymentIntent that's refunded. + pub payment_intent: Option>, + /// Reason for the refund, which is either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`). + pub reason: Option, + /// This is the transaction number that appears on email receipts sent for this refund. + pub receipt_number: Option, + /// The transfer reversal that's associated with the refund. + /// + /// Only present if the charge came from another Stripe account. + pub source_transfer_reversal: Option>, + /// Status of the refund. + /// + /// For credit card refunds, this can be `pending`, `succeeded`, or `failed`. + /// For other types of refunds, it can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. + /// Learn more about [failed refunds](https://stripe.com/docs/refunds#failed-refunds). + pub status: Option, + /// This refers to the transfer reversal object if the accompanying transfer reverses. + /// + /// This is only applicable if the charge was created using the destination parameter. + pub transfer_reversal: Option>, +} +/// Reason for the refund, which is either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum RefundReason { + Duplicate, + ExpiredUncapturedCharge, + Fraudulent, + RequestedByCustomer, +} +impl RefundReason { + pub fn as_str(self) -> &'static str { + use RefundReason::*; + match self { + Duplicate => "duplicate", + ExpiredUncapturedCharge => "expired_uncaptured_charge", + Fraudulent => "fraudulent", + RequestedByCustomer => "requested_by_customer", + } + } +} + +impl std::str::FromStr for RefundReason { + type Err = (); + fn from_str(s: &str) -> Result { + use RefundReason::*; + match s { + "duplicate" => Ok(Duplicate), + "expired_uncaptured_charge" => Ok(ExpiredUncapturedCharge), + "fraudulent" => Ok(Fraudulent), + "requested_by_customer" => Ok(RequestedByCustomer), + _ => Err(()), + } + } +} +impl AsRef for RefundReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for RefundReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for RefundReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for RefundReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for RefundReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for RefundReason")) + } +} +impl stripe_types::Object for Refund { + type Id = stripe_types::refund::RefundId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(RefundId, "re_" | "pyr_"); diff --git a/stripe_types/src/generated/refund_next_action/mod.rs b/stripe_types/src/generated/refund_next_action/mod.rs new file mode 100644 index 000000000..e2856ed36 --- /dev/null +++ b/stripe_types/src/generated/refund_next_action/mod.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct RefundNextAction { + /// Contains the refund details. + pub display_details: Option, + /// Type of the next action to perform. + #[serde(rename = "type")] + pub type_: String, +} diff --git a/stripe_types/src/generated/refund_next_action_display_details/mod.rs b/stripe_types/src/generated/refund_next_action_display_details/mod.rs new file mode 100644 index 000000000..a8edaee09 --- /dev/null +++ b/stripe_types/src/generated/refund_next_action_display_details/mod.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct RefundNextActionDisplayDetails { + pub email_sent: stripe_types::EmailSent, + /// The expiry timestamp. + pub expires_at: stripe_types::Timestamp, +} diff --git a/stripe_types/src/generated/reserve_transaction/mod.rs b/stripe_types/src/generated/reserve_transaction/mod.rs new file mode 100644 index 000000000..120146eaf --- /dev/null +++ b/stripe_types/src/generated/reserve_transaction/mod.rs @@ -0,0 +1,21 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ReserveTransaction { + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// Unique identifier for the object. + pub id: stripe_types::reserve_transaction::ReserveTransactionId, +} +impl stripe_types::Object for ReserveTransaction { + type Id = stripe_types::reserve_transaction::ReserveTransactionId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(ReserveTransactionId, "rtx_"); diff --git a/stripe_types/src/generated/schedules_phase_automatic_tax/mod.rs b/stripe_types/src/generated/schedules_phase_automatic_tax/mod.rs new file mode 100644 index 000000000..b1c913da7 --- /dev/null +++ b/stripe_types/src/generated/schedules_phase_automatic_tax/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SchedulesPhaseAutomaticTax { + /// Whether Stripe automatically computes tax on invoices created during this phase. + pub enabled: bool, +} diff --git a/stripe_types/src/generated/sepa_debit_generated_from/mod.rs b/stripe_types/src/generated/sepa_debit_generated_from/mod.rs new file mode 100644 index 000000000..91d93e649 --- /dev/null +++ b/stripe_types/src/generated/sepa_debit_generated_from/mod.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SepaDebitGeneratedFrom { + /// The ID of the Charge that generated this PaymentMethod, if any. + pub charge: Option>, + /// The ID of the SetupAttempt that generated this PaymentMethod, if any. + pub setup_attempt: + Option>, +} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details/mod.rs new file mode 100644 index 000000000..f84de7ffc --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details/mod.rs @@ -0,0 +1,39 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// The type of the payment method used in the SetupIntent (e.g., `card`). + /// + /// An additional hash is included on `payment_method_details` with a name matching this value. + /// It contains confirmation-specific information for the payment method. + #[serde(rename = "type")] + pub type_: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details_acss_debit/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details_acss_debit/mod.rs new file mode 100644 index 000000000..59426ea77 --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details_acss_debit/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsAcssDebit {} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details_au_becs_debit/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details_au_becs_debit/mod.rs new file mode 100644 index 000000000..092b15c74 --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details_au_becs_debit/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsAuBecsDebit {} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details_bacs_debit/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details_bacs_debit/mod.rs new file mode 100644 index 000000000..39be12ee4 --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details_bacs_debit/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsBacsDebit {} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details_bancontact/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details_bancontact/mod.rs new file mode 100644 index 000000000..05c3da34b --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details_bancontact/mod.rs @@ -0,0 +1,92 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsBancontact { + /// Bank code of bank associated with the bank account. + pub bank_code: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Bank Identifier Code of the bank associated with the bank account. + pub bic: Option, + /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + pub generated_sepa_debit: Option>, + /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + pub generated_sepa_debit_mandate: Option>, + /// Last four characters of the IBAN. + pub iban_last4: Option, + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + /// Can be one of `en`, `de`, `fr`, or `nl`. + pub preferred_language: Option, + /// Owner's verified full name. + /// + /// Values are verified or provided by Bancontact directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub verified_name: Option, +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +/// Can be one of `en`, `de`, `fr`, or `nl`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage", + ) + }) + } +} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details_boleto/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details_boleto/mod.rs new file mode 100644 index 000000000..879f54e79 --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details_boleto/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsBoleto {} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details_card/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details_card/mod.rs new file mode 100644 index 000000000..61ba66076 --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details_card/mod.rs @@ -0,0 +1,52 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsCard { + /// Card brand. + /// + /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub brand: Option, + /// Check results by Card networks on Card address and CVC at the time of authorization. + pub checks: Option, + /// Two-letter ISO code representing the country of the card. + /// + /// You could use this attribute to get a sense of the international breakdown of cards you've collected. + pub country: Option, + /// A high-level description of the type of cards issued in this range. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Two-digit number representing the card's expiration month. + pub exp_month: Option, + /// Four-digit number representing the card's expiration year. + pub exp_year: Option, + /// Uniquely identifies this particular card number. + /// + /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. + /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + /// Card funding type. + /// + /// Can be `credit`, `debit`, `prepaid`, or `unknown`. + pub funding: Option, + /// Issuer identification number of the card. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + /// The name of the card's issuing bank. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// The last four digits of the card. + pub last4: Option, + /// Identifies which network this charge was processed on. + /// + /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub network: Option, + /// Populated if this authorization used 3D Secure authentication. + pub three_d_secure: Option, + /// If this Card is part of a card wallet, this contains the details of the card wallet. + pub wallet: Option, +} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details_card_checks/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details_card_checks/mod.rs new file mode 100644 index 000000000..de56ad5c9 --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details_card_checks/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsCardChecks { + /// If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub address_line1_check: Option, + /// If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub address_postal_code_check: Option, + /// If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub cvc_check: Option, +} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details_card_present/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details_card_present/mod.rs new file mode 100644 index 000000000..156c03a0a --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details_card_present/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsCardPresent { + /// The ID of the Card PaymentMethod which was generated by this SetupAttempt. + pub generated_card: Option>, +} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details_card_wallet/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details_card_wallet/mod.rs new file mode 100644 index 000000000..9fbb4d26f --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details_card_wallet/mod.rs @@ -0,0 +1,81 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsCardWallet { + #[serde(skip_serializing_if = "Option::is_none")] + pub apple_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub google_pay: Option, + /// The type of the card wallet, one of `apple_pay`, `google_pay`, or `link`. + /// + /// An additional hash is included on the Wallet subhash with a name matching this value. + /// It contains additional information specific to the card wallet type. + #[serde(rename = "type")] + pub type_: SetupAttemptPaymentMethodDetailsCardWalletType, +} +/// The type of the card wallet, one of `apple_pay`, `google_pay`, or `link`. +/// +/// An additional hash is included on the Wallet subhash with a name matching this value. +/// It contains additional information specific to the card wallet type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupAttemptPaymentMethodDetailsCardWalletType { + ApplePay, + GooglePay, + Link, +} +impl SetupAttemptPaymentMethodDetailsCardWalletType { + pub fn as_str(self) -> &'static str { + use SetupAttemptPaymentMethodDetailsCardWalletType::*; + match self { + ApplePay => "apple_pay", + GooglePay => "google_pay", + Link => "link", + } + } +} + +impl std::str::FromStr for SetupAttemptPaymentMethodDetailsCardWalletType { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupAttemptPaymentMethodDetailsCardWalletType::*; + match s { + "apple_pay" => Ok(ApplePay), + "google_pay" => Ok(GooglePay), + "link" => Ok(Link), + _ => Err(()), + } + } +} +impl AsRef for SetupAttemptPaymentMethodDetailsCardWalletType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupAttemptPaymentMethodDetailsCardWalletType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupAttemptPaymentMethodDetailsCardWalletType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupAttemptPaymentMethodDetailsCardWalletType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupAttemptPaymentMethodDetailsCardWalletType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupAttemptPaymentMethodDetailsCardWalletType", + ) + }) + } +} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details_cashapp/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details_cashapp/mod.rs new file mode 100644 index 000000000..f5980430c --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details_cashapp/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsCashapp {} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details_ideal/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details_ideal/mod.rs new file mode 100644 index 000000000..f82327c31 --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details_ideal/mod.rs @@ -0,0 +1,227 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsIdeal { + /// The customer's bank. + /// + /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + pub bank: Option, + /// The Bank Identifier Code of the customer's bank. + pub bic: Option, + /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + pub generated_sepa_debit: Option>, + /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + pub generated_sepa_debit_mandate: Option>, + /// Last four characters of the IBAN. + pub iban_last4: Option, + /// Owner's verified full name. + /// + /// Values are verified or provided by iDEAL directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub verified_name: Option, +} +/// The customer's bank. +/// +/// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum SetupAttemptPaymentMethodDetailsIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl SetupAttemptPaymentMethodDetailsIdealBank { + pub fn as_str(self) -> &'static str { + use SetupAttemptPaymentMethodDetailsIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for SetupAttemptPaymentMethodDetailsIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupAttemptPaymentMethodDetailsIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl AsRef for SetupAttemptPaymentMethodDetailsIdealBank { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupAttemptPaymentMethodDetailsIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupAttemptPaymentMethodDetailsIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupAttemptPaymentMethodDetailsIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupAttemptPaymentMethodDetailsIdealBank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(SetupAttemptPaymentMethodDetailsIdealBank::Unknown)) + } +} +/// The Bank Identifier Code of the customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum SetupAttemptPaymentMethodDetailsIdealBic { + Abnanl2a, + Asnbnl21, + Bitsnl2a, + Bunqnl2a, + Fvlbnl22, + Handnl2a, + Ingbnl2a, + Knabnl2h, + Moyonl21, + Ntsbdeb1, + Rabonl2u, + Rbrbnl21, + Revoie23, + Revolt21, + Snsbnl2a, + Trionl2u, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl SetupAttemptPaymentMethodDetailsIdealBic { + pub fn as_str(self) -> &'static str { + use SetupAttemptPaymentMethodDetailsIdealBic::*; + match self { + Abnanl2a => "ABNANL2A", + Asnbnl21 => "ASNBNL21", + Bitsnl2a => "BITSNL2A", + Bunqnl2a => "BUNQNL2A", + Fvlbnl22 => "FVLBNL22", + Handnl2a => "HANDNL2A", + Ingbnl2a => "INGBNL2A", + Knabnl2h => "KNABNL2H", + Moyonl21 => "MOYONL21", + Ntsbdeb1 => "NTSBDEB1", + Rabonl2u => "RABONL2U", + Rbrbnl21 => "RBRBNL21", + Revoie23 => "REVOIE23", + Revolt21 => "REVOLT21", + Snsbnl2a => "SNSBNL2A", + Trionl2u => "TRIONL2U", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for SetupAttemptPaymentMethodDetailsIdealBic { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupAttemptPaymentMethodDetailsIdealBic::*; + match s { + "ABNANL2A" => Ok(Abnanl2a), + "ASNBNL21" => Ok(Asnbnl21), + "BITSNL2A" => Ok(Bitsnl2a), + "BUNQNL2A" => Ok(Bunqnl2a), + "FVLBNL22" => Ok(Fvlbnl22), + "HANDNL2A" => Ok(Handnl2a), + "INGBNL2A" => Ok(Ingbnl2a), + "KNABNL2H" => Ok(Knabnl2h), + "MOYONL21" => Ok(Moyonl21), + "NTSBDEB1" => Ok(Ntsbdeb1), + "RABONL2U" => Ok(Rabonl2u), + "RBRBNL21" => Ok(Rbrbnl21), + "REVOIE23" => Ok(Revoie23), + "REVOLT21" => Ok(Revolt21), + "SNSBNL2A" => Ok(Snsbnl2a), + "TRIONL2U" => Ok(Trionl2u), + _ => Err(()), + } + } +} +impl AsRef for SetupAttemptPaymentMethodDetailsIdealBic { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupAttemptPaymentMethodDetailsIdealBic { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupAttemptPaymentMethodDetailsIdealBic { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupAttemptPaymentMethodDetailsIdealBic { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupAttemptPaymentMethodDetailsIdealBic { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(SetupAttemptPaymentMethodDetailsIdealBic::Unknown)) + } +} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details_klarna/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details_klarna/mod.rs new file mode 100644 index 000000000..530bbd657 --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details_klarna/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsKlarna {} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details_link/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details_link/mod.rs new file mode 100644 index 000000000..cfd19ba47 --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details_link/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsLink {} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details_paypal/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details_paypal/mod.rs new file mode 100644 index 000000000..915512a00 --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details_paypal/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsPaypal {} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details_sepa_debit/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details_sepa_debit/mod.rs new file mode 100644 index 000000000..2063e17ca --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details_sepa_debit/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsSepaDebit {} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details_sofort/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details_sofort/mod.rs new file mode 100644 index 000000000..e5e89e6d9 --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details_sofort/mod.rs @@ -0,0 +1,92 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsSofort { + /// Bank code of bank associated with the bank account. + pub bank_code: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Bank Identifier Code of the bank associated with the bank account. + pub bic: Option, + /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + pub generated_sepa_debit: Option>, + /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + pub generated_sepa_debit_mandate: Option>, + /// Last four characters of the IBAN. + pub iban_last4: Option, + /// Preferred language of the Sofort authorization page that the customer is redirected to. + /// Can be one of `en`, `de`, `fr`, or `nl`. + pub preferred_language: Option, + /// Owner's verified full name. + /// + /// Values are verified or provided by Sofort directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub verified_name: Option, +} +/// Preferred language of the Sofort authorization page that the customer is redirected to. +/// Can be one of `en`, `de`, `fr`, or `nl`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { + pub fn as_str(self) -> &'static str { + use SetupAttemptPaymentMethodDetailsSofortPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupAttemptPaymentMethodDetailsSofortPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl AsRef for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage", + ) + }) + } +} diff --git a/stripe_types/src/generated/setup_attempt_payment_method_details_us_bank_account/mod.rs b/stripe_types/src/generated/setup_attempt_payment_method_details_us_bank_account/mod.rs new file mode 100644 index 000000000..e8938c099 --- /dev/null +++ b/stripe_types/src/generated/setup_attempt_payment_method_details_us_bank_account/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsUsBankAccount {} diff --git a/stripe_types/src/generated/setup_intent/mod.rs b/stripe_types/src/generated/setup_intent/mod.rs new file mode 100644 index 000000000..307b24358 --- /dev/null +++ b/stripe_types/src/generated/setup_intent/mod.rs @@ -0,0 +1,313 @@ +/// A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. +/// For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. +/// Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. +/// +/// Create a SetupIntent when you're ready to collect your customer's payment credentials. +/// Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. +/// The SetupIntent transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-statuses) as it guides +/// you through the setup process. +/// +/// Successful SetupIntents result in payment credentials that are optimized for future payments. +/// For example, cardholders in [certain regions](/guides/strong-customer-authentication) might need to be run through +/// [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) during payment method collection +/// to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents). +/// If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), +/// it automatically attaches the resulting payment method to that Customer after successful setup. +/// We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on +/// PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. +/// +/// By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. +/// +/// Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SetupIntent { + /// ID of the Connect application that created the SetupIntent. + pub application: Option>, + /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + /// + /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. + /// + /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub attach_to_self: Option, + /// Settings for dynamic payment methods compatible with this Setup Intent. + pub automatic_payment_methods: + Option, + /// Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. + pub cancellation_reason: Option, + /// The client secret of this SetupIntent. + /// + /// Used for client-side retrieval using a publishable key. The client secret can be used to complete payment setup from your frontend. + /// It should not be stored, logged, or exposed to anyone other than the customer. + /// Make sure that you have TLS enabled on any page that includes the client secret. + pub client_secret: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// ID of the Customer this SetupIntent belongs to, if one exists. + /// + /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup. + /// + /// Payment methods attached to other Customers cannot be used with this SetupIntent. + pub customer: Option>, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// Indicates the directions of money movement for which this payment method is intended to be used. + /// + /// Include `inbound` if you intend to use the payment method as the origin to pull funds from. + /// + /// Include `outbound` if you intend to use the payment method as the destination to send funds to. + /// You can include both if you intend to use the payment method for both purposes. + pub flow_directions: Option>, + /// Unique identifier for the object. + pub id: stripe_types::setup_intent::SetupIntentId, + /// The error encountered in the previous SetupIntent confirmation. + pub last_setup_error: Option>, + /// The most recent SetupAttempt for this SetupIntent. + pub latest_attempt: + Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// ID of the multi use Mandate generated by the SetupIntent. + pub mandate: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// If present, this property tells you what actions you need to take in order for your customer to continue payment setup. + pub next_action: Option, + /// The account (if any) for which the setup is intended. + pub on_behalf_of: Option>, + /// ID of the payment method used with this SetupIntent. + pub payment_method: Option>, + /// Information about the payment method configuration used for this Setup Intent. + pub payment_method_configuration_details: + Option, + /// Payment method-specific configuration for this SetupIntent. + pub payment_method_options: Option, + /// The list of payment method types (e.g. + /// + /// card) that this SetupIntent is allowed to set up. + pub payment_method_types: Vec, + /// ID of the single_use Mandate generated by the SetupIntent. + pub single_use_mandate: Option>, + /// [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. + pub status: SetupIntentStatus, + /// Indicates how the payment method is intended to be used in the future. + /// + /// Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. + /// + /// Use `off_session` if your customer may or may not be in your checkout flow. + /// If not provided, this value defaults to `off_session`. + pub usage: String, +} +/// Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentCancellationReason { + Abandoned, + Duplicate, + RequestedByCustomer, +} +impl SetupIntentCancellationReason { + pub fn as_str(self) -> &'static str { + use SetupIntentCancellationReason::*; + match self { + Abandoned => "abandoned", + Duplicate => "duplicate", + RequestedByCustomer => "requested_by_customer", + } + } +} + +impl std::str::FromStr for SetupIntentCancellationReason { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentCancellationReason::*; + match s { + "abandoned" => Ok(Abandoned), + "duplicate" => Ok(Duplicate), + "requested_by_customer" => Ok(RequestedByCustomer), + _ => Err(()), + } + } +} +impl AsRef for SetupIntentCancellationReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupIntentCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentCancellationReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentCancellationReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for SetupIntentCancellationReason") + }) + } +} +/// Indicates the directions of money movement for which this payment method is intended to be used. +/// +/// Include `inbound` if you intend to use the payment method as the origin to pull funds from. +/// +/// Include `outbound` if you intend to use the payment method as the destination to send funds to. +/// You can include both if you intend to use the payment method for both purposes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentFlowDirections { + Inbound, + Outbound, +} +impl SetupIntentFlowDirections { + pub fn as_str(self) -> &'static str { + use SetupIntentFlowDirections::*; + match self { + Inbound => "inbound", + Outbound => "outbound", + } + } +} + +impl std::str::FromStr for SetupIntentFlowDirections { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentFlowDirections::*; + match s { + "inbound" => Ok(Inbound), + "outbound" => Ok(Outbound), + _ => Err(()), + } + } +} +impl AsRef for SetupIntentFlowDirections { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupIntentFlowDirections { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentFlowDirections { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentFlowDirections { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentFlowDirections { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SetupIntentFlowDirections")) + } +} +/// [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentStatus { + Canceled, + Processing, + RequiresAction, + RequiresConfirmation, + RequiresPaymentMethod, + Succeeded, +} +impl SetupIntentStatus { + pub fn as_str(self) -> &'static str { + use SetupIntentStatus::*; + match self { + Canceled => "canceled", + Processing => "processing", + RequiresAction => "requires_action", + RequiresConfirmation => "requires_confirmation", + RequiresPaymentMethod => "requires_payment_method", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for SetupIntentStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentStatus::*; + match s { + "canceled" => Ok(Canceled), + "processing" => Ok(Processing), + "requires_action" => Ok(RequiresAction), + "requires_confirmation" => Ok(RequiresConfirmation), + "requires_payment_method" => Ok(RequiresPaymentMethod), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl AsRef for SetupIntentStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupIntentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SetupIntentStatus")) + } +} +impl stripe_types::Object for SetupIntent { + type Id = stripe_types::setup_intent::SetupIntentId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(SetupIntentId, "seti_"); diff --git a/stripe_types/src/generated/setup_intent_next_action/mod.rs b/stripe_types/src/generated/setup_intent_next_action/mod.rs new file mode 100644 index 000000000..e774fbc93 --- /dev/null +++ b/stripe_types/src/generated/setup_intent_next_action/mod.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentNextAction { + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp_handle_redirect_or_display_qr_code: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect_to_url: Option, + /// Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. + #[serde(rename = "type")] + pub type_: String, + /// When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. + /// + /// The shape of the contents is subject to change and is only intended to be used by Stripe.js. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_stripe_sdk: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub verify_with_microdeposits: + Option, +} diff --git a/stripe_types/src/generated/setup_intent_next_action_redirect_to_url/mod.rs b/stripe_types/src/generated/setup_intent_next_action_redirect_to_url/mod.rs new file mode 100644 index 000000000..c999292b4 --- /dev/null +++ b/stripe_types/src/generated/setup_intent_next_action_redirect_to_url/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentNextActionRedirectToUrl { + /// If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. + pub return_url: Option, + /// The URL you must redirect your customer to in order to authenticate. + pub url: Option, +} diff --git a/stripe_types/src/generated/setup_intent_next_action_verify_with_microdeposits/mod.rs b/stripe_types/src/generated/setup_intent_next_action_verify_with_microdeposits/mod.rs new file mode 100644 index 000000000..c2653f0dd --- /dev/null +++ b/stripe_types/src/generated/setup_intent_next_action_verify_with_microdeposits/mod.rs @@ -0,0 +1,75 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentNextActionVerifyWithMicrodeposits { + /// The timestamp when the microdeposits are expected to land. + pub arrival_date: stripe_types::Timestamp, + /// The URL for the hosted verification page, which allows customers to verify their bank account. + pub hosted_verification_url: String, + /// The type of the microdeposit sent to the customer. + /// + /// Used to distinguish between different verification methods. + pub microdeposit_type: Option, +} +/// The type of the microdeposit sent to the customer. +/// +/// Used to distinguish between different verification methods. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { + Amounts, + DescriptorCode, +} +impl SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { + pub fn as_str(self) -> &'static str { + use SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType::*; + match self { + Amounts => "amounts", + DescriptorCode => "descriptor_code", + } + } +} + +impl std::str::FromStr for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType::*; + match s { + "amounts" => Ok(Amounts), + "descriptor_code" => Ok(DescriptorCode), + _ => Err(()), + } + } +} +impl AsRef for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType", + ) + }) + } +} diff --git a/stripe_types/src/generated/setup_intent_payment_method_options/mod.rs b/stripe_types/src/generated/setup_intent_payment_method_options/mod.rs new file mode 100644 index 000000000..f3fc43d22 --- /dev/null +++ b/stripe_types/src/generated/setup_intent_payment_method_options/mod.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} diff --git a/stripe_types/src/generated/setup_intent_payment_method_options_acss_debit/mod.rs b/stripe_types/src/generated/setup_intent_payment_method_options_acss_debit/mod.rs new file mode 100644 index 000000000..26df51414 --- /dev/null +++ b/stripe_types/src/generated/setup_intent_payment_method_options_acss_debit/mod.rs @@ -0,0 +1,138 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsAcssDebit { + /// Currency supported by the bank account. + pub currency: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option, +} +/// Currency supported by the bank account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsAcssDebitCurrency { + Cad, + Usd, +} +impl SetupIntentPaymentMethodOptionsAcssDebitCurrency { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsAcssDebitCurrency::*; + match self { + Cad => "cad", + Usd => "usd", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsAcssDebitCurrency { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsAcssDebitCurrency::*; + match s { + "cad" => Ok(Cad), + "usd" => Ok(Usd), + _ => Err(()), + } + } +} +impl AsRef for SetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupIntentPaymentMethodOptionsAcssDebitCurrency", + ) + }) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod", + ) + }) + } +} diff --git a/stripe_types/src/generated/setup_intent_payment_method_options_card/mod.rs b/stripe_types/src/generated/setup_intent_payment_method_options_card/mod.rs new file mode 100644 index 000000000..328c392d2 --- /dev/null +++ b/stripe_types/src/generated/setup_intent_payment_method_options_card/mod.rs @@ -0,0 +1,177 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsCard { + /// Configuration options for setting up an eMandate for cards issued in India. + pub mandate_options: Option, + /// Selected network to process this SetupIntent on. + /// + /// Depends on the available networks of the card attached to the setup intent. + /// Can be only set confirm-time. + pub network: Option, + /// 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). + /// + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// Permitted values include: `automatic` or `any`. + /// If not provided, defaults to `automatic`. + /// 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. + pub request_three_d_secure: Option, +} +/// Selected network to process this SetupIntent on. +/// +/// Depends on the available networks of the card attached to the setup intent. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl SetupIntentPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl AsRef for SetupIntentPaymentMethodOptionsCardNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentPaymentMethodOptionsCardNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for SetupIntentPaymentMethodOptionsCardNetwork") + }) + } +} +/// 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). +/// +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// Permitted values include: `automatic` or `any`. +/// If not provided, defaults to `automatic`. +/// 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. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, + ChallengeOnly, +} +impl SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + ChallengeOnly => "challenge_only", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + "challenge_only" => Ok(ChallengeOnly), + _ => Err(()), + } + } +} +impl AsRef for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure", + ) + }) + } +} diff --git a/stripe_types/src/generated/setup_intent_payment_method_options_card_mandate_options/mod.rs b/stripe_types/src/generated/setup_intent_payment_method_options_card_mandate_options/mod.rs new file mode 100644 index 000000000..2bed2b013 --- /dev/null +++ b/stripe_types/src/generated/setup_intent_payment_method_options_card_mandate_options/mod.rs @@ -0,0 +1,243 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsCardMandateOptions { + /// Amount to be charged for future payments. + pub amount: i64, + /// One of `fixed` or `maximum`. + /// + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + pub description: Option, + /// End date of the mandate or subscription. + /// + /// If not provided, the mandate will be active until canceled. + /// If provided, end date should be after start date. + pub end_date: Option, + /// Specifies payment frequency. + /// + /// One of `day`, `week`, `month`, `year`, or `sporadic`. + pub interval: SetupIntentPaymentMethodOptionsCardMandateOptionsInterval, + /// The number of intervals between payments. + /// + /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// This parameter is optional when `interval=sporadic`. + pub interval_count: Option, + /// Unique identifier for the mandate or subscription. + pub reference: String, + /// Start date of the mandate or subscription. + /// + /// Start date should not be lesser than yesterday. + pub start_date: stripe_types::Timestamp, + /// Specifies the type of mandates supported. + /// + /// Possible values are `india`. + pub supported_types: + Option>, +} +/// One of `fixed` or `maximum`. +/// +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl AsRef for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType", + ) + }) + } +} +/// Specifies payment frequency. +/// +/// One of `day`, `week`, `month`, `year`, or `sporadic`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + Day, + Month, + Sporadic, + Week, + Year, +} +impl SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match self { + Day => "day", + Month => "month", + Sporadic => "sporadic", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "sporadic" => Ok(Sporadic), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval", + ) + }) + } +} +/// Specifies the type of mandates supported. +/// +/// Possible values are `india`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + India, +} +impl SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match self { + India => "india", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match s { + "india" => Ok(India), + _ => Err(()), + } + } +} +impl AsRef for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes", + ) + }) + } +} diff --git a/stripe_types/src/generated/setup_intent_payment_method_options_link/mod.rs b/stripe_types/src/generated/setup_intent_payment_method_options_link/mod.rs new file mode 100644 index 000000000..752428286 --- /dev/null +++ b/stripe_types/src/generated/setup_intent_payment_method_options_link/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsLink { + /// \[Deprecated\] This is a legacy parameter that no longer has any function. + pub persistent_token: Option, +} diff --git a/stripe_types/src/generated/setup_intent_payment_method_options_mandate_options_acss_debit/mod.rs b/stripe_types/src/generated/setup_intent_payment_method_options_mandate_options_acss_debit/mod.rs new file mode 100644 index 000000000..1f99fcdd7 --- /dev/null +++ b/stripe_types/src/generated/setup_intent_payment_method_options_mandate_options_acss_debit/mod.rs @@ -0,0 +1,202 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit { + /// A URL for custom mandate text. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option, + /// List of Stripe products where this mandate can be selected automatically. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for: Option>, + /// Description of the interval. + /// + /// Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + pub interval_description: Option, + /// Payment schedule for the mandate. + pub payment_schedule: + Option, + /// Transaction type of the mandate. + pub transaction_type: + Option, +} +/// List of Stripe products where this mandate can be selected automatically. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { + Invoice, + Subscription, +} +impl SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor::*; + match self { + Invoice => "invoice", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor::*; + match s { + "invoice" => Ok(Invoice), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl AsRef for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor")) + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl AsRef for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule")) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + Business, + Personal, +} +impl SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl AsRef for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType")) + } +} diff --git a/stripe_types/src/generated/setup_intent_payment_method_options_mandate_options_sepa_debit/mod.rs b/stripe_types/src/generated/setup_intent_payment_method_options_mandate_options_sepa_debit/mod.rs new file mode 100644 index 000000000..810fb8543 --- /dev/null +++ b/stripe_types/src/generated/setup_intent_payment_method_options_mandate_options_sepa_debit/mod.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsMandateOptionsSepaDebit {} diff --git a/stripe_types/src/generated/setup_intent_payment_method_options_paypal/mod.rs b/stripe_types/src/generated/setup_intent_payment_method_options_paypal/mod.rs new file mode 100644 index 000000000..b72646d23 --- /dev/null +++ b/stripe_types/src/generated/setup_intent_payment_method_options_paypal/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsPaypal { + /// The PayPal Billing Agreement ID (BAID). + /// + /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer. + pub billing_agreement_id: Option, +} diff --git a/stripe_types/src/generated/setup_intent_payment_method_options_sepa_debit/mod.rs b/stripe_types/src/generated/setup_intent_payment_method_options_sepa_debit/mod.rs new file mode 100644 index 000000000..43598fd1e --- /dev/null +++ b/stripe_types/src/generated/setup_intent_payment_method_options_sepa_debit/mod.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsSepaDebit { + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option, +} diff --git a/stripe_types/src/generated/setup_intent_payment_method_options_us_bank_account/mod.rs b/stripe_types/src/generated/setup_intent_payment_method_options_us_bank_account/mod.rs new file mode 100644 index 000000000..bb5438890 --- /dev/null +++ b/stripe_types/src/generated/setup_intent_payment_method_options_us_bank_account/mod.rs @@ -0,0 +1,75 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsUsBankAccount { + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option, +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl AsRef for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod", + ) + }) + } +} diff --git a/stripe_types/src/generated/shipping/mod.rs b/stripe_types/src/generated/shipping/mod.rs new file mode 100644 index 000000000..e2a382cbb --- /dev/null +++ b/stripe_types/src/generated/shipping/mod.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct Shipping { + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option, + /// Recipient name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Recipient phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option, + /// The tracking number for a physical product, obtained from the delivery service. + /// + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub tracking_number: Option, +} diff --git a/stripe_types/src/generated/shipping_rate/mod.rs b/stripe_types/src/generated/shipping_rate/mod.rs new file mode 100644 index 000000000..8bef1c34c --- /dev/null +++ b/stripe_types/src/generated/shipping_rate/mod.rs @@ -0,0 +1,175 @@ +/// Shipping rates describe the price of shipping presented to your customers and +/// applied to a purchase. +/// +/// For more information, see [Charge for shipping](https://stripe.com/docs/payments/during-payment/charge-shipping). For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ShippingRate { + /// Whether the shipping rate can be used for new purchases. + /// + /// Defaults to `true`. + pub active: bool, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The estimated range for how long shipping will take, meant to be displayable to the customer. + /// + /// This will appear on CheckoutSessions. + pub delivery_estimate: Option, + /// The name of the shipping rate, meant to be displayable to the customer. + /// + /// This will appear on CheckoutSessions. + pub display_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amount: Option, + /// Unique identifier for the object. + pub id: stripe_types::shipping_rate::ShippingRateId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// + /// One of `inclusive`, `exclusive`, or `unspecified`. + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + /// + /// The Shipping tax code is `txcd_92010001`. + pub tax_code: Option>, + /// The type of calculation to use on the shipping rate. + /// + /// Can only be `fixed_amount` for now. + #[serde(rename = "type")] + pub type_: ShippingRateType, +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ShippingRateTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl ShippingRateTaxBehavior { + pub fn as_str(self) -> &'static str { + use ShippingRateTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for ShippingRateTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use ShippingRateTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for ShippingRateTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ShippingRateTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ShippingRateTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ShippingRateTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ShippingRateTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for ShippingRateTaxBehavior")) + } +} +/// The type of calculation to use on the shipping rate. +/// +/// Can only be `fixed_amount` for now. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ShippingRateType { + FixedAmount, +} +impl ShippingRateType { + pub fn as_str(self) -> &'static str { + use ShippingRateType::*; + match self { + FixedAmount => "fixed_amount", + } + } +} + +impl std::str::FromStr for ShippingRateType { + type Err = (); + fn from_str(s: &str) -> Result { + use ShippingRateType::*; + match s { + "fixed_amount" => Ok(FixedAmount), + _ => Err(()), + } + } +} +impl AsRef for ShippingRateType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ShippingRateType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ShippingRateType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ShippingRateType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ShippingRateType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for ShippingRateType")) + } +} +impl stripe_types::Object for ShippingRate { + type Id = stripe_types::shipping_rate::ShippingRateId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(ShippingRateId, "shr_"); diff --git a/stripe_types/src/generated/shipping_rate_currency_option/mod.rs b/stripe_types/src/generated/shipping_rate_currency_option/mod.rs new file mode 100644 index 000000000..8d2e95621 --- /dev/null +++ b/stripe_types/src/generated/shipping_rate_currency_option/mod.rs @@ -0,0 +1,74 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ShippingRateCurrencyOption { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// + /// One of `inclusive`, `exclusive`, or `unspecified`. + pub tax_behavior: ShippingRateCurrencyOptionTaxBehavior, +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ShippingRateCurrencyOptionTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl ShippingRateCurrencyOptionTaxBehavior { + pub fn as_str(self) -> &'static str { + use ShippingRateCurrencyOptionTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for ShippingRateCurrencyOptionTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use ShippingRateCurrencyOptionTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl AsRef for ShippingRateCurrencyOptionTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ShippingRateCurrencyOptionTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ShippingRateCurrencyOptionTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ShippingRateCurrencyOptionTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ShippingRateCurrencyOptionTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for ShippingRateCurrencyOptionTaxBehavior") + }) + } +} diff --git a/stripe_types/src/generated/shipping_rate_delivery_estimate/mod.rs b/stripe_types/src/generated/shipping_rate_delivery_estimate/mod.rs new file mode 100644 index 000000000..669d1de22 --- /dev/null +++ b/stripe_types/src/generated/shipping_rate_delivery_estimate/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct ShippingRateDeliveryEstimate { + /// The upper bound of the estimated range. + /// + /// If empty, represents no upper bound i.e., infinite. + pub maximum: Option, + /// The lower bound of the estimated range. + /// + /// If empty, represents no lower bound. + pub minimum: Option, +} diff --git a/stripe_types/src/generated/shipping_rate_delivery_estimate_bound/mod.rs b/stripe_types/src/generated/shipping_rate_delivery_estimate_bound/mod.rs new file mode 100644 index 000000000..a59c33c1e --- /dev/null +++ b/stripe_types/src/generated/shipping_rate_delivery_estimate_bound/mod.rs @@ -0,0 +1,76 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ShippingRateDeliveryEstimateBound { + /// A unit of time. + pub unit: ShippingRateDeliveryEstimateBoundUnit, + /// Must be greater than 0. + pub value: i64, +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ShippingRateDeliveryEstimateBoundUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl ShippingRateDeliveryEstimateBoundUnit { + pub fn as_str(self) -> &'static str { + use ShippingRateDeliveryEstimateBoundUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr for ShippingRateDeliveryEstimateBoundUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use ShippingRateDeliveryEstimateBoundUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl AsRef for ShippingRateDeliveryEstimateBoundUnit { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ShippingRateDeliveryEstimateBoundUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ShippingRateDeliveryEstimateBoundUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ShippingRateDeliveryEstimateBoundUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ShippingRateDeliveryEstimateBoundUnit { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for ShippingRateDeliveryEstimateBoundUnit") + }) + } +} diff --git a/stripe_types/src/generated/shipping_rate_fixed_amount/mod.rs b/stripe_types/src/generated/shipping_rate_fixed_amount/mod.rs new file mode 100644 index 000000000..73cfca0c3 --- /dev/null +++ b/stripe_types/src/generated/shipping_rate_fixed_amount/mod.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ShippingRateFixedAmount { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Shipping rates defined in each available currency option. + /// + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + std::collections::HashMap, + >, +} diff --git a/stripe_types/src/generated/source/mod.rs b/stripe_types/src/generated/source/mod.rs new file mode 100644 index 000000000..344600635 --- /dev/null +++ b/stripe_types/src/generated/source/mod.rs @@ -0,0 +1,234 @@ +/// `Source` objects allow you to accept a variety of payment methods. +/// +/// They represent a customer's payment instrument, and can be used with the Stripe API just like a `Card` object: once chargeable, they can be charged, or can be attached to customers. Stripe doesn't recommend using the deprecated [Sources API](https://stripe.com/docs/api/sources). We recommend that you adopt the [PaymentMethods API](https://stripe.com/docs/api/payment_methods). This newer API provides access to our latest features and payment method types. Related guides: [Sources API](https://stripe.com/docs/sources) and [Sources & Customers](https://stripe.com/docs/sources/customers). For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Source { + #[serde(skip_serializing_if = "Option::is_none")] + pub ach_credit_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ach_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + /// A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. + /// + /// This is the amount for which the source will be chargeable once ready. + /// Required for `single_use` sources. + pub amount: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option, + /// The client secret of the source. + /// + /// Used for client-side retrieval using a publishable key. + pub client_secret: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub code_verification: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. + /// + /// This is the currency for which the source will be chargeable once ready. + /// Required for `single_use` sources. + pub currency: Option, + /// The ID of the customer to which this source is attached. + /// + /// This will not be present when the source has not been attached to a customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// The authentication `flow` of the source. + /// + /// `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. + pub flow: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + /// Unique identifier for the object. + pub id: stripe_types::source::SourceId, + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: Option, + /// Information about the owner of the payment instrument that may be used or required by particular source types. + pub owner: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub receiver: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_credit_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub source_order: Option, + /// Extra information about a source. + /// + /// This will appear on your customer's statement every time you charge the source. + pub statement_descriptor: Option, + /// The status of the source, one of `canceled`, `chargeable`, `consumed`, `failed`, or `pending`. + /// + /// Only `chargeable` sources can be used to create a charge. + pub status: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub three_d_secure: Option, + /// The `type` of the source. + /// + /// The `type` is a payment method, one of `ach_credit_transfer`, `ach_debit`, `alipay`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `multibanco`, `klarna`, `p24`, `sepa_debit`, `sofort`, `three_d_secure`, or `wechat`. + /// An additional hash is included on the source with a name matching this value. + /// It contains additional information specific to the [payment method](https://stripe.com/docs/sources) used. + #[serde(rename = "type")] + pub type_: SourceType, + /// Either `reusable` or `single_use`. + /// + /// Whether this source should be reusable or not. + /// Some source types may or may not be reusable by construction, while others may leave the option at creation. + /// If an incompatible value is passed, an error will be returned. + pub usage: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat: Option, +} +/// The `type` of the source. +/// +/// The `type` is a payment method, one of `ach_credit_transfer`, `ach_debit`, `alipay`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `multibanco`, `klarna`, `p24`, `sepa_debit`, `sofort`, `three_d_secure`, or `wechat`. +/// An additional hash is included on the source with a name matching this value. +/// It contains additional information specific to the [payment method](https://stripe.com/docs/sources) used. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum SourceType { + AchCreditTransfer, + AchDebit, + AcssDebit, + Alipay, + AuBecsDebit, + Bancontact, + Card, + CardPresent, + Eps, + Giropay, + Ideal, + Klarna, + Multibanco, + P24, + SepaCreditTransfer, + SepaDebit, + Sofort, + ThreeDSecure, + Wechat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl SourceType { + pub fn as_str(self) -> &'static str { + use SourceType::*; + match self { + AchCreditTransfer => "ach_credit_transfer", + AchDebit => "ach_debit", + AcssDebit => "acss_debit", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + Bancontact => "bancontact", + Card => "card", + CardPresent => "card_present", + Eps => "eps", + Giropay => "giropay", + Ideal => "ideal", + Klarna => "klarna", + Multibanco => "multibanco", + P24 => "p24", + SepaCreditTransfer => "sepa_credit_transfer", + SepaDebit => "sepa_debit", + Sofort => "sofort", + ThreeDSecure => "three_d_secure", + Wechat => "wechat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for SourceType { + type Err = (); + fn from_str(s: &str) -> Result { + use SourceType::*; + match s { + "ach_credit_transfer" => Ok(AchCreditTransfer), + "ach_debit" => Ok(AchDebit), + "acss_debit" => Ok(AcssDebit), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bancontact" => Ok(Bancontact), + "card" => Ok(Card), + "card_present" => Ok(CardPresent), + "eps" => Ok(Eps), + "giropay" => Ok(Giropay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "multibanco" => Ok(Multibanco), + "p24" => Ok(P24), + "sepa_credit_transfer" => Ok(SepaCreditTransfer), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "three_d_secure" => Ok(ThreeDSecure), + "wechat" => Ok(Wechat), + _ => Err(()), + } + } +} +impl AsRef for SourceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SourceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SourceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SourceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SourceType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(SourceType::Unknown)) + } +} +impl stripe_types::Object for Source { + type Id = stripe_types::source::SourceId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(SourceId, "src_"); diff --git a/stripe_types/src/generated/source_code_verification_flow/mod.rs b/stripe_types/src/generated/source_code_verification_flow/mod.rs new file mode 100644 index 000000000..ebaa0cc38 --- /dev/null +++ b/stripe_types/src/generated/source_code_verification_flow/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SourceCodeVerificationFlow { + /// The number of attempts remaining to authenticate the source object with a verification code. + pub attempts_remaining: i64, + /// The status of the code verification, either `pending` (awaiting verification, `attempts_remaining` should be greater than 0), `succeeded` (successful verification) or `failed` (failed verification, cannot be verified anymore as `attempts_remaining` should be 0). + pub status: String, +} diff --git a/stripe_types/src/generated/source_order/mod.rs b/stripe_types/src/generated/source_order/mod.rs new file mode 100644 index 000000000..2f390c3fb --- /dev/null +++ b/stripe_types/src/generated/source_order/mod.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SourceOrder { + /// A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The email address of the customer placing the order. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option, + /// List of items constituting the order. + pub items: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option, +} diff --git a/stripe_types/src/generated/source_order_item/mod.rs b/stripe_types/src/generated/source_order_item/mod.rs new file mode 100644 index 000000000..808077485 --- /dev/null +++ b/stripe_types/src/generated/source_order_item/mod.rs @@ -0,0 +1,25 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceOrderItem { + /// The amount (price) for this order item. + pub amount: Option, + /// This currency of this order item. + /// + /// Required when `amount` is present. + pub currency: Option, + /// Human-readable description for this order item. + pub description: Option, + /// The ID of the associated object for this line item. + /// + /// Expandable if not null (e.g., expandable to a SKU). + pub parent: Option, + /// The quantity of this order item. + /// + /// When type is `sku`, this is the number of instances of the SKU to be ordered. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The type of this order item. + /// + /// Must be `sku`, `tax`, or `shipping`. + #[serde(rename = "type")] + pub type_: Option, +} diff --git a/stripe_types/src/generated/source_owner/mod.rs b/stripe_types/src/generated/source_owner/mod.rs new file mode 100644 index 000000000..aa0a4f1db --- /dev/null +++ b/stripe_types/src/generated/source_owner/mod.rs @@ -0,0 +1,31 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceOwner { + /// Owner's address. + pub address: Option, + /// Owner's email address. + pub email: Option, + /// Owner's full name. + pub name: Option, + /// Owner's phone number (including extension). + pub phone: Option, + /// Verified owner's address. + /// + /// Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub verified_address: Option, + /// Verified owner's email address. + /// + /// Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub verified_email: Option, + /// Verified owner's full name. + /// + /// Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub verified_name: Option, + /// Verified owner's phone number (including extension). + /// + /// Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub verified_phone: Option, +} diff --git a/stripe_types/src/generated/source_receiver_flow/mod.rs b/stripe_types/src/generated/source_receiver_flow/mod.rs new file mode 100644 index 000000000..da80e3f6a --- /dev/null +++ b/stripe_types/src/generated/source_receiver_flow/mod.rs @@ -0,0 +1,26 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SourceReceiverFlow { + /// The address of the receiver source. + /// + /// This is the value that should be communicated to the customer to send their funds to. + pub address: Option, + /// The total amount that was moved to your balance. + /// + /// This is almost always equal to the amount charged. + /// In rare cases when customers deposit excess funds and we are unable to refund those, those funds get moved to your balance and show up in amount_charged as well. + /// The amount charged is expressed in the source's currency. + pub amount_charged: i64, + /// The total amount received by the receiver source. + /// + /// `amount_received = amount_returned + amount_charged` should be true for consumed sources unless customers deposit excess funds. + /// The amount received is expressed in the source's currency. + pub amount_received: i64, + /// The total amount that was returned to the customer. + /// + /// The amount returned is expressed in the source's currency. + pub amount_returned: i64, + /// Type of refund attribute method, one of `email`, `manual`, or `none`. + pub refund_attributes_method: String, + /// Type of refund attribute status, one of `missing`, `requested`, or `available`. + pub refund_attributes_status: String, +} diff --git a/stripe_types/src/generated/source_redirect_flow/mod.rs b/stripe_types/src/generated/source_redirect_flow/mod.rs new file mode 100644 index 000000000..871bed8e8 --- /dev/null +++ b/stripe_types/src/generated/source_redirect_flow/mod.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SourceRedirectFlow { + /// The failure reason for the redirect, either `user_abort` (the customer aborted or dropped out of the redirect flow), `declined` (the authentication failed or the transaction was declined), or `processing_error` (the redirect failed due to a technical error). + /// + /// Present only if the redirect status is `failed`. + pub failure_reason: Option, + /// The URL you provide to redirect the customer to after they authenticated their payment. + pub return_url: String, + /// The status of the redirect, either `pending` (ready to be used by your customer to authenticate the transaction), `succeeded` (succesful authentication, cannot be reused) or `not_required` (redirect should not be used) or `failed` (failed authentication, cannot be reused). + pub status: String, + /// The URL provided to you to redirect a customer to as part of a `redirect` authentication flow. + pub url: String, +} diff --git a/stripe_types/src/generated/source_transaction/mod.rs b/stripe_types/src/generated/source_transaction/mod.rs new file mode 100644 index 000000000..96d5f40d3 --- /dev/null +++ b/stripe_types/src/generated/source_transaction/mod.rs @@ -0,0 +1,150 @@ +/// Some payment methods have no required amount that a customer must send. +/// Customers can be instructed to send any amount, and it can be made up of +/// multiple transactions. +/// +/// As such, sources can have multiple associated transactions. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SourceTransaction { + #[serde(skip_serializing_if = "Option::is_none")] + pub ach_credit_transfer: Option, + /// A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the amount your customer has pushed to the receiver. + pub amount: i64, + #[serde(skip_serializing_if = "Option::is_none")] + pub chf_credit_transfer: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + #[serde(skip_serializing_if = "Option::is_none")] + pub gbp_credit_transfer: Option, + /// Unique identifier for the object. + pub id: stripe_types::source_transaction::SourceTransactionId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub paper_check: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_credit_transfer: Option, + /// The ID of the source this transaction is attached to. + pub source: String, + /// The status of the transaction, one of `succeeded`, `pending`, or `failed`. + pub status: String, + /// The type of source this transaction is attached to. + #[serde(rename = "type")] + pub type_: SourceTransactionType, +} +/// The type of source this transaction is attached to. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum SourceTransactionType { + AchCreditTransfer, + AchDebit, + Alipay, + Bancontact, + Card, + CardPresent, + Eps, + Giropay, + Ideal, + Klarna, + Multibanco, + P24, + SepaDebit, + Sofort, + ThreeDSecure, + Wechat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl SourceTransactionType { + pub fn as_str(self) -> &'static str { + use SourceTransactionType::*; + match self { + AchCreditTransfer => "ach_credit_transfer", + AchDebit => "ach_debit", + Alipay => "alipay", + Bancontact => "bancontact", + Card => "card", + CardPresent => "card_present", + Eps => "eps", + Giropay => "giropay", + Ideal => "ideal", + Klarna => "klarna", + Multibanco => "multibanco", + P24 => "p24", + SepaDebit => "sepa_debit", + Sofort => "sofort", + ThreeDSecure => "three_d_secure", + Wechat => "wechat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for SourceTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use SourceTransactionType::*; + match s { + "ach_credit_transfer" => Ok(AchCreditTransfer), + "ach_debit" => Ok(AchDebit), + "alipay" => Ok(Alipay), + "bancontact" => Ok(Bancontact), + "card" => Ok(Card), + "card_present" => Ok(CardPresent), + "eps" => Ok(Eps), + "giropay" => Ok(Giropay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "multibanco" => Ok(Multibanco), + "p24" => Ok(P24), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "three_d_secure" => Ok(ThreeDSecure), + "wechat" => Ok(Wechat), + _ => Err(()), + } + } +} +impl AsRef for SourceTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SourceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SourceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SourceTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SourceTransactionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(SourceTransactionType::Unknown)) + } +} +impl stripe_types::Object for SourceTransaction { + type Id = stripe_types::source_transaction::SourceTransactionId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(SourceTransactionId); diff --git a/stripe_types/src/generated/source_transaction_ach_credit_transfer_data/mod.rs b/stripe_types/src/generated/source_transaction_ach_credit_transfer_data/mod.rs new file mode 100644 index 000000000..cbb4be85d --- /dev/null +++ b/stripe_types/src/generated/source_transaction_ach_credit_transfer_data/mod.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTransactionAchCreditTransferData { + /// Customer data associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_data: Option, + /// Bank account fingerprint associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + /// Last 4 digits of the account number associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + /// Routing number associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option, +} diff --git a/stripe_types/src/generated/source_transaction_chf_credit_transfer_data/mod.rs b/stripe_types/src/generated/source_transaction_chf_credit_transfer_data/mod.rs new file mode 100644 index 000000000..491954c7f --- /dev/null +++ b/stripe_types/src/generated/source_transaction_chf_credit_transfer_data/mod.rs @@ -0,0 +1,18 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTransactionChfCreditTransferData { + /// Reference associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option, + /// Sender's country address. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_address_country: Option, + /// Sender's line 1 address. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_address_line1: Option, + /// Sender's bank account IBAN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_iban: Option, + /// Sender's name. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_name: Option, +} diff --git a/stripe_types/src/generated/source_transaction_gbp_credit_transfer_data/mod.rs b/stripe_types/src/generated/source_transaction_gbp_credit_transfer_data/mod.rs new file mode 100644 index 000000000..6979be900 --- /dev/null +++ b/stripe_types/src/generated/source_transaction_gbp_credit_transfer_data/mod.rs @@ -0,0 +1,27 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTransactionGbpCreditTransferData { + /// Bank account fingerprint associated with the Stripe owned bank account receiving the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + /// The credit transfer rails the sender used to push this transfer. + /// + /// The possible rails are: Faster Payments, BACS, CHAPS, and wire transfers. + /// Currently only Faster Payments is supported. + #[serde(skip_serializing_if = "Option::is_none")] + pub funding_method: Option, + /// Last 4 digits of sender account number associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + /// Sender entered arbitrary information about the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option, + /// Sender account number associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_account_number: Option, + /// Sender name associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_name: Option, + /// Sender sort code associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_sort_code: Option, +} diff --git a/stripe_types/src/generated/source_transaction_paper_check_data/mod.rs b/stripe_types/src/generated/source_transaction_paper_check_data/mod.rs new file mode 100644 index 000000000..db7e6e00b --- /dev/null +++ b/stripe_types/src/generated/source_transaction_paper_check_data/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTransactionPaperCheckData { + /// Time at which the deposited funds will be available for use. + /// + /// Measured in seconds since the Unix epoch. + #[serde(skip_serializing_if = "Option::is_none")] + pub available_at: Option, + /// Comma-separated list of invoice IDs associated with the paper check. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoices: Option, +} diff --git a/stripe_types/src/generated/source_transaction_sepa_credit_transfer_data/mod.rs b/stripe_types/src/generated/source_transaction_sepa_credit_transfer_data/mod.rs new file mode 100644 index 000000000..99674772b --- /dev/null +++ b/stripe_types/src/generated/source_transaction_sepa_credit_transfer_data/mod.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTransactionSepaCreditTransferData { + /// Reference associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option, + /// Sender's bank account IBAN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_iban: Option, + /// Sender's name. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_name: Option, +} diff --git a/stripe_types/src/generated/source_type_ach_credit_transfer/mod.rs b/stripe_types/src/generated/source_type_ach_credit_transfer/mod.rs new file mode 100644 index 000000000..fec1cfaa7 --- /dev/null +++ b/stripe_types/src/generated/source_type_ach_credit_transfer/mod.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeAchCreditTransfer { + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_routing_number: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub swift_code: Option, +} diff --git a/stripe_types/src/generated/source_type_ach_debit/mod.rs b/stripe_types/src/generated/source_type_ach_debit/mod.rs new file mode 100644 index 000000000..3af75e8ad --- /dev/null +++ b/stripe_types/src/generated/source_type_ach_debit/mod.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeAchDebit { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option, + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} diff --git a/stripe_types/src/generated/source_type_acss_debit/mod.rs b/stripe_types/src/generated/source_type_acss_debit/mod.rs new file mode 100644 index 000000000..5a5f28b88 --- /dev/null +++ b/stripe_types/src/generated/source_type_acss_debit/mod.rs @@ -0,0 +1,23 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeAcssDebit { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_address_city: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_address_line_1: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_address_line_2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_address_postal_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub category: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option, +} diff --git a/stripe_types/src/generated/source_type_alipay/mod.rs b/stripe_types/src/generated/source_type_alipay/mod.rs new file mode 100644 index 000000000..bdc2da5e3 --- /dev/null +++ b/stripe_types/src/generated/source_type_alipay/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeAlipay { + #[serde(skip_serializing_if = "Option::is_none")] + pub data_string: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub native_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option, +} diff --git a/stripe_types/src/generated/source_type_au_becs_debit/mod.rs b/stripe_types/src/generated/source_type_au_becs_debit/mod.rs new file mode 100644 index 000000000..2d8f5e245 --- /dev/null +++ b/stripe_types/src/generated/source_type_au_becs_debit/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeAuBecsDebit { + #[serde(skip_serializing_if = "Option::is_none")] + pub bsb_number: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, +} diff --git a/stripe_types/src/generated/source_type_bancontact/mod.rs b/stripe_types/src/generated/source_type_bancontact/mod.rs new file mode 100644 index 000000000..718fc33e9 --- /dev/null +++ b/stripe_types/src/generated/source_type_bancontact/mod.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeBancontact { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bic: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub iban_last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option, +} diff --git a/stripe_types/src/generated/source_type_card/mod.rs b/stripe_types/src/generated/source_type_card/mod.rs new file mode 100644 index 000000000..bdee83df8 --- /dev/null +++ b/stripe_types/src/generated/source_type_card/mod.rs @@ -0,0 +1,37 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeCard { + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1_check: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub address_zip_check: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub brand: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc_check: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub funding: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub three_d_secure: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tokenization_method: Option, +} diff --git a/stripe_types/src/generated/source_type_card_present/mod.rs b/stripe_types/src/generated/source_type_card_present/mod.rs new file mode 100644 index 000000000..c1ba590f0 --- /dev/null +++ b/stripe_types/src/generated/source_type_card_present/mod.rs @@ -0,0 +1,55 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeCardPresent { + #[serde(skip_serializing_if = "Option::is_none")] + pub application_cryptogram: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub application_preferred_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub authorization_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub authorization_response_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub brand: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cvm_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub data_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub dedicated_file_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub emv_auth_data: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub evidence_customer_signature: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub evidence_transaction_certificate: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub funding: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pos_device_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pos_entry_mode: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub read_method: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub reader: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub terminal_verification_results: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_status_information: Option, +} diff --git a/stripe_types/src/generated/source_type_eps/mod.rs b/stripe_types/src/generated/source_type_eps/mod.rs new file mode 100644 index 000000000..38e2d3838 --- /dev/null +++ b/stripe_types/src/generated/source_type_eps/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeEps { + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option, +} diff --git a/stripe_types/src/generated/source_type_giropay/mod.rs b/stripe_types/src/generated/source_type_giropay/mod.rs new file mode 100644 index 000000000..6815d3aa9 --- /dev/null +++ b/stripe_types/src/generated/source_type_giropay/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeGiropay { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bic: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option, +} diff --git a/stripe_types/src/generated/source_type_ideal/mod.rs b/stripe_types/src/generated/source_type_ideal/mod.rs new file mode 100644 index 000000000..e32bc18de --- /dev/null +++ b/stripe_types/src/generated/source_type_ideal/mod.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeIdeal { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bic: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub iban_last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option, +} diff --git a/stripe_types/src/generated/source_type_klarna/mod.rs b/stripe_types/src/generated/source_type_klarna/mod.rs new file mode 100644 index 000000000..4af723679 --- /dev/null +++ b/stripe_types/src/generated/source_type_klarna/mod.rs @@ -0,0 +1,55 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeKlarna { + #[serde(skip_serializing_if = "Option::is_none")] + pub background_image_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub client_token: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub locale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub logo_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub page_title: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_later_asset_urls_descriptive: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_later_asset_urls_standard: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_later_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_later_redirect_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_now_asset_urls_descriptive: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_now_asset_urls_standard: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_now_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_now_redirect_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_over_time_asset_urls_descriptive: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_over_time_asset_urls_standard: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_over_time_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_over_time_redirect_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_categories: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub purchase_country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub purchase_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_delay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_first_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_last_name: Option, +} diff --git a/stripe_types/src/generated/source_type_multibanco/mod.rs b/stripe_types/src/generated/source_type_multibanco/mod.rs new file mode 100644 index 000000000..8765f2828 --- /dev/null +++ b/stripe_types/src/generated/source_type_multibanco/mod.rs @@ -0,0 +1,23 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeMultibanco { + #[serde(skip_serializing_if = "Option::is_none")] + pub entity: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_city: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_line1: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_line2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_postal_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_state: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_iban: Option, +} diff --git a/stripe_types/src/generated/source_type_p24/mod.rs b/stripe_types/src/generated/source_type_p24/mod.rs new file mode 100644 index 000000000..c7bb5edda --- /dev/null +++ b/stripe_types/src/generated/source_type_p24/mod.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeP24 { + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option, +} diff --git a/stripe_types/src/generated/source_type_sepa_credit_transfer/mod.rs b/stripe_types/src/generated/source_type_sepa_credit_transfer/mod.rs new file mode 100644 index 000000000..6fc345841 --- /dev/null +++ b/stripe_types/src/generated/source_type_sepa_credit_transfer/mod.rs @@ -0,0 +1,25 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeSepaCreditTransfer { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bic: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub iban: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_city: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_line1: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_line2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_postal_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_state: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_iban: Option, +} diff --git a/stripe_types/src/generated/source_type_sepa_debit/mod.rs b/stripe_types/src/generated/source_type_sepa_debit/mod.rs new file mode 100644 index 000000000..30b5d9495 --- /dev/null +++ b/stripe_types/src/generated/source_type_sepa_debit/mod.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeSepaDebit { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub branch_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_reference: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_url: Option, +} diff --git a/stripe_types/src/generated/source_type_sofort/mod.rs b/stripe_types/src/generated/source_type_sofort/mod.rs new file mode 100644 index 000000000..8cd9f2f9f --- /dev/null +++ b/stripe_types/src/generated/source_type_sofort/mod.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeSofort { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bic: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub iban_last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option, +} diff --git a/stripe_types/src/generated/source_type_three_d_secure/mod.rs b/stripe_types/src/generated/source_type_three_d_secure/mod.rs new file mode 100644 index 000000000..5a64afe54 --- /dev/null +++ b/stripe_types/src/generated/source_type_three_d_secure/mod.rs @@ -0,0 +1,43 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeThreeDSecure { + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1_check: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub address_zip_check: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub authenticated: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub brand: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc_check: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub funding: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub three_d_secure: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tokenization_method: Option, +} diff --git a/stripe_types/src/generated/source_type_wechat/mod.rs b/stripe_types/src/generated/source_type_wechat/mod.rs new file mode 100644 index 000000000..72ba418f9 --- /dev/null +++ b/stripe_types/src/generated/source_type_wechat/mod.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeWechat { + #[serde(skip_serializing_if = "Option::is_none")] + pub prepay_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub qr_code_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option, +} diff --git a/stripe_types/src/generated/subscription/mod.rs b/stripe_types/src/generated/subscription/mod.rs new file mode 100644 index 000000000..9b4b662a8 --- /dev/null +++ b/stripe_types/src/generated/subscription/mod.rs @@ -0,0 +1,305 @@ +/// Subscriptions allow you to charge a customer on a recurring basis. +/// +/// Related guide: [Creating subscriptions](https://stripe.com/docs/billing/subscriptions/creating) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Subscription { + /// ID of the Connect Application that created the subscription. + pub application: Option>, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + pub application_fee_percent: Option, + pub automatic_tax: stripe_types::SubscriptionAutomaticTax, + /// Determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. + /// + /// The timestamp is in UTC format. + pub billing_cycle_anchor: stripe_types::Timestamp, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + pub billing_thresholds: Option, + /// A date in the future at which the subscription will automatically get canceled. + pub cancel_at: Option, + /// 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. + /// + /// 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. + pub cancel_at_period_end: bool, + /// If the subscription has been canceled, the date of that cancellation. + /// + /// 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. + pub canceled_at: Option, + /// Details about why this subscription was cancelled. + pub cancellation_details: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// + /// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + pub collection_method: SubscriptionCollectionMethod, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// End of the current period that the subscription has been invoiced for. + /// + /// At the end of this period, a new invoice will be created. + pub current_period_end: stripe_types::Timestamp, + /// Start of the current period that the subscription has been invoiced for. + pub current_period_start: stripe_types::Timestamp, + /// ID of the customer who owns the subscription. + pub customer: stripe_types::Expandable, + /// Number of days a customer has to pay invoices generated by this subscription. + /// + /// This value will be `null` for subscriptions where `collection_method=charge_automatically`. + pub days_until_due: Option, + /// ID of the default payment method for the subscription. + /// + /// It must belong to the customer associated with the subscription. + /// This takes precedence over `default_source`. + /// 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). + pub default_payment_method: Option>, + /// ID of the default payment source for the subscription. + /// + /// It must belong to the customer associated with the subscription and be in a chargeable state. + /// If `default_payment_method` is also set, `default_payment_method` will take precedence. + /// 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). + pub default_source: Option>, + /// The tax rates that will apply to any subscription item that does not have `tax_rates` set. + /// + /// Invoices created will have their `default_tax_rates` populated from the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option>, + /// The subscription's description, meant to be displayable to the customer. + /// + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + pub description: Option, + /// Describes the current discount applied to this subscription, if there is one. + /// + /// When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. + pub discount: Option, + /// If the subscription has ended, the date the subscription ended. + pub ended_at: Option, + /// Unique identifier for the object. + pub id: stripe_types::subscription::SubscriptionId, + /// List of subscription items, each with an attached price. + pub items: stripe_types::List, + /// The most recent invoice this subscription has generated. + pub latest_invoice: Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`. + pub next_pending_invoice_item_invoice: Option, + /// The account (if any) the charge was made on behalf of for charges associated with this subscription. + /// + /// See the Connect documentation for details. + pub on_behalf_of: Option>, + /// If specified, payment collection for this subscription will be paused. + pub pause_collection: Option, + /// Payment settings passed on to invoices created by the subscription. + pub payment_settings: Option, + /// Specifies an interval for how often to bill for any pending invoice items. + /// + /// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. + pub pending_invoice_item_interval: Option, + /// 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. + /// + /// Learn more in the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication#scenario-2). + pub pending_setup_intent: Option>, + /// 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. + pub pending_update: Option, + /// The schedule attached to the subscription. + pub schedule: Option>, + /// Date when the subscription was first created. + /// + /// The date might differ from the `created` date due to backdating. + pub start_date: stripe_types::Timestamp, + /// Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, or `unpaid`. + /// + /// For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. + /// A subscription in this state can only have metadata and default_source updated. + /// Once the first invoice is paid, the subscription moves into an `active` state. + /// If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. + /// This is a terminal state, the open invoice will be voided and no further invoices will be generated. + /// A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. + /// 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). + /// Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings). + /// 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. + /// 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). + /// After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices. + pub status: SubscriptionStatus, + /// ID of the test clock this subscription belongs to. + pub test_clock: Option>, + /// 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. + pub transfer_data: Option, + /// If the subscription has a trial, the end of that trial. + pub trial_end: Option, + /// Settings related to subscription trials. + pub trial_settings: Option, + /// If the subscription has a trial, the beginning of that trial. + pub trial_start: Option, +} +/// Either `charge_automatically`, or `send_invoice`. +/// +/// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl SubscriptionCollectionMethod { + pub fn as_str(self) -> &'static str { + use SubscriptionCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for SubscriptionCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl AsRef for SubscriptionCollectionMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SubscriptionCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionCollectionMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SubscriptionCollectionMethod")) + } +} +/// Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, or `unpaid`. +/// +/// For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. +/// A subscription in this state can only have metadata and default_source updated. +/// Once the first invoice is paid, the subscription moves into an `active` state. +/// If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. +/// This is a terminal state, the open invoice will be voided and no further invoices will be generated. +/// A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. +/// 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). +/// Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings). +/// 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. +/// 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). +/// After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionStatus { + Active, + Canceled, + Incomplete, + IncompleteExpired, + PastDue, + Paused, + Trialing, + Unpaid, +} +impl SubscriptionStatus { + pub fn as_str(self) -> &'static str { + use SubscriptionStatus::*; + match self { + Active => "active", + Canceled => "canceled", + Incomplete => "incomplete", + IncompleteExpired => "incomplete_expired", + PastDue => "past_due", + Paused => "paused", + Trialing => "trialing", + Unpaid => "unpaid", + } + } +} + +impl std::str::FromStr for SubscriptionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionStatus::*; + match s { + "active" => Ok(Active), + "canceled" => Ok(Canceled), + "incomplete" => Ok(Incomplete), + "incomplete_expired" => Ok(IncompleteExpired), + "past_due" => Ok(PastDue), + "paused" => Ok(Paused), + "trialing" => Ok(Trialing), + "unpaid" => Ok(Unpaid), + _ => Err(()), + } + } +} +impl AsRef for SubscriptionStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SubscriptionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SubscriptionStatus")) + } +} +impl stripe_types::Object for Subscription { + type Id = stripe_types::subscription::SubscriptionId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(SubscriptionId, "sub_"); diff --git a/stripe_types/src/generated/subscription_automatic_tax/mod.rs b/stripe_types/src/generated/subscription_automatic_tax/mod.rs new file mode 100644 index 000000000..2ebd2ec98 --- /dev/null +++ b/stripe_types/src/generated/subscription_automatic_tax/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionAutomaticTax { + /// Whether Stripe automatically computes tax on this subscription. + pub enabled: bool, +} diff --git a/stripe_types/src/generated/subscription_billing_thresholds/mod.rs b/stripe_types/src/generated/subscription_billing_thresholds/mod.rs new file mode 100644 index 000000000..6a945589a --- /dev/null +++ b/stripe_types/src/generated/subscription_billing_thresholds/mod.rs @@ -0,0 +1,10 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionBillingThresholds { + /// Monetary threshold that triggers the subscription to create an invoice. + pub amount_gte: Option, + /// Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. + /// + /// If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + /// This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. + pub reset_billing_cycle_anchor: Option, +} diff --git a/stripe_types/src/generated/subscription_details_data/mod.rs b/stripe_types/src/generated/subscription_details_data/mod.rs new file mode 100644 index 000000000..7fc00ef81 --- /dev/null +++ b/stripe_types/src/generated/subscription_details_data/mod.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionDetailsData { + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will reflect the metadata of the subscription at the time of invoice creation. + /// + /// *Note: This attribute is populated only for invoices created on or after June 29, 2023.*. + pub metadata: Option>, +} diff --git a/stripe_types/src/generated/subscription_item/mod.rs b/stripe_types/src/generated/subscription_item/mod.rs new file mode 100644 index 000000000..c8881a71e --- /dev/null +++ b/stripe_types/src/generated/subscription_item/mod.rs @@ -0,0 +1,37 @@ +/// Subscription items allow you to create customer subscriptions with more than +/// one plan, making it easy to represent complex billing relationships. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionItem { + /// Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period. + pub billing_thresholds: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: i64, + /// Unique identifier for the object. + pub id: stripe_types::subscription_item::SubscriptionItemId, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + pub plan: stripe_types::Plan, + pub price: stripe_types::Price, + /// The [quantity](https://stripe.com/docs/subscriptions/quantities) of the plan to which the customer should be subscribed. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The `subscription` this `subscription_item` belongs to. + pub subscription: String, + /// The tax rates which apply to this `subscription_item`. + /// + /// When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. + pub tax_rates: Option>, +} +impl stripe_types::Object for SubscriptionItem { + type Id = stripe_types::subscription_item::SubscriptionItemId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(SubscriptionItemId, "si_"); diff --git a/stripe_types/src/generated/subscription_item_billing_thresholds/mod.rs b/stripe_types/src/generated/subscription_item_billing_thresholds/mod.rs new file mode 100644 index 000000000..d31741d2c --- /dev/null +++ b/stripe_types/src/generated/subscription_item_billing_thresholds/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionItemBillingThresholds { + /// Usage threshold that triggers the subscription to create an invoice. + pub usage_gte: Option, +} diff --git a/stripe_types/src/generated/subscription_payment_method_options_card/mod.rs b/stripe_types/src/generated/subscription_payment_method_options_card/mod.rs new file mode 100644 index 000000000..7af5b4dbe --- /dev/null +++ b/stripe_types/src/generated/subscription_payment_method_options_card/mod.rs @@ -0,0 +1,172 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionPaymentMethodOptionsCard { + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option, + /// Selected network to process this Subscription on. + /// + /// Depends on the available networks of the card attached to the Subscription. + /// Can be only set confirm-time. + pub network: Option, + /// 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). + /// + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// 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. + pub request_three_d_secure: Option, +} +/// Selected network to process this Subscription on. +/// +/// Depends on the available networks of the card attached to the Subscription. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl SubscriptionPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use SubscriptionPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for SubscriptionPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl AsRef for SubscriptionPaymentMethodOptionsCardNetwork { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SubscriptionPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionPaymentMethodOptionsCardNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionPaymentMethodOptionsCardNetwork", + ) + }) + } +} +/// 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). +/// +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// 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. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, +} +impl SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use SubscriptionPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + } + } +} + +impl std::str::FromStr for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + _ => Err(()), + } + } +} +impl AsRef for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure", + ) + }) + } +} diff --git a/stripe_types/src/generated/subscription_pending_invoice_item_interval/mod.rs b/stripe_types/src/generated/subscription_pending_invoice_item_interval/mod.rs new file mode 100644 index 000000000..24fd814bd --- /dev/null +++ b/stripe_types/src/generated/subscription_pending_invoice_item_interval/mod.rs @@ -0,0 +1,82 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionPendingInvoiceItemInterval { + /// Specifies invoicing frequency. + /// + /// Either `day`, `week`, `month` or `year`. + pub interval: SubscriptionPendingInvoiceItemIntervalInterval, + /// The number of intervals between invoices. + /// + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + pub interval_count: u64, +} +/// Specifies invoicing frequency. +/// +/// Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionPendingInvoiceItemIntervalInterval { + Day, + Month, + Week, + Year, +} +impl SubscriptionPendingInvoiceItemIntervalInterval { + pub fn as_str(self) -> &'static str { + use SubscriptionPendingInvoiceItemIntervalInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for SubscriptionPendingInvoiceItemIntervalInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionPendingInvoiceItemIntervalInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl AsRef for SubscriptionPendingInvoiceItemIntervalInterval { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SubscriptionPendingInvoiceItemIntervalInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionPendingInvoiceItemIntervalInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionPendingInvoiceItemIntervalInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionPendingInvoiceItemIntervalInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionPendingInvoiceItemIntervalInterval", + ) + }) + } +} diff --git a/stripe_types/src/generated/subscription_schedule/mod.rs b/stripe_types/src/generated/subscription_schedule/mod.rs new file mode 100644 index 000000000..fcfb47819 --- /dev/null +++ b/stripe_types/src/generated/subscription_schedule/mod.rs @@ -0,0 +1,204 @@ +/// A subscription schedule allows you to create and manage the lifecycle of a subscription by predefining expected changes. +/// +/// Related guide: [Subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionSchedule { + /// ID of the Connect Application that created the schedule. + pub application: Option>, + /// Time at which the subscription schedule was canceled. + /// + /// Measured in seconds since the Unix epoch. + pub canceled_at: Option, + /// Time at which the subscription schedule was completed. + /// + /// Measured in seconds since the Unix epoch. + pub completed_at: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Object representing the start and end dates for the current phase of the subscription schedule, if it is `active`. + pub current_phase: Option, + /// ID of the customer who owns the subscription schedule. + pub customer: stripe_types::Expandable, + pub default_settings: stripe_types::SubscriptionSchedulesResourceDefaultSettings, + /// Behavior of the subscription schedule and underlying subscription when it ends. + /// + /// Possible values are `release` or `cancel` with the default being `release`. + /// `release` will end the subscription schedule and keep the underlying subscription running.`cancel` will end the subscription schedule and cancel the underlying subscription. + pub end_behavior: SubscriptionScheduleEndBehavior, + /// Unique identifier for the object. + pub id: stripe_types::subscription_schedule::SubscriptionScheduleId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// Configuration for the subscription schedule's phases. + pub phases: Vec, + /// Time at which the subscription schedule was released. + /// + /// Measured in seconds since the Unix epoch. + pub released_at: Option, + /// ID of the subscription once managed by the subscription schedule (if it is released). + pub released_subscription: Option, + /// The present status of the subscription schedule. + /// + /// Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. + /// You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules). + pub status: SubscriptionScheduleStatus, + /// ID of the subscription managed by the subscription schedule. + pub subscription: Option>, + /// ID of the test clock this subscription schedule belongs to. + pub test_clock: Option>, +} +/// Behavior of the subscription schedule and underlying subscription when it ends. +/// +/// Possible values are `release` or `cancel` with the default being `release`. +/// `release` will end the subscription schedule and keep the underlying subscription running.`cancel` will end the subscription schedule and cancel the underlying subscription. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionScheduleEndBehavior { + Cancel, + None, + Release, + Renew, +} +impl SubscriptionScheduleEndBehavior { + pub fn as_str(self) -> &'static str { + use SubscriptionScheduleEndBehavior::*; + match self { + Cancel => "cancel", + None => "none", + Release => "release", + Renew => "renew", + } + } +} + +impl std::str::FromStr for SubscriptionScheduleEndBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionScheduleEndBehavior::*; + match s { + "cancel" => Ok(Cancel), + "none" => Ok(None), + "release" => Ok(Release), + "renew" => Ok(Renew), + _ => Err(()), + } + } +} +impl AsRef for SubscriptionScheduleEndBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SubscriptionScheduleEndBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionScheduleEndBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionScheduleEndBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionScheduleEndBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for SubscriptionScheduleEndBehavior") + }) + } +} +/// The present status of the subscription schedule. +/// +/// Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. +/// You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionScheduleStatus { + Active, + Canceled, + Completed, + NotStarted, + Released, +} +impl SubscriptionScheduleStatus { + pub fn as_str(self) -> &'static str { + use SubscriptionScheduleStatus::*; + match self { + Active => "active", + Canceled => "canceled", + Completed => "completed", + NotStarted => "not_started", + Released => "released", + } + } +} + +impl std::str::FromStr for SubscriptionScheduleStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionScheduleStatus::*; + match s { + "active" => Ok(Active), + "canceled" => Ok(Canceled), + "completed" => Ok(Completed), + "not_started" => Ok(NotStarted), + "released" => Ok(Released), + _ => Err(()), + } + } +} +impl AsRef for SubscriptionScheduleStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SubscriptionScheduleStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionScheduleStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionScheduleStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionScheduleStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SubscriptionScheduleStatus")) + } +} +impl stripe_types::Object for SubscriptionSchedule { + type Id = stripe_types::subscription_schedule::SubscriptionScheduleId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(SubscriptionScheduleId, "sub_sched_"); diff --git a/stripe_types/src/generated/subscription_schedule_add_invoice_item/mod.rs b/stripe_types/src/generated/subscription_schedule_add_invoice_item/mod.rs new file mode 100644 index 000000000..aa1132152 --- /dev/null +++ b/stripe_types/src/generated/subscription_schedule_add_invoice_item/mod.rs @@ -0,0 +1,13 @@ +/// An Add Invoice Item describes the prices and quantities that will be added as pending invoice items when entering a phase. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionScheduleAddInvoiceItem { + /// ID of the price used to generate the invoice item. + pub price: stripe_types::Expandable, + /// The quantity of the invoice item. + pub quantity: Option, + /// The tax rates which apply to the item. + /// + /// When set, the `default_tax_rates` do not apply to this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option>, +} diff --git a/stripe_types/src/generated/subscription_schedule_configuration_item/mod.rs b/stripe_types/src/generated/subscription_schedule_configuration_item/mod.rs new file mode 100644 index 000000000..9e69e6a68 --- /dev/null +++ b/stripe_types/src/generated/subscription_schedule_configuration_item/mod.rs @@ -0,0 +1,22 @@ +/// A phase item describes the price and quantity of a phase. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionScheduleConfigurationItem { + /// Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period. + pub billing_thresholds: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. + /// + /// Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. + pub metadata: Option>, + /// ID of the plan to which the customer should be subscribed. + pub plan: stripe_types::Expandable, + /// ID of the price to which the customer should be subscribed. + pub price: stripe_types::Expandable, + /// Quantity of the plan to which the customer should be subscribed. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The tax rates which apply to this `phase_item`. + /// + /// When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option>, +} diff --git a/stripe_types/src/generated/subscription_schedule_current_phase/mod.rs b/stripe_types/src/generated/subscription_schedule_current_phase/mod.rs new file mode 100644 index 000000000..28d2195a8 --- /dev/null +++ b/stripe_types/src/generated/subscription_schedule_current_phase/mod.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionScheduleCurrentPhase { + /// The end of this phase of the subscription schedule. + pub end_date: stripe_types::Timestamp, + /// The start of this phase of the subscription schedule. + pub start_date: stripe_types::Timestamp, +} diff --git a/stripe_types/src/generated/subscription_schedule_phase_configuration/mod.rs b/stripe_types/src/generated/subscription_schedule_phase_configuration/mod.rs new file mode 100644 index 000000000..32d5e1793 --- /dev/null +++ b/stripe_types/src/generated/subscription_schedule_phase_configuration/mod.rs @@ -0,0 +1,266 @@ +/// A phase describes the plans, coupon, and trialing status of a subscription for a predefined time period. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionSchedulePhaseConfiguration { + /// A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. + pub add_invoice_items: Vec, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. + pub application_fee_percent: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// Possible values are `phase_start` or `automatic`. + /// + /// If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. + /// If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. + /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + pub billing_cycle_anchor: Option, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + pub billing_thresholds: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// + /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + pub collection_method: Option, + /// ID of the coupon to use during this phase of the subscription schedule. + pub coupon: Option>, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the default payment method for the subscription schedule. + /// + /// It must belong to the customer associated with the subscription schedule. + /// If not set, invoices will use the default payment method in the customer's invoice settings. + pub default_payment_method: Option>, + /// The default tax rates to apply to the subscription during this phase of the subscription schedule. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option>, + /// Subscription description, meant to be displayable to the customer. + /// + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + pub description: Option, + /// The end of this phase of the subscription schedule. + pub end_date: stripe_types::Timestamp, + /// The invoice settings applicable during this phase. + pub invoice_settings: Option, + /// Subscription items to configure the subscription to during this phase of the subscription schedule. + pub items: Vec, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. + /// + /// Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered. + /// Updating the underlying subscription's `metadata` directly will not affect the current phase's `metadata`. + pub metadata: Option>, + /// The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. + /// + /// See the Connect documentation for details. + pub on_behalf_of: Option>, + /// If the subscription schedule will prorate when transitioning to this phase. + /// + /// Possible values are `create_prorations` and `none`. + pub proration_behavior: SubscriptionSchedulePhaseConfigurationProrationBehavior, + /// The start of this phase of the subscription schedule. + pub start_date: stripe_types::Timestamp, + /// The account (if any) the associated 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. + pub transfer_data: Option, + /// When the trial ends within the phase. + pub trial_end: Option, +} +/// Possible values are `phase_start` or `automatic`. +/// +/// If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. +/// If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. +/// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { + Automatic, + PhaseStart, +} +impl SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { + pub fn as_str(self) -> &'static str { + use SubscriptionSchedulePhaseConfigurationBillingCycleAnchor::*; + match self { + Automatic => "automatic", + PhaseStart => "phase_start", + } + } +} + +impl std::str::FromStr for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionSchedulePhaseConfigurationBillingCycleAnchor::*; + match s { + "automatic" => Ok(Automatic), + "phase_start" => Ok(PhaseStart), + _ => Err(()), + } + } +} +impl AsRef for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor", + ) + }) + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// +/// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionSchedulePhaseConfigurationCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl SubscriptionSchedulePhaseConfigurationCollectionMethod { + pub fn as_str(self) -> &'static str { + use SubscriptionSchedulePhaseConfigurationCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for SubscriptionSchedulePhaseConfigurationCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionSchedulePhaseConfigurationCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl AsRef for SubscriptionSchedulePhaseConfigurationCollectionMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SubscriptionSchedulePhaseConfigurationCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionSchedulePhaseConfigurationCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionSchedulePhaseConfigurationCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionSchedulePhaseConfigurationCollectionMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionSchedulePhaseConfigurationCollectionMethod", + ) + }) + } +} +/// If the subscription schedule will prorate when transitioning to this phase. +/// +/// Possible values are `create_prorations` and `none`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionSchedulePhaseConfigurationProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl SubscriptionSchedulePhaseConfigurationProrationBehavior { + pub fn as_str(self) -> &'static str { + use SubscriptionSchedulePhaseConfigurationProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for SubscriptionSchedulePhaseConfigurationProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionSchedulePhaseConfigurationProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl AsRef for SubscriptionSchedulePhaseConfigurationProrationBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SubscriptionSchedulePhaseConfigurationProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionSchedulePhaseConfigurationProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionSchedulePhaseConfigurationProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionSchedulePhaseConfigurationProrationBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionSchedulePhaseConfigurationProrationBehavior", + ) + }) + } +} diff --git a/stripe_types/src/generated/subscription_schedules_resource_default_settings/mod.rs b/stripe_types/src/generated/subscription_schedules_resource_default_settings/mod.rs new file mode 100644 index 000000000..80c8ee16a --- /dev/null +++ b/stripe_types/src/generated/subscription_schedules_resource_default_settings/mod.rs @@ -0,0 +1,172 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionSchedulesResourceDefaultSettings { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. + pub application_fee_percent: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: + Option, + /// Possible values are `phase_start` or `automatic`. + /// + /// If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. + /// If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. + /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + pub billing_cycle_anchor: SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + pub billing_thresholds: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// + /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + pub collection_method: Option, + /// ID of the default payment method for the subscription schedule. + /// + /// If not set, invoices will use the default payment method in the customer's invoice settings. + pub default_payment_method: Option>, + /// Subscription description, meant to be displayable to the customer. + /// + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + pub description: Option, + /// The subscription schedule's default invoice settings. + pub invoice_settings: Option, + /// The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. + /// + /// See the Connect documentation for details. + pub on_behalf_of: Option>, + /// The account (if any) the associated 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. + pub transfer_data: Option, +} +/// Possible values are `phase_start` or `automatic`. +/// +/// If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. +/// If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. +/// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor { + Automatic, + PhaseStart, +} +impl SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor { + pub fn as_str(self) -> &'static str { + use SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor::*; + match self { + Automatic => "automatic", + PhaseStart => "phase_start", + } + } +} + +impl std::str::FromStr for SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor::*; + match s { + "automatic" => Ok(Automatic), + "phase_start" => Ok(PhaseStart), + _ => Err(()), + } + } +} +impl AsRef for SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor", + ) + }) + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// +/// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionSchedulesResourceDefaultSettingsCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl SubscriptionSchedulesResourceDefaultSettingsCollectionMethod { + pub fn as_str(self) -> &'static str { + use SubscriptionSchedulesResourceDefaultSettingsCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for SubscriptionSchedulesResourceDefaultSettingsCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionSchedulesResourceDefaultSettingsCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl AsRef for SubscriptionSchedulesResourceDefaultSettingsCollectionMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SubscriptionSchedulesResourceDefaultSettingsCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionSchedulesResourceDefaultSettingsCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionSchedulesResourceDefaultSettingsCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionSchedulesResourceDefaultSettingsCollectionMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionSchedulesResourceDefaultSettingsCollectionMethod", + ) + }) + } +} diff --git a/stripe_types/src/generated/subscription_schedules_resource_default_settings_automatic_tax/mod.rs b/stripe_types/src/generated/subscription_schedules_resource_default_settings_automatic_tax/mod.rs new file mode 100644 index 000000000..5dd4d8386 --- /dev/null +++ b/stripe_types/src/generated/subscription_schedules_resource_default_settings_automatic_tax/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionSchedulesResourceDefaultSettingsAutomaticTax { + /// Whether Stripe automatically computes tax on invoices created during this phase. + pub enabled: bool, +} diff --git a/stripe_types/src/generated/subscription_transfer_data/mod.rs b/stripe_types/src/generated/subscription_transfer_data/mod.rs new file mode 100644 index 000000000..9b91a27ed --- /dev/null +++ b/stripe_types/src/generated/subscription_transfer_data/mod.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionTransferData { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// + /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. + /// By default, the entire amount is transferred to the destination. + pub amount_percent: Option, + /// The account where funds from the payment will be transferred to upon payment success. + pub destination: stripe_types::Expandable, +} diff --git a/stripe_types/src/generated/subscriptions_resource_pause_collection/mod.rs b/stripe_types/src/generated/subscriptions_resource_pause_collection/mod.rs new file mode 100644 index 000000000..0db7b015c --- /dev/null +++ b/stripe_types/src/generated/subscriptions_resource_pause_collection/mod.rs @@ -0,0 +1,78 @@ +/// The Pause Collection settings determine how we will pause collection for this subscription and for how long the subscription +/// should be paused. +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionsResourcePauseCollection { + /// The payment collection behavior for this subscription while paused. + /// + /// One of `keep_as_draft`, `mark_uncollectible`, or `void`. + pub behavior: SubscriptionsResourcePauseCollectionBehavior, + /// The time after which the subscription will resume collecting payments. + pub resumes_at: Option, +} +/// The payment collection behavior for this subscription while paused. +/// +/// One of `keep_as_draft`, `mark_uncollectible`, or `void`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionsResourcePauseCollectionBehavior { + KeepAsDraft, + MarkUncollectible, + Void, +} +impl SubscriptionsResourcePauseCollectionBehavior { + pub fn as_str(self) -> &'static str { + use SubscriptionsResourcePauseCollectionBehavior::*; + match self { + KeepAsDraft => "keep_as_draft", + MarkUncollectible => "mark_uncollectible", + Void => "void", + } + } +} + +impl std::str::FromStr for SubscriptionsResourcePauseCollectionBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionsResourcePauseCollectionBehavior::*; + match s { + "keep_as_draft" => Ok(KeepAsDraft), + "mark_uncollectible" => Ok(MarkUncollectible), + "void" => Ok(Void), + _ => Err(()), + } + } +} +impl AsRef for SubscriptionsResourcePauseCollectionBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SubscriptionsResourcePauseCollectionBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionsResourcePauseCollectionBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionsResourcePauseCollectionBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionsResourcePauseCollectionBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionsResourcePauseCollectionBehavior", + ) + }) + } +} diff --git a/stripe_types/src/generated/subscriptions_resource_payment_method_options/mod.rs b/stripe_types/src/generated/subscriptions_resource_payment_method_options/mod.rs new file mode 100644 index 000000000..4927ad8c5 --- /dev/null +++ b/stripe_types/src/generated/subscriptions_resource_payment_method_options/mod.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionsResourcePaymentMethodOptions { + /// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to invoices created by the subscription. + pub acss_debit: Option, + /// This sub-hash contains details about the Bancontact payment method options to pass to invoices created by the subscription. + pub bancontact: Option, + /// This sub-hash contains details about the Card payment method options to pass to invoices created by the subscription. + pub card: Option, + /// This sub-hash contains details about the Bank transfer payment method options to pass to invoices created by the subscription. + pub customer_balance: Option, + /// This sub-hash contains details about the Konbini payment method options to pass to invoices created by the subscription. + pub konbini: Option, + /// This sub-hash contains details about the ACH direct debit payment method options to pass to invoices created by the subscription. + pub us_bank_account: Option, +} diff --git a/stripe_types/src/generated/subscriptions_resource_payment_settings/mod.rs b/stripe_types/src/generated/subscriptions_resource_payment_settings/mod.rs new file mode 100644 index 000000000..6358086ad --- /dev/null +++ b/stripe_types/src/generated/subscriptions_resource_payment_settings/mod.rs @@ -0,0 +1,209 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionsResourcePaymentSettings { + /// Payment-method-specific configuration to provide to invoices created by the subscription. + pub payment_method_options: Option, + /// The list of payment method types to provide to every invoice created by the subscription. + /// + /// 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). + pub payment_method_types: Option>, + /// Either `off`, or `on_subscription`. + /// + /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + pub save_default_payment_method: + Option, +} +/// The list of payment method types to provide to every invoice created by the subscription. +/// +/// 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). +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum SubscriptionsResourcePaymentSettingsPaymentMethodTypes { + AchCreditTransfer, + AchDebit, + AcssDebit, + AuBecsDebit, + BacsDebit, + Bancontact, + Boleto, + Card, + Cashapp, + CustomerBalance, + Fpx, + Giropay, + Grabpay, + Ideal, + Konbini, + Link, + Paynow, + Paypal, + Promptpay, + SepaCreditTransfer, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl SubscriptionsResourcePaymentSettingsPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use SubscriptionsResourcePaymentSettingsPaymentMethodTypes::*; + match self { + AchCreditTransfer => "ach_credit_transfer", + AchDebit => "ach_debit", + AcssDebit => "acss_debit", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Konbini => "konbini", + Link => "link", + Paynow => "paynow", + Paypal => "paypal", + Promptpay => "promptpay", + SepaCreditTransfer => "sepa_credit_transfer", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for SubscriptionsResourcePaymentSettingsPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionsResourcePaymentSettingsPaymentMethodTypes::*; + match s { + "ach_credit_transfer" => Ok(AchCreditTransfer), + "ach_debit" => Ok(AchDebit), + "acss_debit" => Ok(AcssDebit), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "promptpay" => Ok(Promptpay), + "sepa_credit_transfer" => Ok(SepaCreditTransfer), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + _ => Err(()), + } + } +} +impl AsRef for SubscriptionsResourcePaymentSettingsPaymentMethodTypes { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SubscriptionsResourcePaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionsResourcePaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionsResourcePaymentSettingsPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionsResourcePaymentSettingsPaymentMethodTypes { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s) + .unwrap_or(SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Unknown)) + } +} +/// Either `off`, or `on_subscription`. +/// +/// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { + Off, + OnSubscription, +} +impl SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { + pub fn as_str(self) -> &'static str { + use SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod::*; + match self { + Off => "off", + OnSubscription => "on_subscription", + } + } +} + +impl std::str::FromStr for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod::*; + match s { + "off" => Ok(Off), + "on_subscription" => Ok(OnSubscription), + _ => Err(()), + } + } +} +impl AsRef for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod", + ) + }) + } +} diff --git a/stripe_types/src/generated/subscriptions_resource_pending_update/mod.rs b/stripe_types/src/generated/subscriptions_resource_pending_update/mod.rs new file mode 100644 index 000000000..6c2638acb --- /dev/null +++ b/stripe_types/src/generated/subscriptions_resource_pending_update/mod.rs @@ -0,0 +1,21 @@ +/// Pending Updates store the changes pending from a previous update that will be applied +/// to the Subscription upon successful payment. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionsResourcePendingUpdate { + /// 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. + /// + /// The timestamp is in UTC format. + pub billing_cycle_anchor: Option, + /// The point after which the changes reflected by this update will be discarded and no longer applied. + pub expires_at: stripe_types::Timestamp, + /// List of subscription items, each with an attached plan, that will be set if the update is applied. + pub subscription_items: Option>, + /// 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. + pub trial_end: Option, + /// Indicates if a plan's `trial_period_days` should be applied to the subscription. + /// + /// Setting `trial_end` per subscription is preferred, and this defaults to `false`. + /// Setting this flag to `true` together with `trial_end` is not allowed. + /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + pub trial_from_plan: Option, +} diff --git a/stripe_types/src/generated/subscriptions_trials_resource_end_behavior/mod.rs b/stripe_types/src/generated/subscriptions_trials_resource_end_behavior/mod.rs new file mode 100644 index 000000000..f2330596f --- /dev/null +++ b/stripe_types/src/generated/subscriptions_trials_resource_end_behavior/mod.rs @@ -0,0 +1,71 @@ +/// Defines how a subscription behaves when a free trial ends. +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionsTrialsResourceEndBehavior { + /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + pub missing_payment_method: SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod, +} +/// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + Cancel, + CreateInvoice, + Pause, +} +impl SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + pub fn as_str(self) -> &'static str { + use SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::*; + match self { + Cancel => "cancel", + CreateInvoice => "create_invoice", + Pause => "pause", + } + } +} + +impl std::str::FromStr for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::*; + match s { + "cancel" => Ok(Cancel), + "create_invoice" => Ok(CreateInvoice), + "pause" => Ok(Pause), + _ => Err(()), + } + } +} +impl AsRef for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod", + ) + }) + } +} diff --git a/stripe_types/src/generated/subscriptions_trials_resource_trial_settings/mod.rs b/stripe_types/src/generated/subscriptions_trials_resource_trial_settings/mod.rs new file mode 100644 index 000000000..9244cd8c2 --- /dev/null +++ b/stripe_types/src/generated/subscriptions_trials_resource_trial_settings/mod.rs @@ -0,0 +1,5 @@ +/// Configures how this subscription behaves during the trial period. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionsTrialsResourceTrialSettings { + pub end_behavior: stripe_types::SubscriptionsTrialsResourceEndBehavior, +} diff --git a/stripe_types/src/generated/tax_deducted_at_source/mod.rs b/stripe_types/src/generated/tax_deducted_at_source/mod.rs new file mode 100644 index 000000000..fcffbc079 --- /dev/null +++ b/stripe_types/src/generated/tax_deducted_at_source/mod.rs @@ -0,0 +1,22 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxDeductedAtSource { + /// Unique identifier for the object. + pub id: stripe_types::tax_deducted_at_source::TaxDeductedAtSourceId, + /// The end of the invoicing period. + /// + /// This TDS applies to Stripe fees collected during this invoicing period. + pub period_end: stripe_types::Timestamp, + /// The start of the invoicing period. + /// + /// This TDS applies to Stripe fees collected during this invoicing period. + pub period_start: stripe_types::Timestamp, + /// The TAN that was supplied to Stripe when TDS was assessed. + pub tax_deduction_account_number: String, +} +impl stripe_types::Object for TaxDeductedAtSource { + type Id = stripe_types::tax_deducted_at_source::TaxDeductedAtSourceId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TaxDeductedAtSourceId, "itds_"); diff --git a/stripe_types/src/generated/tax_id/mod.rs b/stripe_types/src/generated/tax_id/mod.rs new file mode 100644 index 000000000..cd425ff4f --- /dev/null +++ b/stripe_types/src/generated/tax_id/mod.rs @@ -0,0 +1,292 @@ +/// You can add one or multiple tax IDs to a [customer](https://stripe.com/docs/api/customers) or account. +/// Customer and account tax IDs get displayed on related invoices and credit notes. +/// +/// Related guides: [Customer tax identification numbers](https://stripe.com/docs/billing/taxes/tax-ids), [Account tax IDs](https://stripe.com/docs/invoicing/connect#account-tax-ids) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxId { + /// Two-letter ISO code representing the country of the tax ID. + pub country: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// ID of the customer. + pub customer: Option>, + /// Unique identifier for the object. + pub id: stripe_types::tax_id::TaxIdId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. + /// + /// Note that some legacy tax IDs have type `unknown`. + #[serde(rename = "type")] + pub type_: TaxIdType, + /// Value of the tax ID. + pub value: String, + /// Tax ID verification information. + pub verification: Option, +} +/// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. +/// +/// Note that some legacy tax IDs have type `unknown`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxIdType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + Unknown, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, +} +impl TaxIdType { + pub fn as_str(self) -> &'static str { + use TaxIdType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + Unknown => "unknown", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + } + } +} + +impl std::str::FromStr for TaxIdType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxIdType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "unknown" => Ok(Unknown), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl AsRef for TaxIdType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxIdType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxIdType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TaxIdType")) + } +} +impl stripe_types::Object for TaxId { + type Id = stripe_types::tax_id::TaxIdId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TaxIdId, "txi_"); diff --git a/stripe_types/src/generated/tax_id_verification/mod.rs b/stripe_types/src/generated/tax_id_verification/mod.rs new file mode 100644 index 000000000..e1e72d038 --- /dev/null +++ b/stripe_types/src/generated/tax_id_verification/mod.rs @@ -0,0 +1,74 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxIdVerification { + /// Verification status, one of `pending`, `verified`, `unverified`, or `unavailable`. + pub status: TaxIdVerificationStatus, + /// Verified address. + pub verified_address: Option, + /// Verified name. + pub verified_name: Option, +} +/// Verification status, one of `pending`, `verified`, `unverified`, or `unavailable`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxIdVerificationStatus { + Pending, + Unavailable, + Unverified, + Verified, +} +impl TaxIdVerificationStatus { + pub fn as_str(self) -> &'static str { + use TaxIdVerificationStatus::*; + match self { + Pending => "pending", + Unavailable => "unavailable", + Unverified => "unverified", + Verified => "verified", + } + } +} + +impl std::str::FromStr for TaxIdVerificationStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxIdVerificationStatus::*; + match s { + "pending" => Ok(Pending), + "unavailable" => Ok(Unavailable), + "unverified" => Ok(Unverified), + "verified" => Ok(Verified), + _ => Err(()), + } + } +} +impl AsRef for TaxIdVerificationStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxIdVerificationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxIdVerificationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxIdVerificationStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxIdVerificationStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TaxIdVerificationStatus")) + } +} diff --git a/stripe_types/src/generated/tax_product_resource_tax_code/mod.rs b/stripe_types/src/generated/tax_product_resource_tax_code/mod.rs new file mode 100644 index 000000000..740e672ab --- /dev/null +++ b/stripe_types/src/generated/tax_product_resource_tax_code/mod.rs @@ -0,0 +1,19 @@ +/// [Tax codes](https://stripe.com/docs/tax/tax-categories) classify goods and services for tax purposes. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxCode { + /// A detailed description of which types of products the tax code represents. + pub description: String, + /// Unique identifier for the object. + pub id: stripe_types::tax_product_resource_tax_code::TaxCodeId, + /// A short name for the tax code. + pub name: String, +} +impl stripe_types::Object for TaxProductResourceTaxCode { + type Id = stripe_types::tax_product_resource_tax_code::TaxCodeId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TaxCodeId, "txcd_"); diff --git a/stripe_types/src/generated/tax_rate/mod.rs b/stripe_types/src/generated/tax_rate/mod.rs new file mode 100644 index 000000000..0a1d68c79 --- /dev/null +++ b/stripe_types/src/generated/tax_rate/mod.rs @@ -0,0 +1,155 @@ +/// Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. +/// +/// Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxRate { + /// Defaults to `true`. + /// + /// When set to `false`, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. + pub active: bool, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// An arbitrary string attached to the tax rate for your internal use only. + /// + /// It will not be visible to your customers. + pub description: Option, + /// The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page. + pub display_name: String, + /// Actual/effective tax rate percentage out of 100. + /// + /// For tax calculations with automatic_tax[enabled]=true, this percentage reflects the rate actually used to calculate tax based on the product's taxability and whether the user is registered to collect taxes in the corresponding jurisdiction. + pub effective_percentage: Option, + /// Unique identifier for the object. + pub id: stripe_types::tax_rate::TaxRateId, + /// This specifies if the tax rate is inclusive or exclusive. + pub inclusive: bool, + /// The jurisdiction for the tax rate. + /// + /// You can use this label field for tax reporting purposes. + /// It also appears on your customer’s invoice. + pub jurisdiction: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// Tax rate percentage out of 100. + /// + /// For tax calculations with automatic_tax[enabled]=true, this percentage includes the statutory tax rate of non-taxable jurisdictions. + pub percentage: f64, + /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. + /// + /// For example, "NY" for New York, United States. + pub state: Option, + /// The high-level tax type, such as `vat` or `sales_tax`. + pub tax_type: Option, +} +/// The high-level tax type, such as `vat` or `sales_tax`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum TaxRateTaxType { + AmusementTax, + CommunicationsTax, + Gst, + Hst, + Igst, + Jct, + LeaseTax, + Pst, + Qst, + Rst, + SalesTax, + ServiceTax, + Vat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl TaxRateTaxType { + pub fn as_str(self) -> &'static str { + use TaxRateTaxType::*; + match self { + AmusementTax => "amusement_tax", + CommunicationsTax => "communications_tax", + Gst => "gst", + Hst => "hst", + Igst => "igst", + Jct => "jct", + LeaseTax => "lease_tax", + Pst => "pst", + Qst => "qst", + Rst => "rst", + SalesTax => "sales_tax", + ServiceTax => "service_tax", + Vat => "vat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for TaxRateTaxType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxRateTaxType::*; + match s { + "amusement_tax" => Ok(AmusementTax), + "communications_tax" => Ok(CommunicationsTax), + "gst" => Ok(Gst), + "hst" => Ok(Hst), + "igst" => Ok(Igst), + "jct" => Ok(Jct), + "lease_tax" => Ok(LeaseTax), + "pst" => Ok(Pst), + "qst" => Ok(Qst), + "rst" => Ok(Rst), + "sales_tax" => Ok(SalesTax), + "service_tax" => Ok(ServiceTax), + "vat" => Ok(Vat), + _ => Err(()), + } + } +} +impl AsRef for TaxRateTaxType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TaxRateTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxRateTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxRateTaxType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxRateTaxType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(TaxRateTaxType::Unknown)) + } +} +impl stripe_types::Object for TaxRate { + type Id = stripe_types::tax_rate::TaxRateId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TaxRateId, "txr_"); diff --git a/stripe_types/src/generated/test_clock/mod.rs b/stripe_types/src/generated/test_clock/mod.rs new file mode 100644 index 000000000..5d1093077 --- /dev/null +++ b/stripe_types/src/generated/test_clock/mod.rs @@ -0,0 +1,92 @@ +/// A test clock enables deterministic control over objects in testmode. +/// +/// With a test clock, you can create objects at a frozen time in the past or future, and advance to a specific future time to observe webhooks and state changes. +/// After the clock advances, you can either validate the current state of your scenario (and test your assumptions), change the current state of your scenario (and test more complex scenarios), or keep advancing forward in time. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TestClock { + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Time at which this clock is scheduled to auto delete. + pub deletes_after: stripe_types::Timestamp, + /// Time at which all objects belonging to this clock are frozen. + pub frozen_time: stripe_types::Timestamp, + /// Unique identifier for the object. + pub id: stripe_types::test_clock::TestHelpersTestClockId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The custom name supplied at creation. + pub name: Option, + /// The status of the Test Clock. + pub status: TestClockStatus, +} +/// The status of the Test Clock. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TestClockStatus { + Advancing, + InternalFailure, + Ready, +} +impl TestClockStatus { + pub fn as_str(self) -> &'static str { + use TestClockStatus::*; + match self { + Advancing => "advancing", + InternalFailure => "internal_failure", + Ready => "ready", + } + } +} + +impl std::str::FromStr for TestClockStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TestClockStatus::*; + match s { + "advancing" => Ok(Advancing), + "internal_failure" => Ok(InternalFailure), + "ready" => Ok(Ready), + _ => Err(()), + } + } +} +impl AsRef for TestClockStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TestClockStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TestClockStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TestClockStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TestClockStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TestClockStatus")) + } +} +impl stripe_types::Object for TestClock { + type Id = stripe_types::test_clock::TestHelpersTestClockId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TestHelpersTestClockId, "clock_"); diff --git a/stripe_types/src/generated/three_d_secure_details/mod.rs b/stripe_types/src/generated/three_d_secure_details/mod.rs new file mode 100644 index 000000000..56328569a --- /dev/null +++ b/stripe_types/src/generated/three_d_secure_details/mod.rs @@ -0,0 +1,283 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct ThreeDSecureDetails { + /// For authenticated transactions: how the customer was authenticated by + /// the issuing bank. + pub authentication_flow: Option, + /// Indicates the outcome of 3D Secure authentication. + pub result: Option, + /// Additional information about why 3D Secure succeeded or failed based + /// on the `result`. + pub result_reason: Option, + /// The version of 3D Secure that was used. + pub version: Option, +} +/// For authenticated transactions: how the customer was authenticated by +/// the issuing bank. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsAuthenticationFlow { + Challenge, + Frictionless, +} +impl ThreeDSecureDetailsAuthenticationFlow { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsAuthenticationFlow::*; + match self { + Challenge => "challenge", + Frictionless => "frictionless", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsAuthenticationFlow { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsAuthenticationFlow::*; + match s { + "challenge" => Ok(Challenge), + "frictionless" => Ok(Frictionless), + _ => Err(()), + } + } +} +impl AsRef for ThreeDSecureDetailsAuthenticationFlow { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ThreeDSecureDetailsAuthenticationFlow { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsAuthenticationFlow { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsAuthenticationFlow { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsAuthenticationFlow { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for ThreeDSecureDetailsAuthenticationFlow") + }) + } +} +/// Indicates the outcome of 3D Secure authentication. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsResult { + AttemptAcknowledged, + Authenticated, + Exempted, + Failed, + NotSupported, + ProcessingError, +} +impl ThreeDSecureDetailsResult { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsResult::*; + match self { + AttemptAcknowledged => "attempt_acknowledged", + Authenticated => "authenticated", + Exempted => "exempted", + Failed => "failed", + NotSupported => "not_supported", + ProcessingError => "processing_error", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsResult { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsResult::*; + match s { + "attempt_acknowledged" => Ok(AttemptAcknowledged), + "authenticated" => Ok(Authenticated), + "exempted" => Ok(Exempted), + "failed" => Ok(Failed), + "not_supported" => Ok(NotSupported), + "processing_error" => Ok(ProcessingError), + _ => Err(()), + } + } +} +impl AsRef for ThreeDSecureDetailsResult { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ThreeDSecureDetailsResult { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsResult { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsResult { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsResult { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for ThreeDSecureDetailsResult")) + } +} +/// Additional information about why 3D Secure succeeded or failed based +/// on the `result`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsResultReason { + Abandoned, + Bypassed, + Canceled, + CardNotEnrolled, + NetworkNotSupported, + ProtocolError, + Rejected, +} +impl ThreeDSecureDetailsResultReason { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsResultReason::*; + match self { + Abandoned => "abandoned", + Bypassed => "bypassed", + Canceled => "canceled", + CardNotEnrolled => "card_not_enrolled", + NetworkNotSupported => "network_not_supported", + ProtocolError => "protocol_error", + Rejected => "rejected", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsResultReason { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsResultReason::*; + match s { + "abandoned" => Ok(Abandoned), + "bypassed" => Ok(Bypassed), + "canceled" => Ok(Canceled), + "card_not_enrolled" => Ok(CardNotEnrolled), + "network_not_supported" => Ok(NetworkNotSupported), + "protocol_error" => Ok(ProtocolError), + "rejected" => Ok(Rejected), + _ => Err(()), + } + } +} +impl AsRef for ThreeDSecureDetailsResultReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ThreeDSecureDetailsResultReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsResultReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsResultReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsResultReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for ThreeDSecureDetailsResultReason") + }) + } +} +/// The version of 3D Secure that was used. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsVersion { + V1_0_2, + V2_1_0, + V2_2_0, +} +impl ThreeDSecureDetailsVersion { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsVersion::*; + match self { + V1_0_2 => "1.0.2", + V2_1_0 => "2.1.0", + V2_2_0 => "2.2.0", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsVersion { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsVersion::*; + match s { + "1.0.2" => Ok(V1_0_2), + "2.1.0" => Ok(V2_1_0), + "2.2.0" => Ok(V2_2_0), + _ => Err(()), + } + } +} +impl AsRef for ThreeDSecureDetailsVersion { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ThreeDSecureDetailsVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsVersion { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsVersion { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for ThreeDSecureDetailsVersion")) + } +} diff --git a/stripe_types/src/generated/three_d_secure_details_charge/mod.rs b/stripe_types/src/generated/three_d_secure_details_charge/mod.rs new file mode 100644 index 000000000..4653eaf6c --- /dev/null +++ b/stripe_types/src/generated/three_d_secure_details_charge/mod.rs @@ -0,0 +1,287 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct ThreeDSecureDetailsCharge { + /// For authenticated transactions: how the customer was authenticated by + /// the issuing bank. + pub authentication_flow: Option, + /// Indicates the outcome of 3D Secure authentication. + pub result: Option, + /// Additional information about why 3D Secure succeeded or failed based + /// on the `result`. + pub result_reason: Option, + /// The version of 3D Secure that was used. + pub version: Option, +} +/// For authenticated transactions: how the customer was authenticated by +/// the issuing bank. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsChargeAuthenticationFlow { + Challenge, + Frictionless, +} +impl ThreeDSecureDetailsChargeAuthenticationFlow { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsChargeAuthenticationFlow::*; + match self { + Challenge => "challenge", + Frictionless => "frictionless", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsChargeAuthenticationFlow { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsChargeAuthenticationFlow::*; + match s { + "challenge" => Ok(Challenge), + "frictionless" => Ok(Frictionless), + _ => Err(()), + } + } +} +impl AsRef for ThreeDSecureDetailsChargeAuthenticationFlow { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ThreeDSecureDetailsChargeAuthenticationFlow { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsChargeAuthenticationFlow { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsChargeAuthenticationFlow { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsChargeAuthenticationFlow { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for ThreeDSecureDetailsChargeAuthenticationFlow", + ) + }) + } +} +/// Indicates the outcome of 3D Secure authentication. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsChargeResult { + AttemptAcknowledged, + Authenticated, + Exempted, + Failed, + NotSupported, + ProcessingError, +} +impl ThreeDSecureDetailsChargeResult { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsChargeResult::*; + match self { + AttemptAcknowledged => "attempt_acknowledged", + Authenticated => "authenticated", + Exempted => "exempted", + Failed => "failed", + NotSupported => "not_supported", + ProcessingError => "processing_error", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsChargeResult { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsChargeResult::*; + match s { + "attempt_acknowledged" => Ok(AttemptAcknowledged), + "authenticated" => Ok(Authenticated), + "exempted" => Ok(Exempted), + "failed" => Ok(Failed), + "not_supported" => Ok(NotSupported), + "processing_error" => Ok(ProcessingError), + _ => Err(()), + } + } +} +impl AsRef for ThreeDSecureDetailsChargeResult { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ThreeDSecureDetailsChargeResult { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsChargeResult { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsChargeResult { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsChargeResult { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for ThreeDSecureDetailsChargeResult") + }) + } +} +/// Additional information about why 3D Secure succeeded or failed based +/// on the `result`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsChargeResultReason { + Abandoned, + Bypassed, + Canceled, + CardNotEnrolled, + NetworkNotSupported, + ProtocolError, + Rejected, +} +impl ThreeDSecureDetailsChargeResultReason { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsChargeResultReason::*; + match self { + Abandoned => "abandoned", + Bypassed => "bypassed", + Canceled => "canceled", + CardNotEnrolled => "card_not_enrolled", + NetworkNotSupported => "network_not_supported", + ProtocolError => "protocol_error", + Rejected => "rejected", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsChargeResultReason { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsChargeResultReason::*; + match s { + "abandoned" => Ok(Abandoned), + "bypassed" => Ok(Bypassed), + "canceled" => Ok(Canceled), + "card_not_enrolled" => Ok(CardNotEnrolled), + "network_not_supported" => Ok(NetworkNotSupported), + "protocol_error" => Ok(ProtocolError), + "rejected" => Ok(Rejected), + _ => Err(()), + } + } +} +impl AsRef for ThreeDSecureDetailsChargeResultReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ThreeDSecureDetailsChargeResultReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsChargeResultReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsChargeResultReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsChargeResultReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for ThreeDSecureDetailsChargeResultReason") + }) + } +} +/// The version of 3D Secure that was used. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsChargeVersion { + V1_0_2, + V2_1_0, + V2_2_0, +} +impl ThreeDSecureDetailsChargeVersion { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsChargeVersion::*; + match self { + V1_0_2 => "1.0.2", + V2_1_0 => "2.1.0", + V2_2_0 => "2.2.0", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsChargeVersion { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsChargeVersion::*; + match s { + "1.0.2" => Ok(V1_0_2), + "2.1.0" => Ok(V2_1_0), + "2.2.0" => Ok(V2_2_0), + _ => Err(()), + } + } +} +impl AsRef for ThreeDSecureDetailsChargeVersion { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for ThreeDSecureDetailsChargeVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsChargeVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsChargeVersion { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsChargeVersion { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for ThreeDSecureDetailsChargeVersion") + }) + } +} diff --git a/stripe_types/src/generated/three_d_secure_usage/mod.rs b/stripe_types/src/generated/three_d_secure_usage/mod.rs new file mode 100644 index 000000000..c2869dd18 --- /dev/null +++ b/stripe_types/src/generated/three_d_secure_usage/mod.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ThreeDSecureUsage { + /// Whether 3D Secure is supported on this card. + pub supported: bool, +} diff --git a/stripe_types/src/generated/topup/mod.rs b/stripe_types/src/generated/topup/mod.rs new file mode 100644 index 000000000..514862732 --- /dev/null +++ b/stripe_types/src/generated/topup/mod.rs @@ -0,0 +1,129 @@ +/// To top up your Stripe balance, you create a top-up object. +/// +/// You can retrieve individual top-ups, as well as list all top-ups. +/// Top-ups are identified by a unique, random ID. Related guide: [Topping up your platform account](https://stripe.com/docs/connect/top-ups) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Topup { + /// Amount transferred. + pub amount: i64, + /// ID of the balance transaction that describes the impact of this top-up on your account balance. + /// + /// May not be specified depending on status of top-up. + pub balance_transaction: Option>, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// Date the funds are expected to arrive in your Stripe account for payouts. + /// + /// This factors in delays like weekends or bank holidays. + /// May not be specified depending on status of top-up. + pub expected_availability_date: Option, + /// Error code explaining reason for top-up failure if available (see [the errors section](https://stripe.com/docs/api#errors) for a list of codes). + pub failure_code: Option, + /// Message to user further explaining reason for top-up failure if available. + pub failure_message: Option, + /// Unique identifier for the object. + pub id: stripe_types::topup::TopupId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The source field is deprecated. + /// + /// It might not always be present in the API response. + pub source: Option, + /// Extra information about a top-up. + /// + /// This will appear on your source's bank statement. + /// It must contain at least one letter. + pub statement_descriptor: Option, + /// The status of the top-up is either `canceled`, `failed`, `pending`, `reversed`, or `succeeded`. + pub status: TopupStatus, + /// A string that identifies this top-up as part of a group. + pub transfer_group: Option, +} +/// The status of the top-up is either `canceled`, `failed`, `pending`, `reversed`, or `succeeded`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TopupStatus { + Canceled, + Failed, + Pending, + Reversed, + Succeeded, +} +impl TopupStatus { + pub fn as_str(self) -> &'static str { + use TopupStatus::*; + match self { + Canceled => "canceled", + Failed => "failed", + Pending => "pending", + Reversed => "reversed", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for TopupStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TopupStatus::*; + match s { + "canceled" => Ok(Canceled), + "failed" => Ok(Failed), + "pending" => Ok(Pending), + "reversed" => Ok(Reversed), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl AsRef for TopupStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TopupStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TopupStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TopupStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TopupStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TopupStatus")) + } +} +impl stripe_types::Object for Topup { + type Id = stripe_types::topup::TopupId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TopupId, "tu_"); diff --git a/stripe_types/src/generated/transfer/mod.rs b/stripe_types/src/generated/transfer/mod.rs new file mode 100644 index 000000000..ec527cc4e --- /dev/null +++ b/stripe_types/src/generated/transfer/mod.rs @@ -0,0 +1,66 @@ +/// A `Transfer` object is created when you move funds between Stripe accounts as +/// part of Connect. +/// +/// Before April 6, 2017, transfers also represented movement of funds from a +/// Stripe account to a card or bank account. +/// +/// This behavior has since been split out into a [Payout](https://stripe.com/docs/api#payout_object) object, with corresponding payout endpoints. +/// For more information, read about the [transfer/payout split](https://stripe.com/docs/transfer-payout-split). Related guide: [Creating separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Transfer { + /// Amount in cents (or local equivalent) to be transferred. + pub amount: i64, + /// Amount in cents (or local equivalent) reversed (can be less than the amount attribute on the transfer if a partial reversal was issued). + pub amount_reversed: i64, + /// Balance transaction that describes the impact of this transfer on your account balance. + pub balance_transaction: Option>, + /// Time that this record of the transfer was first created. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// + /// Often useful for displaying to users. + pub description: Option, + /// ID of the Stripe account the transfer was sent to. + pub destination: Option>, + /// If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination_payment: Option>, + /// Unique identifier for the object. + pub id: stripe_types::transfer::TransferId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// A list of reversals that have been applied to the transfer. + pub reversals: stripe_types::List, + /// Whether the transfer has been fully reversed. + /// + /// If the transfer is only partially reversed, this attribute will still be false. + pub reversed: bool, + /// ID of the charge or payment that was used to fund the transfer. + /// + /// If null, the transfer was funded from the available balance. + pub source_transaction: Option>, + /// The source balance this transfer came from. + /// + /// One of `card`, `fpx`, or `bank_account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub source_type: Option, + /// A string that identifies this transaction as part of a group. + /// + /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + pub transfer_group: Option, +} +impl stripe_types::Object for Transfer { + type Id = stripe_types::transfer::TransferId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TransferId, "tr_"); diff --git a/stripe_types/src/generated/transfer_data/mod.rs b/stripe_types/src/generated/transfer_data/mod.rs new file mode 100644 index 000000000..ff5e3a58a --- /dev/null +++ b/stripe_types/src/generated/transfer_data/mod.rs @@ -0,0 +1,14 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TransferData { + /// Amount intended to be collected by this PaymentIntent. + /// + /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The account (if any) that the payment is attributed to for tax + /// reporting, and where funds from the payment are transferred to after + /// payment success. + pub destination: stripe_types::Expandable, +} diff --git a/stripe_types/src/generated/transfer_reversal/mod.rs b/stripe_types/src/generated/transfer_reversal/mod.rs new file mode 100644 index 000000000..9034c617b --- /dev/null +++ b/stripe_types/src/generated/transfer_reversal/mod.rs @@ -0,0 +1,40 @@ +/// [Stripe Connect](https://stripe.com/docs/connect) platforms can reverse transfers made to a +/// connected account, either entirely or partially, and can also specify whether +/// to refund any related application fees. +/// +/// Transfer reversals add to the platform's balance and subtract from the destination account's balance. Reversing a transfer that was made for a [destination charge](/docs/connect/destination-charges) is allowed only up to the amount of the charge. +/// It is possible to reverse a [transfer_group](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) transfer only if the destination account has enough balance to cover the reversal. Related guide: [Reversing transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#reversing-transfers) For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TransferReversal { + /// Amount, in cents (or local equivalent). + pub amount: i64, + /// Balance transaction that describes the impact on your account balance. + pub balance_transaction: Option>, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Linked payment refund for the transfer reversal. + pub destination_payment_refund: Option>, + /// Unique identifier for the object. + pub id: stripe_types::transfer_reversal::TransferReversalId, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// ID of the refund responsible for the transfer reversal. + pub source_refund: Option>, + /// ID of the transfer that was reversed. + pub transfer: stripe_types::Expandable, +} +impl stripe_types::Object for TransferReversal { + type Id = stripe_types::transfer_reversal::TransferReversalId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(TransferReversalId, "trr_"); diff --git a/stripe_types/src/generated/transfer_schedule/mod.rs b/stripe_types/src/generated/transfer_schedule/mod.rs new file mode 100644 index 000000000..d6a19ccd4 --- /dev/null +++ b/stripe_types/src/generated/transfer_schedule/mod.rs @@ -0,0 +1,20 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TransferSchedule { + /// The number of days charges for the account will be held before being paid out. + pub delay_days: u32, + /// How frequently funds will be paid out. + /// + /// One of `manual` (payouts only created via API call), `daily`, `weekly`, or `monthly`. + pub interval: String, + /// The day of the month funds will be paid out. + /// + /// Only shown if `interval` is monthly. + /// Payouts scheduled between the 29th and 31st of the month are sent on the last day of shorter months. + #[serde(skip_serializing_if = "Option::is_none")] + pub monthly_anchor: Option, + /// The day of the week funds will be paid out, of the style 'monday', 'tuesday', etc. + /// + /// Only shown if `interval` is weekly. + #[serde(skip_serializing_if = "Option::is_none")] + pub weekly_anchor: Option, +} diff --git a/stripe_types/src/generated/transform_quantity/mod.rs b/stripe_types/src/generated/transform_quantity/mod.rs new file mode 100644 index 000000000..301c18e4f --- /dev/null +++ b/stripe_types/src/generated/transform_quantity/mod.rs @@ -0,0 +1,66 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TransformQuantity { + /// Divide usage by this number. + pub divide_by: i64, + /// After division, either round the result `up` or `down`. + pub round: TransformQuantityRound, +} +/// After division, either round the result `up` or `down`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TransformQuantityRound { + Down, + Up, +} +impl TransformQuantityRound { + pub fn as_str(self) -> &'static str { + use TransformQuantityRound::*; + match self { + Down => "down", + Up => "up", + } + } +} + +impl std::str::FromStr for TransformQuantityRound { + type Err = (); + fn from_str(s: &str) -> Result { + use TransformQuantityRound::*; + match s { + "down" => Ok(Down), + "up" => Ok(Up), + _ => Err(()), + } + } +} +impl AsRef for TransformQuantityRound { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TransformQuantityRound { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TransformQuantityRound { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TransformQuantityRound { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TransformQuantityRound { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TransformQuantityRound")) + } +} diff --git a/stripe_types/src/generated/transform_usage/mod.rs b/stripe_types/src/generated/transform_usage/mod.rs new file mode 100644 index 000000000..a85c65352 --- /dev/null +++ b/stripe_types/src/generated/transform_usage/mod.rs @@ -0,0 +1,66 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TransformUsage { + /// Divide usage by this number. + pub divide_by: i64, + /// After division, either round the result `up` or `down`. + pub round: TransformUsageRound, +} +/// After division, either round the result `up` or `down`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TransformUsageRound { + Down, + Up, +} +impl TransformUsageRound { + pub fn as_str(self) -> &'static str { + use TransformUsageRound::*; + match self { + Down => "down", + Up => "up", + } + } +} + +impl std::str::FromStr for TransformUsageRound { + type Err = (); + fn from_str(s: &str) -> Result { + use TransformUsageRound::*; + match s { + "down" => Ok(Down), + "up" => Ok(Up), + _ => Err(()), + } + } +} +impl AsRef for TransformUsageRound { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for TransformUsageRound { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TransformUsageRound { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TransformUsageRound { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TransformUsageRound { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TransformUsageRound")) + } +} diff --git a/stripe_types/src/generated/us_bank_account_networks/mod.rs b/stripe_types/src/generated/us_bank_account_networks/mod.rs new file mode 100644 index 000000000..9f4a444fa --- /dev/null +++ b/stripe_types/src/generated/us_bank_account_networks/mod.rs @@ -0,0 +1,67 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct UsBankAccountNetworks { + /// The preferred network. + pub preferred: Option, + /// All supported networks. + pub supported: Vec, +} +/// All supported networks. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UsBankAccountNetworksSupported { + Ach, + UsDomesticWire, +} +impl UsBankAccountNetworksSupported { + pub fn as_str(self) -> &'static str { + use UsBankAccountNetworksSupported::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for UsBankAccountNetworksSupported { + type Err = (); + fn from_str(s: &str) -> Result { + use UsBankAccountNetworksSupported::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl AsRef for UsBankAccountNetworksSupported { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl std::fmt::Display for UsBankAccountNetworksSupported { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UsBankAccountNetworksSupported { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UsBankAccountNetworksSupported { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for UsBankAccountNetworksSupported { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for UsBankAccountNetworksSupported") + }) + } +} diff --git a/stripe_types/src/generated/usage_record_summary/mod.rs b/stripe_types/src/generated/usage_record_summary/mod.rs new file mode 100644 index 000000000..8d7cb1957 --- /dev/null +++ b/stripe_types/src/generated/usage_record_summary/mod.rs @@ -0,0 +1,21 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct UsageRecordSummary { + /// Unique identifier for the object. + pub id: stripe_types::usage_record_summary::UsageRecordSummaryId, + /// The invoice in which this usage period has been billed for. + pub invoice: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + pub period: stripe_types::Period, + /// The ID of the subscription item this summary is describing. + pub subscription_item: String, + /// The total usage within this usage period. + pub total_usage: i64, +} +impl stripe_types::Object for UsageRecordSummary { + type Id = stripe_types::usage_record_summary::UsageRecordSummaryId; + fn id(&self) -> Option<&str> { + Some(self.id.as_str()) + } +} +stripe_types::def_id!(UsageRecordSummaryId, "urs_" | "sis_"); diff --git a/stripe_types/src/generated/version.rs b/stripe_types/src/generated/version.rs new file mode 100644 index 000000000..351cac38b --- /dev/null +++ b/stripe_types/src/generated/version.rs @@ -0,0 +1 @@ +pub const VERSION: crate::ApiVersion = crate::ApiVersion::V2023_10_16; diff --git a/stripe_types/src/lib.rs b/stripe_types/src/lib.rs index 526f81489..bbd3119a5 100644 --- a/stripe_types/src/lib.rs +++ b/stripe_types/src/lib.rs @@ -6,6 +6,7 @@ mod currency; mod expandable; +mod generated; mod ids; mod pagination; mod params; diff --git a/stripe_webhook/Cargo.toml b/stripe_webhook/Cargo.toml new file mode 100644 index 000000000..2582c98be --- /dev/null +++ b/stripe_webhook/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "stripe_webhook" +version = "0.1.0" +edition = "2021" + +[dependencies] +stripe_types = {path = "../stripe_types"} +hmac = "0.12" +sha2 = "0.10" +hex = "0.4" +chrono = { version = "0.4", default-features = false, features = ["clock"] } +thiserror = "1.0.24" +serde_json.workspace = true +serde.workspace = true + +stripe_core = {path = "../generated/stripe_core", optional = true} +stripe_checkout = {path = "../generated/stripe_checkout", optional = true} +stripe_billing = {path = "../generated/stripe_billing", optional = true} + +[package.metadata.docs.rs] +features = ["stripe_core", "stripe_checkout", "stripe_billing"] \ No newline at end of file diff --git a/stripe_webhook/src/error.rs b/stripe_webhook/src/error.rs new file mode 100644 index 000000000..00649a7f2 --- /dev/null +++ b/stripe_webhook/src/error.rs @@ -0,0 +1,16 @@ +use std::num::ParseIntError; + +/// An error encountered when communicating with the Stripe API webhooks. +#[derive(Debug, thiserror::Error)] +pub enum WebhookError { + #[error("invalid key length")] + BadKey, + #[error("error parsing timestamp")] + BadHeader(#[from] ParseIntError), + #[error("error comparing signatures")] + BadSignature, + #[error("error comparing timestamps - over tolerance")] + BadTimestamp(i64), + #[error("error parsing event object")] + BadParse(#[from] serde_json::Error), +} diff --git a/stripe_webhook/src/generated/mod.rs b/stripe_webhook/src/generated/mod.rs new file mode 100644 index 000000000..6e6008fbb --- /dev/null +++ b/stripe_webhook/src/generated/mod.rs @@ -0,0 +1,96 @@ +#[derive(Clone, Debug, serde::Deserialize)] +#[non_exhaustive] +#[serde(tag = "object")] +pub enum EventObject { + #[serde(rename = "account")] + Account(stripe_types::Account), + #[serde(rename = "capability")] + AccountCapability(stripe_types::AccountCapability), + #[serde(rename = "application")] + Application(stripe_types::Application), + #[serde(rename = "application_fee")] + PlatformFee(stripe_types::PlatformFee), + #[serde(rename = "fee_refund")] + FeeRefund(stripe_types::FeeRefund), + #[cfg(feature = "stripe_core")] + #[serde(rename = "balance")] + Balance(stripe_core::Balance), + #[serde(rename = "bank_account")] + BankAccount(stripe_types::BankAccount), + #[cfg(feature = "stripe_billing")] + #[serde(rename = "billing_portal.configuration")] + PortalConfiguration(stripe_billing::PortalConfiguration), + #[serde(rename = "card")] + Card(stripe_types::Card), + #[cfg(feature = "stripe_checkout")] + #[serde(rename = "checkout.session")] + Session(stripe_checkout::Session), + #[serde(rename = "coupon")] + Coupon(stripe_types::Coupon), + #[serde(rename = "customer")] + Customer(stripe_types::Customer), + #[serde(rename = "discount")] + Discount(stripe_types::Discount), + #[serde(rename = "dispute")] + Dispute(stripe_types::Dispute), + #[serde(rename = "file")] + File(stripe_types::File), + #[serde(rename = "invoice")] + Invoice(stripe_types::Invoice), + #[serde(rename = "invoiceitem")] + InvoiceItem(stripe_types::InvoiceItem), + #[serde(rename = "issuing.authorization")] + IssuingAuthorization(stripe_types::IssuingAuthorization), + #[serde(rename = "issuing.card")] + IssuingCard(stripe_types::IssuingCard), + #[serde(rename = "issuing.cardholder")] + IssuingCardholder(stripe_types::IssuingCardholder), + #[serde(rename = "issuing.dispute")] + IssuingDispute(stripe_types::IssuingDispute), + #[serde(rename = "issuing.transaction")] + IssuingTransaction(stripe_types::IssuingTransaction), + #[serde(rename = "mandate")] + Mandate(stripe_types::Mandate), + #[serde(rename = "payment_intent")] + PaymentIntent(stripe_types::PaymentIntent), + #[serde(rename = "payment_link")] + PaymentLink(stripe_types::PaymentLink), + #[serde(rename = "payment_method")] + PaymentMethod(stripe_types::PaymentMethod), + #[serde(rename = "payout")] + Payout(stripe_types::Payout), + #[serde(rename = "person")] + Person(stripe_types::Person), + #[serde(rename = "plan")] + Plan(stripe_types::Plan), + #[serde(rename = "price")] + Price(stripe_types::Price), + #[serde(rename = "product")] + Product(stripe_types::Product), + #[serde(rename = "promotion_code")] + PromotionCode(stripe_types::PromotionCode), + #[serde(rename = "quote")] + Quote(stripe_types::Quote), + #[serde(rename = "refund")] + Refund(stripe_types::Refund), + #[serde(rename = "review")] + RadarReview(stripe_types::RadarReview), + #[serde(rename = "setup_intent")] + SetupIntent(stripe_types::SetupIntent), + #[serde(rename = "subscription")] + Subscription(stripe_types::Subscription), + #[serde(rename = "subscription_schedule")] + SubscriptionSchedule(stripe_types::SubscriptionSchedule), + #[serde(rename = "tax_id")] + TaxId(stripe_types::TaxId), + #[serde(rename = "tax_rate")] + TaxRate(stripe_types::TaxRate), + #[serde(rename = "test_helpers.test_clock")] + TestClock(stripe_types::TestClock), + #[serde(rename = "topup")] + Topup(stripe_types::Topup), + #[serde(rename = "transfer")] + Transfer(stripe_types::Transfer), + #[serde(other)] + Unknown, +} diff --git a/stripe_webhook/src/lib.rs b/stripe_webhook/src/lib.rs new file mode 100644 index 000000000..ed5c88e99 --- /dev/null +++ b/stripe_webhook/src/lib.rs @@ -0,0 +1,8 @@ +mod error; +mod generated; +mod webhook; + +pub use error::WebhookError; +pub use generated::*; +pub use stripe_types::notification_event::NotificationEventType as EventType; +pub use webhook::{Event, Webhook}; diff --git a/stripe_webhook/src/webhook.rs b/stripe_webhook/src/webhook.rs new file mode 100644 index 000000000..0bfb91649 --- /dev/null +++ b/stripe_webhook/src/webhook.rs @@ -0,0 +1,215 @@ +use std::collections::HashMap; +use std::str::FromStr; + +use chrono::Utc; +use hmac::{Hmac, Mac}; +use sha2::Sha256; +use stripe_types::{ApiVersion, NotificationEvent}; + +use crate::{EventObject, EventType, WebhookError}; + +#[derive(Clone, Debug)] +pub struct Event { + /// The connected account that originated the event. + pub account: Option, + /// The Stripe API version used to render `data`. + /// + /// *Note: This property is populated only for events on or after October 31, 2014*. + pub api_version: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + pub data: EventData, + /// Unique identifier for the object. + pub id: stripe_types::notification_event::EventId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Number of webhooks that have yet to be successfully delivered (i.e., to return a 20x response) to the URLs you've specified. + pub pending_webhooks: i64, + /// Information on the API request that instigated the event. + pub request: Option, + /// Description of the event (e.g., `invoice.created` or `charge.refunded`). + pub type_: EventType, +} + +#[derive(Clone, Debug)] +pub struct EventData { + /// Object containing the API resource relevant to the event. + /// + /// For example, an `invoice.created` event will have a full [invoice object](https://stripe.com/docs/api#invoice_object) as the value of the object key. + pub object: EventObject, + /// Object containing the names of the updated attributes and their values prior to the event (only included in events of type `*.updated`). + /// + /// If an array attribute has any updated elements, this object contains the entire array. + /// In Stripe API versions 2017-04-06 or earlier, an updated array attribute in this object includes only the updated array elements. + pub previous_attributes: Option, +} + +pub struct Webhook { + current_timestamp: i64, +} + +impl Webhook { + /// # Errors + /// + /// This function will return a WebhookError if: + /// - the provided signature is invalid + /// - the provided secret is invalid + /// - the signature timestamp is older than 5 minutes + pub fn construct_event(payload: &str, sig: &str, secret: &str) -> Result { + Self { current_timestamp: Utc::now().timestamp() }.do_construct_event(payload, sig, secret) + } + + fn do_construct_event( + self, + payload: &str, + sig: &str, + secret: &str, + ) -> Result { + // Get Stripe signature from header + let signature = Signature::parse(sig)?; + let signed_payload = format!("{}.{}", signature.t, payload); + + // Compute HMAC with the SHA256 hash function, using endpoint secret as key + // and signed_payload string as the message. + let mut mac = + Hmac::::new_from_slice(secret.as_bytes()).map_err(|_| WebhookError::BadKey)?; + mac.update(signed_payload.as_bytes()); + + let sig = hex::decode(signature.v1).map_err(|_| WebhookError::BadSignature)?; + + mac.verify_slice(sig.as_slice()).map_err(|_| WebhookError::BadSignature)?; + + // Get current timestamp to compare to signature timestamp + if (self.current_timestamp - signature.t).abs() > 300 { + return Err(WebhookError::BadTimestamp(signature.t)); + } + + let base_evt: NotificationEvent = serde_json::from_str(payload)?; + + Ok(Event { + account: base_evt.account, + api_version: base_evt + .api_version + .map(|s| ApiVersion::from_str(&s).unwrap_or(ApiVersion::Unknown)), + created: base_evt.created, + data: EventData { + object: serde_json::from_value(base_evt.data.object)?, + previous_attributes: base_evt.data.previous_attributes, + }, + id: base_evt.id, + livemode: base_evt.livemode, + pending_webhooks: base_evt.pending_webhooks, + request: base_evt.request, + type_: base_evt.type_, + }) + } +} + +#[derive(Debug)] +struct Signature<'r> { + t: i64, + v1: &'r str, +} + +impl<'r> Signature<'r> { + fn parse(raw: &'r str) -> Result, WebhookError> { + let headers: HashMap<&str, &str> = raw + .split(',') + .map(|header| { + let mut key_and_value = header.split('='); + let key = key_and_value.next(); + let value = key_and_value.next(); + (key, value) + }) + .filter_map(|(key, value)| match (key, value) { + (Some(key), Some(value)) => Some((key, value)), + _ => None, + }) + .collect(); + let t = headers.get("t").ok_or(WebhookError::BadSignature)?; + let v1 = headers.get("v1").ok_or(WebhookError::BadSignature)?; + Ok(Signature { t: t.parse::().map_err(WebhookError::BadHeader)?, v1 }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::EventType; + + #[test] + fn test_signature_parse() { + let raw_signature = + "t=1492774577,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd"; + let signature = Signature::parse(raw_signature).unwrap(); + assert_eq!(signature.t, 1492774577); + assert_eq!( + signature.v1, + "5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd" + ); + + let raw_signature_with_test_mode = "t=1492774577,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd,v0=6ffbb59b2300aae63f272406069a9788598b792a944a07aba816edb039989a39"; + let signature = Signature::parse(raw_signature_with_test_mode).unwrap(); + assert_eq!(signature.t, 1492774577); + assert_eq!( + signature.v1, + "5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd" + ); + } + + #[test] + fn test_webhook_construct_event() { + let payload = r#"{ + "id": "evt_123", + "object": "event", + "account": "acct_123", + "api_version": "2017-05-25", + "created": 1533204620, + "data": { + "object": { + "id": "ii_123", + "object": "invoiceitem", + "amount": 1000, + "currency": "usd", + "customer": "cus_123", + "date": 1533204620, + "description": "Test Invoice Item", + "discountable": false, + "invoice": "in_123", + "livemode": false, + "metadata": {}, + "period": { + "start": 1533204620, + "end": 1533204620 + }, + "proration": false, + "quantity": 3 + } + }, + "livemode": false, + "pending_webhooks": 1, + "request": { + "id": "req_123", + "idempotency_key": "idempotency-key-123" + }, + "type": "invoiceitem.created" +} +"#; + let event_timestamp = 1533204620; + let secret = "webhook_secret".to_string(); + let signature = format!("t={},v1=82216eca827bcb7b34b8055eb2d2d9e6bc13b9ac39ded14a61e69f70c565f53a,v0=63f3a72374a733066c4be69ed7f8e5ac85c22c9f0a6a612ab9a025a9e4ee7eef", event_timestamp); + + let webhook = Webhook { current_timestamp: event_timestamp }; + + let event = webhook + .do_construct_event(payload, &signature, &secret) + .expect("Failed to construct event"); + + assert_eq!(event.type_, EventType::InvoiceitemCreated); + assert_eq!(event.id.as_str(), "evt_123",); + assert_eq!(event.account, "acct_123".parse().ok()); + assert_eq!(event.created, 1533204620); + } +}